CLI Commands
This section details the present commands, command flags in the dogechain, and how they're used.
The --json
flag is supported on some commands. This flag instructs the command to print the output in JSON format
Reference Version
v1.2.0
Startup Commands
Command | Description |
---|---|
server | The default command that starts the blockchain client, by bootstrapping all modules together |
genesis | Generates a genesis.json file, which is used to set a predefined chain state before starting the client. The structure of the genesis file is described below |
server flags
seal
- Syntax
- Example
server [--seal SHOULD_SEAL]
server --seal
server --seal=false
Sets the flag indicating that the client should seal blocks. Default: false
.
data-dir
- Syntax
- Example
server [--data-dir DATA_DIRECTORY]
server --data-dir ./example-dir
Used to specify the data directory used for storing Dogechain-Lab Dogechain client data. Default: ./dogechain-chain
.
jsonrpc
- Syntax
- Example
server [--jsonrpc JSONRPC_ADDRESS]
server --jsonrpc 127.0.0.1:10000
Sets the address and port for the JSON-RPC service address:port
.
If only port is defined :10001
it will bind to all interfaces 0.0.0.0:10001
.
If omitted the service will bind to the default address:port
.
Default address: 0.0.0.0:8545
.
json-rpc-batch-request-limit
- Syntax
- Example
server [--json-rpc-batch-request-limit BATCH_REQUST_LIMIT]
server --json-rpc-batch-request-limit 5
Sets the max length to be considered when handling json-rpc batch requests. Default 1
.
Turn it off by setting 0
.
json-rpc-block-range-limit
- Syntax
- Example
server [--json-rpc-block-range-limit BLOCK_RANGE_LIMIT]
server --json-rpc-block-range-limit 100
Sets the max block range to be considered when executing json-rpc requests that consider fromBlock/toBlock values. Default 100
.
Turn it off by setting 0
.
json-rpc-namespace
- Syntax
- Example
server [--json-rpc-namespace NAMESPACES]
server --json-rpc-namespace "eth,net,web3,txpool,debug"
server --json-rpc-namespace "eth,web3"
server --json-rpc-namespace "*"
Sets the jsonrpc endpoint namespaces should be enabled (eth, net, web3, txpool, debug. concatenate with commas or *
for all). Default *
.
enable-ws
- Syntax
- Example
server [--enable-ws SHOULD_ENABLE_WEBSOCKET]
server --enable-ws
Sets the flag indicating that node enable WebSocket service. Default: false
.
grpc
- Syntax
- Example
server [--grpc-address GRPC_ADDRESS]
server --grpc-address 127.0.0.1:9632
Sets the address and port for the gRPC service address:port
. Default address: 127.0.0.1:9632
.
libp2p
- Syntax
- Example
server [--libp2p LIBP2P_ADDRESS]
server --libp2p 127.0.0.1:1478
Sets the address and port for the libp2p service address:port
. Default address: 127.0.0.1:1478
.
prometheus
- Syntax
- Example
server [--prometheus PROMETHEUS_ADDRESS]
server --prometheus 127.0.0.1:10004
Sets the address and port for the prometheus server address:port
.
If only port is defined :5001
the service will bind to all interfaces 0.0.0.0:5001
.
If omitted the service will not be started.
block-gas-target
- Syntax
- Example
server [--block-gas-target BLOCK_GAS_TARGET]
server --block-gas-target 10000000
Sets the target block gas limit for the chain. If omitted, the value of the parent block is used. Default (not enforced): 0
.
A more detailed explanation on the block gas target can be found in the TxPool section.
max-peers
- Syntax
- Example
server [--max-peers PEER_COUNT]
server --max-peers 40
Sets the client's maximum peer count. Default: 40
.
Peer limit should be specified either by using max-peers
or max-inbound/outbound-peers
flag.
max-inbound-peers
- Syntax
- Example
server [--max-inbound-peers PEER_COUNT]
server --max-inbound-peers 32
Sets the client's maximum inbound peer count. If max-peers
is set, max-inbound-peer limit is calculated using the following formulae.
max-inbound-peer = InboundRatio * max-peers
, where InboundRatio
is 0.8
.
max-outbound-peers
- Syntax
- Example
server [--max-outbound-peers PEER_COUNT]
server --max-outbound-peers 8
Sets the client's maximum outbound peer count. If max-peers
is set, max-outbound-peer count is calculated using the following formulae.
max-outbound-peer = OutboundRatio * max-peers
, where OutboundRatio
is 0.2
.
log-level
- Syntax
- Example
server [--log-level LOG_LEVEL]
server --log-level DEBUG
Sets the log level for console output. Default: INFO
.
chain
- Syntax
- Example
server [--chain GENESIS_FILE]
server --chain /home/ubuntu/genesis.json
Specifies the genesis file used for starting the chain. Default: ./genesis.json
.
join
- Syntax
- Example
server [--join JOIN_ADDRESS]
server --join /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmJxxH1tScDX2rLGSU9exnuvZKNM9SoK3v315azp68DLPW
Specifies the address of the peer that should be joined.
nat
- Syntax
- Example
server [--nat NAT_ADDRESS[:PORT]]
server --nat 192.0.2.1
server --nat 192.0.2.1:22222
Sets the external address (address:port), as can be seen by peers.
dns
- Syntax
- Example
server [--dns DNS_ADDRESS]
server --dns dns4/example.io
Sets the host DNS address. This can be used to advertise an external DNS. Supports dns
,dns4
,dns6
.
price-limit
- Syntax
- Example
server [--price-limit PRICE_LIMIT]
server --price-limit 250000000000
Sets minimum gas price limit to enforce for acceptance into the pool. Default: 0
.
max-slots
- Syntax
- Example
server [--max-slots MAX_SLOTS]
server --max-slots 4096
Sets maximum slots in the pool. Default: 4096
.
config
- Syntax
- Example
server [--config CLI_CONFIG_PATH]
server --config ./myConfig.json
Specifies the path to the CLI config. Supports .json
and .hcl
.
secrets-config
- Syntax
- Example
server [--secrets-config SECRETS_CONFIG]
server --secrets-config ./secretsManagerConfig.json
Sets the path to the SecretsManager config file. Used for Hashicorp Vault and GCP SSM. If omitted, the local FS secrets manager is used.
dev
- Syntax
- Example
server [--dev DEV_MODE]
server --dev
Sets the client to dev mode. Default: false
.
dev-interval
- Syntax
- Example
server [--dev-interval DEV_INTERVAL]
server --dev-interval 1
Sets the client's dev notification interval in seconds. Default: 0
.
no-discover
- Syntax
- Example
server [--no-discover NO_DISCOVER]
server --no-discover
Prevents the client from discovering other peers. Default: false
.
restore
- Syntax
- Example
server [--restore RESTORE]
server --restore backup.dat
Sets the path to the archive blockchain data to restore on initialization.
block-time
- Syntax
- Example
server [--block-time BLOCK_TIME]
server --block-time 2
Sets minimum block time in seconds (at least 1
s). Default: 2
access-control-allow-origins
- Syntax
- Example
server [--access-control-allow-origins ACCESS_CONTROL_ALLOW_ORIGINS]
server --access-control-allow-origins "https://dogechain-docs.doge.technology"
Sets the authorized domains to be able to share responses from JSON-RPC requests.
Add multiple flags --access-control-allow-origins "https://example1.com" --access-control-allow-origins "https://example2.com"
to authorize multiple domains.
If omitted Access-Control-Allow-Origins header will be set to *
and all domains will be authorized.
daemon
- Syntax
- Example
server [--daemon SHOULD_RUN_AS_DAEMON]
server --daemon
Sets the flag indicating that the server ran as daemon. Default: false
.
Once the flag set, node would not use local secret files, but accept the private keys on the first start up.
log-to
- Syntax
- Example
server [--log-to LOG_FILE_PATH]
server --log-to ./dogechain-testing.log
Sets the flag to write all logs to the file at specified location instead of writing them to console. If omitted, logs would be written to console.
enable-graphql
- Syntax
- Example
server [--enable-graphql SHOULD_ENABLE_GRAPHQL]
server --enable-graphql
Sets the flag indicating that node enable graphql service. Default: false
.
graphql-address
- Syntax
- Example
server [--graphql-address GRAPHQL_ADDRESS]
server --graphql-address :9898
The GraphQL interface. Default: 127.0.0.1:9898
.
promote-outdate-seconds
- Syntax
- Example
server [--promote-outdate-seconds PROMOTE_OUTDATE_SECONDS]
server --promote-outdate-seconds 3600
Account in the pool not promoted for a long time would be pruned. Default: 3600
.
prune-tick-seconds
- Syntax
- Example
server [--prune-tick-seconds PROMOTE_OUTDATE_SECONDS]
server --prune-tick-seconds 300
Tick seconds for pruning account future transactions in the pool. Default: 300
.
Should not be larger than promote-outdate-seconds
flag, otherwise, unknown errors
might happen.
leveldb.bloom-bits
- Syntax
- Example
server [--leveldb.bloom-bits BLOOM_BITS]
server --leveldb.bloom-bits 4096
Sets the bits of leveldb bloom filters. Default: 2048
.
leveldb.cache-size
- Syntax
- Example
server [--leveldb.cache-size CACHE_MB_SIZE]
server --leveldb.cache-size 2048
Sets the size of the leveldb cache in MB. Default: 1024
.
leveldb.handles
- Syntax
- Example
server [--leveldb.handles OPEN_FILES]
server --leveldb.handles 1024
Sets the number of handles to leveldb open files. Default: 512
.
leveldb.table-size
- Syntax
- Example
server [--leveldb.table-size TBL_MB_SIZE]
server --leveldb.table-size 8
Sets the leveldb 'sorted table' size in MB. Default: 8
.
leveldb.total-table-size
- Syntax
- Example
server [--leveldb.total-table-size TOTAL_TBL_MB_SIZE]
server --leveldb.total-table-size 32
Sets limits leveldb total size of 'sorted table' for each level in MB. Default: 32
.
pprof
- Syntax
- Example
server [--pprof SHOULD_ENABLE_PPROF]
server --pprof
Enables the pprof server. Default: false
.
pprof-address
- Syntax
- Example
server [--pprof-address SHOULD_ENABLE_PPROF]
server --pprof-address 127.0.0.1:6060
Sets the address and port for the pprof service. Default address: 127.0.0.1:6060
.
genesis flags
dir
- Syntax
- Example
genesis [--dir DIRECTORY]
genesis --dir ./genesis.json
Sets the directory for the dogechain genesis data. Default: ./genesis.json
.
name
- Syntax
- Example
genesis [--name NAME]
genesis --name test-chain
Sets the name for the chain. Default: dogechain
.
pos
- Syntax
- Example
genesis [--pos IS_POS]
genesis --pos
Sets the flag indicating that the client should use Proof of Stake IBFT.
Defaults to Proof of Authority if flag is not provided or false
.
epoch-size
- Syntax
- Example
genesis [--epoch-size EPOCH_SIZE]
genesis --epoch-size 50
Sets the epoch size for the chain. Default 100000
.
premine
- Syntax
- Example
genesis [--premine ADDRESS:VALUE]
genesis --premine 0x3956E90e632AEbBF34DEB49b71c28A83Bc029862:1000000000000000000000
Sets the premined accounts and balances in the format address:amount
.
The amount can be in either decimal or hex.
Default premined balance: 0x3635C9ADC5DEA00000
.
chain-id
- Syntax
- Example
genesis [--chain-id CHAIN_ID]
genesis --chain-id 200
Sets the ID of the chain. Default: 2000
.
ibft-validators-prefix-path
- Syntax
- Example
genesis [--ibft-validators-prefix-path IBFT_VALIDATORS_PREFIX_PATH]
genesis --ibft-validators-prefix-path test-chain-
Prefix path for validator folder directory. Needs to be present if the flag ibft-validator
is omitted.
ibft-validator
- Syntax
- Example
genesis [--ibft-validator IBFT_VALIDATOR_LIST]
genesis --ibft-validator 0xC12bB5d97A35c6919aC77C709d55F6aa60436900
Sets passed in addresses as IBFT validators. Needs to be present if the flag ibft-validators-prefix-path
is omitted.
block-gas-limit
- Syntax
- Example
genesis [--block-gas-limit BLOCK_GAS_LIMIT]
genesis --block-gas-limit 5000000
Refers to the maximum amount of gas used by all operations in a block. Default: 5242880
.
consensus
- Syntax
- Example
genesis [--consensus CONSENSUS_PROTOCOL]
genesis --consensus ibft
Sets consensus protocol. Default: pow
.
bootnode
- Syntax
- Example
genesis [--bootnode BOOTNODE_URL]
genesis --bootnode /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmJxxH1tScDX2rLGSU9exnuvZKNM9SoK3v315azp68DLPW
Multiaddr URL for p2p discovery bootstrap. This flag can be used multiple times. Instead of an IP address, the DNS address of the bootnode can be provided.
bridge-owner
- Syntax
- Example
genesis [--bridge-owner BRIDGE_CONTRACT_OWNER]
genesis --bridge-owner 0xeeA13dF426dcF62999B9bFf912f58E25f4f9Ba2f
Sets the system bridge contract owner address.
bridge-signer
- Syntax
- Example
genesis [--bridge-signer SIGNER_ACCOUNT_LIST]
genesis --bridge-signer 0xa39b6aA2CD5139bA742f9D9cd4a72458D78d5c4E --bridge-signer 0x1b4297618913C492179C308322Aa6e66daF625D4
Sets the system bridge contract signer address. This flag can be used multiple times.
validatorset-owner
- Syntax
- Example
genesis [--validatorset-owner VALIDATOR_CONTRACT_OWNER]
genesis --validatorset-owner 0xeeA13dF426dcF62999B9bFf912f58E25f4f9Ba2f
Sets the system ValidatorSet contract owner address.
vault-owner
- Syntax
- Example
genesis [--vault-owner VAULT_CONTRACT_OWNER]
genesis --vault-owner 0xeeA13dF426dcF62999B9bFf912f58E25f4f9Ba2f
Sets the system vault contract owner address.
Operator Commands
Peers Commands
Command | Description |
---|---|
peers add | Adds a new peer using their libp2p address |
peers list | Lists all the peers the client is connected to through libp2p |
peers status | Returns the status of a specific peer from the peers list, using the libp2p address |
peers add flags
addr
- Syntax
- Example
peers add --addr PEER_ADDRESS
peers add --addr /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmJxxH1tScDX2rLGSU9exnuvZKNM9SoK3v315azp68DLPW
Peer's libp2p address in the multiaddr format.
grpc-address
- Syntax
- Example
peers add [--grpc-address GRPC_ADDRESS]
peers add --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
peers list flags
grpc-address
- Syntax
- Example
peers list [--grpc-address GRPC_ADDRESS]
peers list --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
peers status flags
peer-id
- Syntax
- Example
peers status --peer-id PEER_ID
peers status --peer-id 16Uiu2HAmJxxH1tScDX2rLGSU9exnuvZKNM9SoK3v315azp68DLPW
Libp2p node ID of a specific peer within p2p network.
grpc-address
- Syntax
- Example
peers status [--grpc-address GRPC_ADDRESS]
peers status --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
IBFT Commands
Command | Description |
---|---|
ibft snapshot | Returns the IBFT snapshot |
ibft candidates | Queries the current set of proposed candidates, as well as candidates that have not been included yet |
ibft propose | Proposes a new candidate to be added/removed from the validator set |
ibft status | Returns the overall status of the IBFT client |
ibft switch | Add fork configurations into genesis.json file to switch IBFT type |
ibft snapshot flags
number
- Syntax
- Example
ibft snapshot [--number BLOCK_NUMBER]
ibft snapshot --number 100
The block height (number) for the snapshot.
grpc-address
- Syntax
- Example
ibft snapshot [--grpc-address GRPC_ADDRESS]
ibft snapshot --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
ibft candidates flags
grpc-address
- Syntax
- Example
ibft candidates [--grpc-address GRPC_ADDRESS]
ibft candidates --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
ibft propose flags
vote
- Syntax
- Example
ibft propose --vote VOTE
ibft propose --vote auth
Proposes a change to the validator set. Possible values: [auth, drop]
.
addr
- Syntax
- Example
ibft propose --addr ETH_ADDRESS
ibft propose --addr 0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7
Address of the account to be voted for.
grpc-address
- Syntax
- Example
ibft candidates [--grpc-address GRPC_ADDRESS]
ibft candidates --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
ibft status flags
grpc-address
- Syntax
- Example
ibft status [--grpc-address GRPC_ADDRESS]
ibft status --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
ibft switch flags
chain
- Syntax
- Example
ibft switch [--chain GENESIS_FILE]
ibft switch --chain genesis.json
Specifies the genesis file to update. Default: test
.
type
- Syntax
- Example
ibft switch [--type TYPE]
ibft switch --type PoS
Specifies the IBFT type to switch. Possible values: [PoA, PoS]
.
deployment
- Syntax
- Example
ibft switch [--deployment DEPLOYMENT]
ibft switch --deployment 100
Specifies the height of contract deployment. Only available with PoS.
from
- Syntax
- Example
ibft switch [--from FROM]
ibft switch --from 200
Specifies the beginning height of the fork.
Transaction Pool Commands
Command | Description |
---|---|
txpool status | Returns the number of transactions in the pool |
txpool subscribe | Subscribes for events in the transaction pool |
txpool status flags
grpc-address
- Syntax
- Example
txpool status [--grpc-address GRPC_ADDRESS]
txpool status --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
txpool subscribe flags
grpc-address
- Syntax
- Example
txpool subscribe [--grpc-address GRPC_ADDRESS]
txpool subscribe --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
promoted
- Syntax
- Example
txpool subscribe [--promoted LISTEN_PROMOTED]
txpool subscribe --promoted
Subscribes for promoted tx events in the TxPool.
dropped
- Syntax
- Example
txpool subscribe [--dropped LISTEN_DROPPED]
txpool subscribe --dropped
Subscribes for dropped tx events in the TxPool.
demoted
- Syntax
- Example
txpool subscribe [--demoted LISTEN_DEMOTED]
txpool subscribe --demoted
Subscribes for demoted tx events in the TxPool.
added
- Syntax
- Example
txpool subscribe [--added LISTEN_ADDED]
txpool subscribe --added
Subscribes for added tx events to the TxPool.
enqueued
- Syntax
- Example
txpool subscribe [--enqueued LISTEN_ENQUEUED]
txpool subscribe --enqueued
Subscribes for enqueued tx events in the account queues.
Blockchain commands
Command | Description |
---|---|
status | Returns the status of the client. The detailed response can be found below |
monitor | Subscribes to a blockchain event stream. The detailed response can be found below |
version | Returns the current version of the client |
status flags
grpc-address
- Syntax
- Example
status [--grpc-address GRPC_ADDRESS]
status --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
monitor flags
grpc-address
- Syntax
- Example
monitor [--grpc-address GRPC_ADDRESS]
monitor --grpc-address 127.0.0.1:10003
Address of the gRPC API. Default: 127.0.0.1:9632
.
Secrets Commands
Command | Description |
---|---|
secrets init | Initializes the private keys to the corresponding secrets manager |
secrets generate | Generates a secrets manager configuration file which can be parsed by the dogechain |
secrets init flags
config
- Syntax
- Example
secrets init [--config SECRETS_CONFIG]
secrets init --config ./secretsManagerConfig.json
Sets the path to the SecretsManager config file. Used for Hashicorp Vault. If omitted, the local FS secrets manager is used.
data-dir
- Syntax
- Example
secrets init [--data-dir DATA_DIRECTORY]
secrets init --data-dir ./example-dir
Sets the directory for the dogechain data if the local FS is used.
secrets generate flags
dir
- Syntax
- Example
secrets generate [--dir DATA_DIRECTORY]
secrets generate --dir ./example-dir
Sets the directory for the secrets manager configuration file Default: ./secretsManagerConfig.json
type
- Syntax
- Example
secrets generate [--type TYPE]
secrets generate --type hashicorp-vault
Specifies the type of the secrets manager [hashicorp-vault
]. Default: hashicorp-vault
token
- Syntax
- Example
secrets generate [--token TOKEN]
secrets generate --token s.zNrXa9zF9mgrdnClM7PZ19cu
Specifies the access token for the service
server-url
- Syntax
- Example
secrets generate [--server-url SERVER_URL]
secrets generate --server-url http://127.0.0.1:8200
Specifies the server URL for the service
name
- Syntax
- Example
secrets generate [--name NODE_NAME]
secrets generate --name node-1
Specifies the name of the node for on-service record keeping. Default: dogechain-node
namespace
- Syntax
- Example
secrets generate [--namespace NAMESPACE]
secrets generate --namespace my-namespace
Specifies the namespace used for the Hashicorp Vault secrets manager. Default: admin
Responses
Status Response
The response object is defined using Protocol Buffers.
message ServerStatus {
int64 network = 1;
string genesis = 2;
Block current = 3;
string p2pAddr = 4;
message Block {
int64 number = 1;
string hash = 2;
}
}
Monitor Response
message BlockchainEvent {
// The "repeated" keyword indicates an array
repeated Header added = 1;
repeated Header removed = 2;
message Header {
int64 number = 1;
string hash = 2;
}
}
Utilities
loadbot flags
tps
- Syntax
- Example
loadbot [--tps NUMBER_OF_TXNS_PER_SECOND]
loadbot --tps 2000
The number of transactions per second to send. Default: 100
.
mode
- Syntax
- Example
loadbot [--mode MODE]
loadbot --mode transfer
Sets the loadbot run mode [transfer
, deploy
]. Default: transfer
.
chain-id
- Syntax
- Example
loadbot [--chain-id CHAIN_ID]
loadbot --chain-id 2000
Sets the network chain ID for transactions. Default: 2000
.
gas-price
- Syntax
- Example
loadbot [--gas-price GAS_PRICE]
loadbot --gas-price 10000
The gas price that should be used for the transactions. If omitted, the average gas price is fetched from the network.
gas-limit
- Syntax
- Example
loadbot [--gas-limit GAS_LIMIT]
loadbot --gas-limit 10000
The gas limit that should be used for the transactions. If omitted, the gas limit is estimated before starting the loadbot.
grpc-address
- Syntax
- Example
loadbot --grpc-address GRPC_ADDRESS
loadbot --grpc-address 127.0.0.1:9645
The GRPC endpoint used to send transactions
detailed
- Syntax
- Example
loadbot [--detailed DETAILED]
loadbot --detailed
Flag indicating if the error logs should be shown. Default: false
.
contract
- Syntax
- Example
loadbot [--contract CONTRACT_PATH]
loadbot --contract ./myContract.json
The path to the contract JSON artifact containing the bytecode. If omitted, a default contract is used.
sender
- Syntax
- Example
loadbot [--sender ADDRESS]
loadbot --sender 0x1010101010101010101010101010101010101020
Address of the sender account.
receiver
- Syntax
- Example
loadbot [--receiver ADDRESS]
loadbot --receiver 0x1010101010101010101010101010101010101000
Address of the receiver account.
jsonrpc
- Syntax
- Example
loadbot [--jsonrpc ENDPOINT]
loadbot --jsonrpc http://127.0.0.1:8545
A JSON RPC endpoint used to send transactions.
count
- Syntax
- Example
loadbot [--count COUNT]
loadbot --count 100
The total number of transactions to send. Default: 1000
.
value
- Syntax
- Example
loadbot [--value VALUE]
loadbot --value 10000000000000000
The value to send in each transaction.
max-conns
- Syntax
- Example
loadbot [--max-conns MAX_CONNECTIONS_COUNT]
loadbot --max-conns 1000
Sets the maximum no.of connections allowed per host. Default: 2*tps
.
backup flags
grpc-address
- Syntax
- Example
backup [--grpc-address GRPC_ADDRESS]
backup --grpc-address 127.0.0.1:9632
Address of the gRPC API. Default: 127.0.0.1:9632
.
out
- Syntax
- Example
backup [--out OUT]
backup --out backup.dat
Path of archive file to save.
from
- Syntax
- Example
backup [--from FROM]
backup --from 0x0
The beginning height of blocks in archive. Default: 0.
overwrite-file
- Syntax
- Example
backup [--overwrite-file FILE]
backup --overwrite-file ./dogechain-snapshot.zst
The end height of blocks in archive.
to
- Syntax
- Example
backup [--to TO]
backup --to 0x2710
The end height of blocks in archive.
zstd
- Syntax
- Example
backup [--zstd SHOULD_ENABLE_ZSTD]
backup --zstd
Sets the flag indicating that backup enable zstd compression. Default: false
.
zstd-level
- Syntax
- Example
backup [--zstd-level COMPRESSION_LEVEL]
backup --zstd-level 5
Sets the zstd compression level for backup, range 1-10. Default: 3
.
Genesis Template
The genesis file should be used to set the initial state of the blockchain (ex. if some accounts should have a starting balance).
The following ./genesis.json file is generated:
{
"name": "example",
"genesis": {
"nonce": "0x0000000000000000",
"gasLimit": "0x0000000000001388",
"difficulty": "0x0000000000000001",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"params": {
"forks": {},
"chainID": 2000,
"engine": {
"pow": {}
}
},
"bootnodes": []
}
Data Directory
When executing the data-dir flag, a test-chain folder is generated. The folder structure consists of the following sub-folders:
- blockchain - Stores the LevelDB for blockchain objects
- trie - Stores the LevelDB for the Merkle tries
- keystore - Stores private keys for the client. This includes the libp2p private key and the sealing/validator private key
- consensus - Stores any consensus information that the client might need while working