How to operate my own Echo node
To begin with, you need to build the project.
Then, we can start echo_node and interact with this node using RPC requests over HTTP or WebSocket. For it, you can use echo_wallet or a third-party program like curl or wscat.

Start node

You can start a node with different parameters. The parameters are passed using the command-line or the configuration file.

Command-line syntax

1
./echo_node --key1=value1 --key2 value2 -k v --key3=["value1", "value2"]
Copied!

Configure file syntax

1
# this is comment
2
key = value
Copied!
key is the argument without a dash

Launch echo_node with registrator account

Registrar account have opportunity to register other accounts. For lauching should be specified --account-info argument with pair of account id and public key and specified --registrar-account argument with account id.
1
> ./echo_node --account-info ["1.2.6", "5JwnAdjJWufcv5c2xiEy1Ht8JUfND3o232JTbL2kze4TLhCJEcC"] --registrar-account "1.2.6"
Copied!

Decrese memory usage

To decrese memory usage specify some history plugin arguments.
For example you may track only certain contracts or accounts and store not all their history, but only last certain number of operations. Also history plugin stores the least information about transactions(block number, inxed in block, id of transaction). --max-transaction-ids-to-store is used to regulate amount of stored transaction_info.
1
> ./echo_node --track-contract "1.11.1" --track-contract "1.11.2" --track-account "1.2.18" --max-ops-per-contract 100 --max-ops-per-account 100 --max-transaction-ids-to-store 1000
Copied!
By default echo_node track all accounts and contracts and store all history and all transactions.

Arguments: description and examples

1
> ./echo_node -h
Copied!

Change data directory path

The data directory contains the configure file, databases, and more.
1
> ./echo_node -d /tmp/echo_dir
2
> ./echo_node --datadir /tmp/echo_dir
Copied!

Activate the testnet options

1
> ./echo_node --testnet
Copied!

Activate the Devnet options

1
> ./echo_node --devnet
Copied!
1
> ./echo_node -v
2
> ./echo_node --version
Copied!

Encrypt keys

Run interactive mode to encrypt keys and save them in keys file.
1
> ./echo_node --configure-keys
Copied!

Config seeds only

Use the config seed only (do not use built-in and received seeds).
1
> ./echo_node --config-seeds-only
Copied!

Create genesis json

Create a genesis.json at corresponding datadir. Depending on which options preset is selected (mainnet or testnet) it will output different Genesis State.
1
> ./echo_node --testnet --create-genesis-json --data-dir datadir
Copied!

Create example genesis json

Path to create an example Genesis State at. If a well-formed JSON file exists at the path, it will be parsed and any missing fields in a Genesis State will be added, and any unknown fields will be removed. If no file or an invalid file is found, it will be replaced with an example Genesis State.
1
> ./echo_node --example-genesis-json /tmp/echo_dir
Copied!

Replay blockchain

Rebuild object graph by replaying all blocks.
1
> ./echo_node --replay-blockchain
Copied!

Resync blockchain

Delete all blocks and re-sync with network from scratch.
1
> ./echo_node --resync-blockchain
Copied!

Force validate

Force validation of all transactions.
1
> ./echo_node --force-validate
Copied!

Replace timestamp

Replace timestamp from genesis.json with current time plus this many seconds (experts only!).
1
> ./echo_node --genesis-timestamp 10
Copied!

P2P endpoit

Endpoint for P2P node to listen on.
1
> ./echo_node --p2p-endpoint 127.0.0.1:13375
Copied!

Seed node

P2P nodes to connect to on startup (may specify multiple times).
1
> ./echo_node --seed-node "127.0.0.1:13376" -s "127.0.0.1:13377"
Copied!

Seed nodes

JSON array of P2P nodes to connect to to on startup.
1
> ./echo_node --seed-nodes "[127.0.0.1:13376, 127.0.0.1:13377]"
Copied!

Block checkpoint

Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
1
> ./echo_node --checkpoint "[10, 0000004184e6200e609bca12f8f54a1cf55704cb]"
Copied!

RPC endpoint

Endpoint for websocket RPC to listen on.
1
> ./echo_node --rpc-endpoint "127.0.0.1:8090"
Copied!

RPC domains

Domains from which to accept cross origin requests.
1
> ./echo_node --rpccorsdomain example.com
Copied!

Genesis JSON file

File to read Genesis State from.
1
> ./echo_node --genesis-json /tmp/echo_dir/genesis.json
Copied!

API JSON file

JSON file specifying API permissions.
1
> ./echo_node --api-access /tmp/echo_dir/api.json
Copied!

Plugins activation

Comma-separated list of plugins which will be activated in addition to default.
1
> ./echo_node --plugins="sidechain,registration,shapshot"
Copied!

Btc sidechain for Bitcoin testnet

Generate address in operations for Bitcoin testnet
1
> ./echo_node --sidechain-btc-testnet
Copied!

P2P compression

Compress communication channels for this P2P node.
1
> ./echo_node --p2p-compress
Copied!

