Voting as a Representative¶
The default node setup guide provides instructions for getting a non-voting node setup, but if you're looking to run a Representative node, and perhaps hoping to become a Principal Representative, the node will need to be configured to vote and be setup with a Representative account.
Before getting into the setup instructions, there are a few important considerations:
Commitment, security and maintenance¶
Running a CGA Representative is a commitment to helping secure the network. This can only be done if the operation of the node is taken seriously.
- Prepare for the necessary maintenance on the node and host machine
- Carefully review the security guide and follow general security best practices at all times
- Ensure you are prepared for the time and cost commitments of maintaining the node over the long term to help maximize the benefits
Hardware recommendations¶
Principal Representative Nodes¶
The following are minimum recommended specifications for nodes with more than 0.1% of the online voting weight (Principal Representatives):
- 4GB RAM
- Quad-Core CPU
- 200 Mbps bandwidth
- SSD-based hard drive with 50GB+ of free space
Non-voting and Representative Nodes¶
The following are minimum recommended specifications for non-voting nodes and Representative nodes with less than 0.1% of the online voting weight (regular Representatives):
- 2GB RAM (additional RAM or swap space may be needed if bootstrapping a new node from scratch)
- Dual-Core CPU
- 100 Mbps bandwidth
- SSD-based hard drive with 50GB+ of free space
Varied resource usage
Various factors affect resource usage including how often RPC calls are made, other applications running on the machine, etc. These recommendations should be evaluated along with other considerations.
Work Generation guide
For nodes being used with services requiring regular or high volume sending and receiving of transactions, special considerations must be made for handling Proof-of-Work generation activities. Find details on configuring a GPU, external work services and more for the perfect setup in the Work Generation guide.
Step 1: Enable voting¶
For the node to start voting, the following configuration options need to be updated:
enable_voting¶
As of V18.0, newly setup nodes have voting disabled by default. In order to participate in network consensus, this value must be updated in the config.json file.
enable_voting = true
rpc_enable¶
To enable communication via RPC, set this configuration option in the config.json file.
rpc_enable = true
enable_control¶
This configuration option, which is needed to create the account for the Representative, is set in the config.json file. Please make sure you are aware of the sensitive RPC calls enabling this option opens up as detailed on the configuration page.
enable_control = true
Step 2: Setup Representative account¶
Add a representative account to a wallet:
- Use wallet_create RPC, optionally with
seedif you already know your representative account’s seed - One of the following:
- wallet_add RPC, if you have a private key and didn’t have a seed before
- account_create RPC if you had a seed or are creating a new representative account
- Verify the account is in the wallet with account_list
Open the account - until you do account_info and others will fail:
- Send some funds to the account, at least 0.01 CGA
- Use search_pending to make the wallet open the account automatically
- Use account_info to verify the state of the account
- If the account is still not open, use receive as a backup
Step 3: Restart the node and check voting¶
Before the node will vote, the representative account configured above must have at least 1000 CGA delegated to it. This is done by changing the representative of other accounts in your wallet with account_representative_set. If you do not control over 1000 CGA, you will need to have others delegate their weight to your representative.
Warning - Multiple Node Setups
Never use the same seed on multiple running cga_node instances at the same time.
- Multiple cga_nodes using the same seed can result in network race conditions that degrade performance for your personal accounts.
- In addition, Publishing transactions from two nodes with the same account at the same time may cause an account fork which requires a slower representative voting process.
- Similarly, if you are running a representative account on multiple nodes, they may publish conflicting votes, causing your representative to be ignored by the network.
- Performance degradation in enterprise environments may be significant.
Step 4 (Optional): Disable RPC control commands for more security¶
enable_control was only needed to create the account which the Representative uses to vote. It is not actually needed for voting. Therefore there is no need to actually keep it active after the node is prepared for voting.
In the config.json file, you can disable the control commands again by setting enable_control back to false.
enable_control = false
Step 5: Monitoring and more¶
Congratulations on getting your representative setup! If you are able to do a good job maintaining the node and keeping it performing well, you may have a chance at becoming a Principal Representative. To reach this higher level of participation in consensus, you must get at least 0.1% of online voting weight delegated to your node. After that any votes you send for transactions will be rebroadcast by other nodes to help with consensus even more.