Set environment variables

Set environment variables when running an Aleph node on the testnet for validating transactions.

To run the node you will have to set several variables. Below you can find example configurations which you might want to tailor to your needs.

Variables

It is the most convenient to put all of the variables into a file that you can later source, let's assume it's called set_env.sh and has the following contents:

export BASE_PATH="$HOME/data" # choose any directory you'd like, `$HOME/.aleph_zero` is also a popular choice
export BOOT_NODES="/dns4/bootnode-eu-central-1-0.test.azero.dev/tcp/30333/p2p/12D3KooWRkGLz4YbVmrsWK75VjFTs8NvaBu42xhAmQaP4KeJpw1L
    /dns4/bootnode-eu-west-1-0.test.azero.dev/tcp/30333/p2p/12D3KooWFVXnvJdPuGnGYMPn5qLQAQYwmRBgo6SmEQsKZSrDoo2k
    /dns4/bootnode-eu-west-2-0.test.azero.dev/tcp/30333/p2p/12D3KooWAkqYFFKMEJn6fnPjYnbuBBsBZq6fRFJZYR6rxnuCZWCC
    /dns4/bootnode-us-east-1-0.test.azero.dev/tcp/30333/p2p/12D3KooWQFkkFr5aM5anGEiUCQiGUdRyWgrdpvSjBgWAUS9srLE4
    /dns4/bootnode-us-east-2-0.test.azero.dev/tcp/30333/p2p/12D3KooWD5s2dkifJua69RbLwEREDdJjsNHvavNRGxdCvzhoeaLc"
export CHAIN="${BASE_PATH}/chainspec.json"
export NODE_KEY_PATH="${BASE_PATH}/p2p_secret"
export BACKUP_PATH="${BASE_PATH}/backup-stash"
export LOG_FILE="${BASE_PATH}/aleph-node.log"
export POOL_LIMIT="100"
export UNIT_CREATION_DELAY="300"
export PORT="30333"
export VALIDATOR_PORT="30343"
export RPC_PORT="9944"
export RUST_LOG="info"
export SYNC="Fast"
export TELEMETRY_URL='wss://telemetry.polkadot.io/submit/'
export TELEMETRY_VERBOSITY_LVL='0'
export VALIDATOR="true"
export RPC_MAX_CONNECTIONS="100"
  1. NAME should be a name for your node. It’s mostly used for logging in various ways, so make it specific and recognizable.

  2. PUBLIC_ADDR should contain a public address your node will be using in the libp2p format. This can also be omitted: in that case it will be auto-generated. The libp2p format is the following: /ip4/<your ip>/tcp/30333 or /dns4/<your domain>/tcp/30333 (the port number is what you set as PORT above).

  3. VALIDATOR_PUBLIC_ADDRESS, in the format host:port, where the port is the VALIDATOR_PORT you set above (30343 by default).

Remember to export the variables for later use.

Note that these variables should be available every time you run the binary, so you might want to put them in your .bashrc (or your shell's equivalent)

Note that the directory that's your $BASE_PATH has to be manually created if it doesn't exist:

mkdir -p $BASE_PATH && cd $BASE_PATH

Last updated