kwild setup init
kwild setup init
Generate configuration for a Kwil node.
Synopsis
The init
command facilitates quick setup of an isolated Kwil node either on a fresh network in which that node is the single validator or to join an existing network.
This permits rapid prototyping and evaluation of Kwil functionality. An output directory can be specified using the --output-dir
" flag.
If no output directory is specified, the node will be initialized ./testnet
.
kwild setup init [flags]
Examples
# Initialize a node, with a new network, in the directory ~/.kwil-new
kwild setup init -r ~/.kwild-new
# Run the init command with --allocs flag to initialize a node with initial account balances.
The allocs flag should be a comma-separated list of <id#keyType:amount> pairs where the id is the account address or the pubkey and keyType is either "secp256k1" or "ed25519". If id is the ethereum address prefixed with "0x", the keyType is optional as shown below.
kwild setup init --allocs "0xc89D42189f0450C2b2c3c61f58Ec5d628176A1E7:10000000000000000000000,0226b3ff29216dac187cea393f8af685ad419ac9644e55dce83d145c8b1af213bd#secp256k1:56000000000" -r ~/.kwild
Options
--log-level string log level
possible values: 'debug', 'info', 'warn', and 'error' (default "info")
--log-format string log format
possible values: 'json', 'text' (kv), and 'plain' (fmt-style) (default "plain")
--log-output strings output paths for the log (default [stdout,kwild.log])
--profile-mode string profile mode (http, cpu, mem, mutex, or block)
--profile-file string profile output file path (e.g. cpu.pprof)
--p2p.listen string address in host:port format to listen on for P2P connections (default "0.0.0.0:6600")
--p2p.pex enable peer exchange (default true)
--p2p.bootnodes strings bootnodes to connect to on startup
--p2p.private operate in private mode using a node ID whitelist
--p2p.whitelist strings allowed node IDs when in private mode
--p2p.target-connections int target number of connections to maintain (default 20)
--consensus.propose-timeout duration minimum duration to wait before proposing a block with transactions (applies to leader). This value should be greater than 500ms. (default 1s)
--consensus.empty-block-timeout duration timeout for proposing an empty block. If set to 0, disables empty blocks, leader will wait indefinitely until transactions are available to produce a block. (default 1m0s)
--consensus.block-proposal-interval duration interval between block proposal reannouncements by the leader (default 1s)
--consensus.block-ann-interval duration interval between block commit reannouncements by the leader, and votes reannouncements by validators (default 3s)
--db.host string postgres host name (IP or UNIX socket path) (default "127.0.0.1")
--db.port string postgres TCP port (leave empty for UNIX socket) (default "5432")
--db.user string postgres role/user name (default "kwild")
--db.pass string postgres password if required for the user and host
--db.dbname string postgres database name (default "kwild")
--db.read-timeout duration timeout on read transactions from user RPC calls and queries (default 45s)
--db.max-connections uint maximum number of DB connections to permit (default 60)
--rpc.listen string address in host:port format on which the RPC server will listen (default "0.0.0.0:8484")
--rpc.broadcast-tx-timeout duration duration to wait for a tx to be committed when transactions are authored with --sync flag (default 15s)
--rpc.timeout duration user request duration limit after which it is cancelled (default 20s)
--rpc.max-req-size int largest permissible user request size (default 6000000)
--rpc.private enable private mode that requires challenge authentication for each call
--rpc.challenge-expiry duration lifetime of a server-generated challenge (default 30s)
--rpc.challenge-rate-limit float maximum number of challenges per second that a user can request (default 10)
--admin.enable enable the admin RPC service (default true)
--admin.listen string address in host:port format or UNIX socket path on which the admin RPC server will listen (default "/tmp/kwild.socket")
--admin.pass string optional password for the admin service
--admin.notls disable TLS when the listen address is not a loopback IP or UNIX socket
--snapshots.enable enable creating and providing snapshots for peers using statesync
--snapshots.recurring-height uint snapshot creation period in blocks (default 14400)
--snapshots.max-snapshots uint number of snapshots to keep, after the oldest is removed when creating a new one (default 3)
--state-sync.enable enable using statesync rather than blocksync
--state-sync.trusted-providers strings trusted snapshot providers in node ID format (see bootnodes)
--state-sync.discovery-time duration how long to discover snapshots before selecting one to use (default 15s)
--state-sync.max-retries uint how many times to try after failing to apply a snapshot before switching to blocksync (default 3)
--genesis-state string path to the genesis state file, relative to the root directory
--migrations.enable enable zero downtime migrations
--migrations.migrate-from string JSON-RPC listening address of the node to replicate the state from
--chain-id string chainID for the genesis.json file
--validator strings public key, keyType and power of initial validator(s), may be specified multiple times
--alloc strings address and initial balance allocation(s) in the format id#keyType:amount
--with-gas include gas costs in the genesis.json file
--leader string public key of the block proposer
--db-owner string owner of the database
--max-block-size int maximum block size
--join-expiry duration Number of blocks before a join proposal expires
--max-votes-per-tx int Maximum votes per transaction
--genesis-snapshot string path to genesis state snapshot file
-g, --genesis string path to genesis file
-k, --key-file string path to node key file
-h, --help help for init
Options inherited from parent commands
--output string the format for command output - either 'text' or 'json' (default "text")
-r, --root string root directory (default "/home/jon/.kwild")
SEE ALSO
- kwild setup - Tools for creating and managing node configuration and data