Node Configuration¶
The CGA node software is designed to run with little or no configuration. All configuration options have defaults that can be changed using JSON configuration files, by changing configuration values.
Configuration file locations¶
The node and its related processes will look for config file table below.
| OS | Location |
|---|---|
| Windows | C:\Users\<user>\AppData\Local\CGA\config.json |
| Linux | /home/<user>/CGA/config.json |
Configuration options¶
Below is a complete example of the config.json file:
{
"version": "(int)", // Wallet version
"wallet": "(string)", // Default wallet to load on boot (only for GUI wallet)
"account": "(string)", // Default account to load on boot (only for GUI wallet)
"node": {
"version": "(int)", // Node version
"peering_port": "7032", // Default node port
"bootstrap_fraction_numerator": "1",
"enable_voting": "false", // Enable or disable voting for blocks. If disabled, saves some resources
"receive_minimum": "1000000000000000000000000", // Minimum import receivable, default 1 Rai
"logging": {
"ledger": "false", // Track incoming blocks
"ledger_duplicate": "false",
"network": "true", // Track general network info like forks
"network_timeout": "false", // Track TCP socket disconnections due to timeout
"network_message": "false",
"network_publish": "false", // Track blocks you publish to
"network_packet": "false", // Track packets origin
"network_keepalive": "false", // Track keepalive messages
"network_node_id_handshake": "false", // Track node_id messages
"node_lifetime_tracing": "false",
"insufficient_work": "true",
"bulk_pull": "false", // Bootstrap related logging
"work_generation_time": "true",
"log_to_cerr": "false",
"max_size": "16777216", // Max size of logs before old files deletion. Default is 16MB
"rotation_size": "4194304", // Size of Log File before rotation in bytes, Default is 4MB
"version": "(int)", // Logging config version
"vote": "false", // Track voting activities
"flush": "true", // Setting this to false gives better performance, but may lose entries on crashes.
"upnp_details": "false", // Determines if upnp discovery details are logged (default off to avoid sharing device info when shipping logs)
"timing": "false", // Logs durations of key functions, such as batch verification, etc.
"log_ipc": "true", // Logging of IPC related messages
"min_time_between_output": "5", // Minimum time between log calls, in ms
"single_line_record": "false" // Log each record in single line (including block content & election results with votes)
},
"vote_minimum": "1000000000000000000000000000000000", // Prevents voting if delegated weight is under this threshold
"work_peers": "", // Delegate a node your hash work, you need to get RPC access to that node
"preconfigured_peers": [
// List of defaults peers to connect on boot
"peering.cgaco.net"
],
"preconfigured_representatives": [
// List of defaults representatives, which you delegate voting weight, of your wallet
"cga_39e3z95m4xiercu3dsh87konsm91to3rtqjgw894tqhq1y4akkrifdns7mgp",
"cga_34qqtus65ea4rwftgmue389csma467bsdmcukjunrf3dusfubwft5agutnhn",
"cga_1oxxnqu5oh99k3qow9k3hqq4rjtx8jr8kudx73n783dda6736gurkah9uc6j",
"cga_33g39o1bd4owd798ps5nf1k1ogjtnryc9m1xrjc5u94hsb8cccm8nrtuk8rk",
"cga_1j16bbpgnca9te39ph9ackdk3iae46rorcsgguk9sw1xdnpt1hswkgy9e3xc",
"cga_18fdp3tcg4u9itsj8958eapuak8c4hy4ijxgrsxezmuxjuepxbafug1eojbf"
],
"online_weight_minimum": "60000000000000000000000000000000000000", // Online weight minimum required to confirm block
"online_weight_quorum": "50", // Percentage of votes required to rollback blocks
"password_fanout": "1024",
"io_threads": "4",
"work_threads": "4", // PoW work threads. By default all available CPU threads, set lower value for 24/7 services
"callback_address": "::ffff:127.0.0.1", // Callback IP address, in sample IPv4 localhost
"callback_port": "17076", // Callback port
"callback_target": "/", // Callback target, in sample root of callback listening server
"bootstrap_connections": "16", // Multi-connection bootstrap. Should be a power of 2.
"bootstrap_connections_max": "4", // Allowed incoming bootstrap connections count. Lower value save IOPS & bandwidth. 64 recommended for high-end fast nodes, 0 for HDD home users,
"lmdb_max_dbs": "128", // Maximum open DBs (MAX_DBS https://lmdb.readthedocs.io/en/release/), increase default if more than 100 wallets required
"block_processor_batch_max_time": "5000", // Number of milliseconds the block processor works at a time
"allow_local_peers": "false", // To allow local host peering
"signature_checker_threads": "1", // Number of threads to use for verifying signatures
"unchecked_cutoff_time": "14400", // Number of seconds unchecked entry survives before being cleaned
"ipc": {
// For more details about these options see the IPC section below
"tcp": {
"enable": "false",
"port": "7074",
"io_timeout": "15"
},
"local": {
"version": "1",
"enable": "false",
"allow_unsafe": "false",
"path": "/tmp/cga",
"io_timeout": "15"
}
},
},
"rpc_enable": "true", // Enable (in-process or child process) or disable RPC. Out of process rpc servers can still be used if launched manually.
"rpc": {
"address": "::ffff:127.0.0.1", // Rpc IP address, in sample IPv4 localhost. For IPv6 localhost, Use "[::1]"
"port": "7132", // Rpc Port
"enable_control": "true", // false by default
"frontier_request_limit": "16384",
"chain_request_limit": "16384",
"max_json_depth": "20",
"enable_sign_hash": "false"
},
"opencl_enable": "false", // Enable GPU hashing
"opencl": {
"platform": "0", // Platform ID
"device": "0", // Device ID
"threads": "1048576"
}
}
Notable configuration options¶
RPC¶
Dangerous RPC calls controlled by enable_control
Due to the sensitive or dangerous nature of these calls, caution should be used when considering setting enable_control to true in your config file. It is highly recommended to only enable this when RPC ports are listening exclusively to local or loopback IP addresses or other measure are put in place outside the node to limit RPC access to dangerous calls. For more details see the Node Security page.
rpc_enable¶
To enable communication via RPC, set this configuration option in the config.json file.
rpc_enable = true
enable_control¶
This configuration option is set in the config.json file.
Due to their sensitive or dangerous nature, certain RPC calls/options require this setting to be enabled before they can be used. Examples of RPC calls that require this include:
- stop: allows you to completely stop the node from running
- work_generate: allows potential consumption of CPU or GPU resources on the node or attached work peers to generate PoW
- send: can be used to transfer available funds in the wallet to another account
- Various other wallet and resource-heavy operations
enable_control = false
Work generation¶
See the Work Generation guide.
IPC¶
Work in progress
IPC is a work in progress, and will activate in a future node release.
Voting¶
See the Voting as a Representative guide.
HTTP callback¶
These configuration options are set in the config.json file.
callback_address = "127.0.0.1" // Example for localhost
callback_port: "2725", // Example port number
callback_target: "\/", // Example target location "/"
JSON POST requests with every confirmed block are sent to the callback server as defined in the config values above: http://callback_address:callback_port<callback_target>. Callback target should include a leading slash.
For details on how to integrate using the HTTP callback, see the HTTP Callback section of the Integration Guides.
Network Details¶
| Port | Type | Default | Details |
|---|---|---|---|
| 7032 | TCP | Enabled |
|
| 7132 | TCP | Disabled |
|