Commands for the Avalanche Network Runner.
--dial-timeout duration
server dial timeout (default 10s)
--endpoint string
server endpoint (default "localhost:8080")
--log-dir string
log directory
--log-level string
log level (default "INFO")
--request-timeout duration
client request timeout (default 3m0s)
Pings the server.
avalanche-network-runner ping [options] [flags]
avalanche-network-runner ping
curl --location --request POST 'http://localhost:8081/v1/ping'
Starts a network runner server.
avalanche-network-runner server [options] [flags]
--dial-timeout duration
server dial timeout (default 10s)
--disable-grpc-gateway
true to disable grpc-gateway server (overrides --grpc-gateway-port
)
--disable-nodes-output
true to disable nodes stdout/stderr
--grpc-gateway-port string
grpc-gateway server port (default ":8081")
--log-dir string
log directory
--log-level string
log level for server logs (default "INFO")
--port string
server port (default ":8080")
--snapshots-dir string
directory for snapshots
avalanche-network-runner server
Network runner control commands.
avalanche-network-runner control [command]
Adds a new node to the network.
avalanche-network-runner control add-node node-name [options] [flags]
--avalanchego-path string
AvalancheGo binary path
--chain-configs string
[optional] JSON string of map from chain id to its config file contents
--node-config string
node config as string
--plugin-dir string
[optional] plugin directory
--subnet-configs string
[optional] JSON string of map from Avalanche L1 id (SubnetID) to its config file contents
--upgrade-configs string
[optional] JSON string of map from chain id to its upgrade file contents
avalanche-network-runner control add-node node6
curl --location 'http://localhost:8081/v1/control/addnode' \
--header 'Content-Type: application/json' \
--data '{
"name": "node6"
}'
Adds Avalanche L1 validators.
avalanche-network-runner control add-subnet-validators validatorsSpec [options] [flags]
avalanche-network-runner control add-subnet-validators '[{"subnet_id": "p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz", "node_names":["node1"]}]'
curl --location 'http://localhost:8081/v1/control/addsubnetvalidators' \
--header 'Content-Type: application/json' \
--data '[{"subnetId": "p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz", "nodeNames":["node1"]}]'
Attaches a peer to the node.
avalanche-network-runner control attach-peer node-name [options] [flags]
avalanche-network-runner control attach-peer node5
curl --location 'http://localhost:8081/v1/control/attachpeer' \
--header 'Content-Type: application/json' \
--data '{
"nodeName":"node5"
}'
Creates blockchains.
avalanche-network-runner control create-blockchains blockchain-specs [options] [flags]
avalanche-network-runner control create-blockchains '[{"vm_name":"subnetevm","genesis":"/path/to/genesis.json", "subnet_id": "p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz"}]'
curl --location 'http://localhost:8081/v1/control/createblockchains' \
--header 'Content-Type: application/json' \
--data '{
"blockchainSpecs": [
{
"vm_name": "subnetevm",
"genesis": "/path/to/genesis.json",
"subnet_id": "p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz"
}
]
}'
Creates Avalanche L1s.
avalanche-network-runner control create-subnets [options] [flags]
avalanche-network-runner control create-subnets '[{"participants": ["node1", "node2", "node3", "node4", "node5"]}]'
curl --location 'http://localhost:8081/v1/control/createsubnets' \
--header 'Content-Type: application/json' \
--data '
{
"participants": [
"node1",
"node2",
"node3",
"node4",
"node5"
]
}'
Lists available snapshots.
avalanche-network-runner control get-snapshot-names [options] [flags]
avalanche-network-runner control get-snapshot-names
curl --location --request POST 'http://localhost:8081/v1/control/getsnapshotnames'
Waits until local cluster is ready.
avalanche-network-runner control health [options] [flags]
./build/avalanche-network-runner control health
curl --location --request POST 'http://localhost:8081/v1/control/health'
Lists all blockchain ids of the network.
avalanche-network-runner control list-blockchains [flags]
avalanche-network-runner control list-blockchains
curl --location --request POST 'http://localhost:8081/v1/control/listblockchains'
Lists RPCs for all blockchains in the network.
avalanche-network-runner control list-rpcs [flags]
avalanche-network-runner control list-rpcs
curl --location --request POST 'http://localhost:8081/v1/control/listrpcs'
Lists all Avalanche L1 IDs (SubnetID) of the network.
avalanche-network-runner control list-subnets [flags]
avalanche-network-runner control list-subnets
curl --location --request POST 'http://localhost:8081/v1/control/listsubnets'
Loads a network snapshot.
avalanche-network-runner control load-snapshot snapshot-name [flags]
if the ` AVALANCHEGO_EXEC_PATH ` and ` AVALANCHEGO_PLUGIN_PATH ` env vars aren't set then you should pass them in as a flag
avalanche-network-runner control load-snapshot snapshotName --avalanchego-path /path/to/avalanchego/binary --plugin-dir /path/to/avalanchego/plugins
--avalanchego-path string
AvalancheGo binary path
--chain-configs string
[optional] JSON string of map from chain id to its config file contents
--global-node-config string
[optional] global node config as JSON string, applied to all nodes
--plugin-dir string
plugin directory
--reassign-ports-if-used
true to reassign snapshot ports if already taken
--root-data-dir string
root data directory to store logs and configurations
--subnet-configs string
[optional] JSON string of map from Avalanche L1 id to its config file contents
--upgrade-configs string
[optional] JSON string of map from chain id to its upgrade file contents
avalanche-network-runner control load-snapshot snapshot
curl --location 'http://localhost:8081/v1/control/loadsnapshot' \
--header 'Content-Type: application/json' \
--data '{
"snapshotName":"snapshot"
}'
if the ` AVALANCHEGO_EXEC_PATH ` and ` AVALANCHEGO_PLUGIN_PATH ` env vars aren't set then you should pass them in to the curl
curl -X POST -k http://localhost:8081/v1/control/loadsnapshot -d '{"snapshotName":"node5","execPath":"/path/to/avalanchego/binary","pluginDir":"/path/to/avalanchego/plugins"}'
Pauses a node.
avalanche-network-runner control pause-node node-name [options] [flags]
avalanche-network-runner control pause-node node5
curl --location 'http://localhost:8081/v1/control/pausenode' \
--header 'Content-Type: application/json' \
--data '{
"name": "node5"
}'
Removes a node.
avalanche-network-runner control remove-node node-name [options] [flags]
avalanche-network-runner control remove-node node5
curl --location 'http://localhost:8081/v1/control/removenode' \
--header 'Content-Type: application/json' \
--data '{
"name":"node5"
}'
Removes a network snapshot.
avalanche-network-runner control remove-snapshot snapshot-name [flags]
avalanche-network-runner control remove-snapshot node5
curl --location 'http://localhost:8081/v1/control/removesnapshot' \
--header 'Content-Type: application/json' \
--data '{
"snapshot_name":"node5"
}'
Removes an Avalanche L1 validator.
avalanche-network-runner control remove-subnet-validator removeValidatorSpec [options] [flags]
avalanche-network-runner control remove-subnet-validator '[{"subnet_id": "p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz", "node_names":["node1"]}]'
curl --location 'http://localhost:8081/v1/control/removesubnetvalidator' \
--header 'Content-Type: application/json' \
--data '[{"subnetId": "p433wpuXyJiDhyazPYyZMJeaoPSW76CBZ2x7wrVPLgvokotXz", "nodeNames":["node1"]}]'
Restarts a node.
avalanche-network-runner control restart-node node-name [options] [flags]
--avalanchego-path string
AvalancheGo binary path
--chain-configs string
[optional] JSON string of map from chain id to its config file contents
--plugin-dir string
[optional] plugin directory
--subnet-configs string
[optional] JSON string of map from Avalanche L1 id (SubnetID) to its config file contents
--upgrade-configs string
[optional] JSON string of map from chain id to its upgrade file contents
--whitelisted-subnets string
[optional] whitelisted Avalanche L1s (comma-separated)
avalanche-network-runner control restart-node \
--request-timeout=3m \
--log-level debug \
--endpoint= "localhost:8080" \
node1
curl --location 'http://localhost:8081/v1/control/restartnode' \
--header 'Content-Type: application/json' \
--data '{
"name": "node5"
}'
Resumes a node.
avalanche-network-runner control resume-node node-name [options] [flags]
avalanche-network-runner control resume-node node5
curl --location 'http://localhost:8081/v1/control/resumenode' \
--header 'Content-Type: application/json' \
--data '{
"name": "node5"
}'
Gets RPC server version.
avalanche-network-runner control rpc_version [flags]
./build/avalanche-network-runner control rpc_version
curl --location --request POST 'http://localhost:8081/v1/control/rpcversion'
Saves a network snapshot.
avalanche-network-runner control save-snapshot snapshot-name [flags]
avalanche-network-runner control save-snapshot snapshotName
curl --location 'http://localhost:8081/v1/control/savesnapshot' \
--header 'Content-Type: application/json' \
--data '{
"snapshot_name":"node5"
}'
Sends an outbound message to an attached peer.
avalanche-network-runner control send-outbound-message node-name [options] [flags]
--message-bytes-b64 string
Message bytes in base64 encoding
--message-op uint32
Message operation type
--peer-id string
peer ID to send a message to
avalanche-network-runner control send-outbound-message \
--request-timeout=3m \
--log-level debug \
--endpoint= "localhost:8080" \
--node-name node1 \
--peer-id "7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" \
--message-op=16 \
--message-bytes-b64= "EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgAAAAPpAqmoZkC/2xzQ42wMyYK4Pldl+tX2u+ar3M57WufXx0oXcgXfXCmSnQbbnZQfg9XqmF3jAgFemSUtFkaaZhDbX6Ke1DVpA9rCNkcTxg9X2EcsfdpKXgjYioitjqca7WA="
curl -X POST -k http://localhost:8081/v1/control/sendoutboundmessage -d '{"nodeName":"node1","peerId":"7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg","op":16,"bytes":"EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgAAAAPpAqmoZkC/2xzQ42wMyYK4Pldl+tX2u+ar3M57WufXx0oXcgXfXCmSnQbbnZQfg9XqmF3jAgFemSUtFkaaZhDbX6Ke1DVpA9rCNkcTxg9X2EcsfdpKXgjYioitjqca7WA="}'
Starts a network.
avalanche-network-runner control start [options] [flags]
--avalanchego-path string
AvalancheGo binary path
--blockchain-specs string
[optional] JSON string of array of [(VM name, genesis file path)]
--chain-configs string
[optional] JSON string of map from chain id to its config file contents
--custom-node-configs global-node-config
[optional] custom node configs as JSON string of map, for each node individually. Common entries override global-node-config, but can be combined. Invalidates number-of-nodes
(provide all node configs if used).
--dynamic-ports
true to assign dynamic ports
--global-node-config string
[optional] global node config as JSON string, applied to all nodes
--number-of-nodes uint32
number of nodes of the network (default 5)
--plugin-dir string
[optional] plugin directory
--reassign-ports-if-used
true to reassign default/given ports if already taken
--root-data-dir string
[optional] root data directory to store logs and configurations
--subnet-configs string
[optional] JSON string of map from Avalanche L1 id (SubnetID) to its config file contents
--upgrade-configs string
[optional] JSON string of map from chain id to its upgrade file contents
--whitelisted-subnets string
[optional] whitelisted Avalanche L1s (comma-separated)
avalanche-network-runner control start \
--log-level debug \
--endpoint= "localhost:8080" \
--number-of-nodes=5 \
--blockchain-specs '[{"vm_name": "subnetevm", "genesis": "./path/to/config.json"}]'
curl --location 'http://localhost:8081/v1/control/start' \
--header 'Content-Type: application/json' \
--data '{
"numNodes": 5,
"blockchainSpecs": [
{
"vm_name": "subnetevm",
"genesis": "/path/to/config.json"
}
]
}'
Gets network status.
avalanche-network-runner control status [options] [flags]
./build/avalanche-network-runner control status
curl --location --request POST 'http://localhost:8081/v1/control/status'
Stops the network.
avalanche-network-runner control stop [options] [flags]
avalanche-network-runner control stop
curl --location --request POST 'http://localhost:8081/v1/control/stop'
Gets a stream of network status.
avalanche-network-runner control stream-status [options] [flags]
--push-interval duration
interval that server pushes status updates to the client (default 5s)
avalanche-network-runner control stream-status
curl --location --request POST 'http://localhost:8081/v1/control/streamstatus'
Lists network URIs.
avalanche-network-runner control uris [options] [flags]
avalanche-network-runner control uris
curl --location --request POST 'http://localhost:8081/v1/control/uris'
Returns the VM ID associated to the given VM name.
avalanche-network-runner control vmid vm-name [flags]
/build/avalanche-network-runner control vmid subnetevm
curl --location 'http://localhost:8081/v1/control/vmid' \
--header 'Content-Type: application/json' \
--data '{
"vmName": "subnetevm"
}'
Waits until local cluster and custom VMs are ready.
avalanche-network-runner control wait-for-healthy [options] [flags]
./build/avalanche-network-runner control wait-for-healthy
curl --location --request POST 'http://localhost:8081/v1/control/waitforhealthy'