P2P encryption

Encrypt communication channels for this P2P node.
1
> ./echo_node --p2p-encrypt
Copied!

Start echorand

Enable Echorand, even if the chain is stale.
1
> ./echo_node --start-echorand
Copied!

Account info

Pairs of [AccountID, WIF private key] (may specify multiple times).
1
> ./echo_node --account-info ["1.2.6", "5JwnAdjJWufcv5c2xiEy1Ht8JUfND3o232JTbL2kze4TLhCJEcC"]
Copied!

Sidechain committeeman

Sidechain: Pair of [account_id, eth_private_key] that should correspond to committee account (may be specified multiple times).
1
> ./echo_node --sidechain-eth-committeeman ["1.2.6", "8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f"]
Copied!

Activate the sidechain plug-in

1
> ./echo_node --sidechain
Copied!

RPC address of Ethereum node for sidechain

1
> ./echo_node --eth-rpc-ip 127.0.0.1
Copied!

RPC port of Ethereum node for sidechain

1
> ./echo_node --eth-rpc-port 183332
Copied!

Disable Ethereum service

1
> ./echo_node --sidechain-eth-disable
Copied!

BTC sidechain committeeman

Sidechain: Tuple of [account_id, WIF BTC private key] (may specify multiple times).
1
> ./echo_node --sidechain-btc-committeeman ["1.2.6", "5HueCGU8rMjxEXxiPuD5BDk_SAMPLE_PRIVATE_KEY_DO_NOT_IMPORT_u4MkFqeZyd4dZ1jvhTVqvbTLvyTJ"]
Copied!

RPC ip of BTC node

1
> ./echo_node --btc-rpc-ip 127.0.0.1
Copied!

RPC port of BTC node

1
> ./echo_node --btc-rpc-port 183332
Copied!

RPC user of BTC node

1
> ./echo_node --btc-rpc-user user
Copied!

RPC password of BTC node

1
> ./echo_node --btc-rpc-user password
Copied!

Disable BTC service

1
> ./echo_node --sidechain-btc-disable
Copied!

Registrar account

ID of registrar account on this node (should be imported as account-info).
1
> ./echo_node --registrar-account "1.2.6"
Copied!

Registration difficult

Complexity of POW task to register account.
1
> ./echo_node --registration-difficulty 10
Copied!

Lifetime of registration tasks(in blocks)

1
> ./echo_node --ethrpc-registration-task-lifetime 20
Copied!

Track account history

Account ID to track history for (may specify multiple times).
1
> ./echo_node --track-account "1.2.6"
Copied!

Maximum number of ops per account in history

Maximum number of operations per account will be kept in memory.
1
> ./echo_node --max-ops-per-account 1000
Copied!

Track contract history

Contract ID to track history for (may specify multiple times).
1
> ./echo_node --track-contract "1.11.1"
Copied!

Maximum number of ops per contract in history

Maximum number of operations per contract will be kept in memory.
1
> ./echo_node --max-ops-per-contract 1000
Copied!

Maximum number of transaction info in history

Maximum number of transaction info to store in memory.
1
> ./echo_node --max-transaction-ids-to-store 1000
Copied!

Partial operation storing

Keep only those operations in memory that are related to history tracking.
1
> ./echo_node --partial-operations
Copied!

Endpoint for EthRPC

Endpoint for EthRPC to listen on.
1
> ./echo_node --ethrpc-endpoint 0.0.0.0:9091
Copied!

Block number after which to do a snapshot

1
> ./echo_node --snapshot-at-block 10
Copied!

Block time (ISO format) after which to do a snapshot

1
> ./echo_node --snapshot-at-time 2020-08-09T18:31:42
Copied!

Pathname of JSON file where to store the snapshot

1
> ./echo_node --snapshot-to /tmp/echo/snap.json
Copied!

Connect to node

To perform operations, we need to connect to the node. Below we consider connecting via curl.
Example:
1
curl --data '{"jsonrpc": "2.0", "params": ["database", "get_account_by_name", ["nathan"]], "method": "call", "id": 1}' http://localhost:8090/rpc
Copied!
Here, we request the Database API using the method get_account_by_name with the argument "nathan"
Response:
1
{"id":1,"jsonrpc":"2.0","result":{"id":"1.2.26","registrar":"1.2.4","name":"nathan","active":{"weight_threshold":1,"account_auths":[],"key_auths":[["ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",1]]},"echorand_key":"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu","active_delegate_share":2000,"options":{"delegating_account":"1.2.5","delegate_share":2000,"extensions":[]},"statistics":"2.5.26","whitelisting_accounts":[],"blacklisting_accounts":[],"whitelisted_accounts":[],"blacklisted_accounts":[],"active_special_authority":[0,{}],"top_n_control_flags":0,"accumulated_reward":[],"extensions":[]}}
Copied!
In the API methods description, you can find the RPC request body.

Stop ECHO node

To stop the node, send it the SIGINT signal (use Ctrl + C shortcut).
Last modified 1yr ago