Skip to main content
Version: mainnet (v0.50)

Set up validating node

This section will take your through all the steps to configure your node as a validator and join an existing network.

note

All the following commands will use an optional --home flag. This flag allows you to specify a custom home for the configuration, state, and cache of your Vega node. The flag is not mandatory and a default path will be chosen if not specified (the XDG Base Directory standard is use to create the path, see: XDG Base Directory spec.

info

You can list all the path used by your Vega installation by using the following command:

vega paths list

Generate the configurations

Start by generating a Vega validator node configuration.

You will be asked for a passphrase for your node wallet.

(If writing automation, you may want to use --nodewallet-passphrase-file, which allows you to specify a file containing the passphrase.)

Make sure to save this passphrase as it allows you to unlock the node wallet. This command should output the path of the main configuration file. Feel free to open and change settings if needed. (Below you'll find more info on mandatory settings):

vega init --home="path/to/home/root" validator

Then generate the Tendermint node configuration. For convenience, the Vega toolchain also embeds Tendermint. You can run all Tendermint subcommands using this Vega command:

vega tm

Generate the configuration using the following command:

vega tm --home="path/to/tendermint/home/root" init

Set up the node wallet

Each validator node requires two cryptographic wallets to operate properly:

  • Ethereum wallet: Used to sign transactions going through the ERC20 bridge
  • Vega wallet: Used to sign transaction sent by validators in the Vega network

The public key of the Tendermint node also needs to be saved in the node wallet.

All this information needs to be checked in properly before starting the node. When the network starts or a node is added to the validator set, this information will be checked against the transaction used to register the node on the network. Any incorrect set-up will stop the node from joining the network.

note

For the following node wallet command, you will be prompted to input your node wallet passphrase (that you created when you initialised Vega). If you cannot run these command interactively you can specify a file containing the passphrase using the following flag: --passphrase-file=.

Tendermint public key

To save the Tendermint public key in your node wallet, use the following command:

vega nodewallet import --chain=tendermint --home=path/to/home --tendermint-pubkey="YOUR_TENDERMINT_PUBKEY"

If you are using the keys generated by Tendermint, you can find the public key at the following path: path/to/tendermint/config/priv_validator_key.json.

If your Tendermint node is set up to use tmkms, then refer to the documentation to get your public key.

note

If you are not using tmkms (e.g: the default software keys generated by tendermint, run the following command instead:

vega nodewallet import --chain=tendermint --home=path/to/home --tendermint-home=path/to/tendermint

This will read the Tendermint keys from the configuration path, and set up your node wallet properly.

Ethereum wallet

Vega supports two types of Ethereum wallet: you can either register a wallet available from a clef instance or import a keystore file (e.g: create with geth account).

Using clef

To set up your clef instance please refer to the clef documentation.

Set the address of your clef instance in the Vega configuration (path/to/home/config/node/config.toml):

[NodeWallet]
Level = "Info"
[NodeWallet.ETH]
Level = "Info"
Address = ""
ClefAddress = "http://your.clef.instance.network:3334"
note

Alternatively you can run the following command and specify the flag: --eth.clef-address="http://your.clef.instance.network:3334"

Then run the following command:

vega nodewallet import --chain=ethereum --home=path/to/home --clef-account-address="0xYOUR_WALLET_ADDRESS"

Using a keystore account file

You can either import an existing keystore or create a new one. (Learn how to create a keystore using geth)

Import an existing keystore using the following command:

vega nodewallet import --chain=ethereum --home="path/to/home" --wallet-passphrase-file="file/containing/account/passphrase" --wallet-path="path/to/wallet"

Or use the following command to create a new keystore and save it in the node wallet:

vega nodewallet generate --chain=ethereum --home="path/to/home" --wallet-passphrase-file="file/containing/account/passphrase"

Vega wallet

We recommend you use an isolated key.

Read the guide on how to isolate Vega wallet keys: Isolate keys

Give the node access to the key using the following command:

vega nodewallet import --chain=vega --home="path/to/home" --wallet-passphrase-file="file/containing/account/passphrase" --wallet-path="path/to/wallet"

Alternatively you can create a new Vega wallet and save it in the node wallet:

vega nodewallet generate --chain=vega --home="path/to/home" --wallet-passphrase-file="file/containing/account/passphrase"
info

You can verify the information saved in your node wallet using the following command:

vega nodewallet show

Configure the Ethereum node address

Each Vega validator node needs to be connected to an Ethereum node. This allows the Vega node to verify that an event happened on Ethereum (e.g: a deposit or a withdrawal).

Set the Ethereum node address in the Vega configuration (path/to/home/config/node/config.toml):

[NodeWallet]
Level = "Info"
[NodeWallet.ETH]
Level = "Info"
Address = "http://ethereum.node.com/rpc"
ClefAddress = ""

Join a network

In order to join a network the public keys of your validator need to be included in a genesis file. The genesis files for public Vega networks are maintained in the vegaprotocol/networks repository.

If you want to join a network at the next restart, you will need to generate your validator config to be added to a genesis file. Alternatively you can create a new network by creating a genesis file.

Add validator information to an existing genesis file

If you are willing to join another network with an existing genesis file, use the following command to generate your validator node information to be added in the genesis file of the network you want to join:

vega genesis new validator --home="path/to/home" \
--country="YOUR_COUNTRY" \
--info-url="http://your.website.com" \
--info-url="YOUR_NODE_NAME" \
--avatar-url="YOUR_AVATAR_URL" \

This will print a json payload similar to:

Info to add in genesis file under `validators` key
{
"address": "B0CAF4EC9AAC7C256733E09471AC16700F973222",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "plmxJSjg5IC7r8yLWBQUFFTosvXC+rTpbXgf0kCoqoY="
},
"power": "10",
"name": "yournode"
}
Info to add in genesis file under `app_state.validators` key
{
"plmxJSjg5IC7r8yLWBQUFFTosvXC+rTpbXgf0kCoqoY=": {
"id": "1e19e3373816089539c37b040e93a3f73696cced6051cf1e0f1dea739762aac7",
"vega_pub_key": "60be34a837b825b10762db8436e95c39e4ddef22c5dd5f3153064aecf9868c12",
"vega_pub_key_index": 1,
"ethereum_address": "0x3560700a09515695975D719679892C0B111C5332",
"tm_pub_key": "plmxJSjg5IC7r8yLWBQUFFTosvXC+rTpbXgf0kCoqoY=",
"info_url": "https://your.node.com",
"country": "FR",
"name": "yournode",
"avatar_url": "https://your.node.com/avatar",
"from_epoch": 0
}
}

Then add both section in the appropriates places in the genesis file.

Create a new network

A new network can be created using the following command:

vega genesis generate --home="path/to/home" --tm-home="path/to/tendermint"

This will generate a new genesis file with a single validator (using information set up in the node wallet) and all default network parameters.

warning

This command will overwrite any genesis file in your Tendermint config (path/to/tendermint/config/genesis.json).

If you only want to see the output of the command without commiting to the change, use the --dry-run flag.