Skip to content

Docker Advanced

Marko Petrlić edited this page Oct 11, 2023 · 1 revision

Docker build

The easiest way to build and deploy your own node is using docker.

Build the docker image

We recommend the use of BuildKit, and specify the branch/tag you want to build. The following example shows the latest tag for devnet:

$> export DOCKER_BUILDKIT=1
$> docker build --build-arg AVAIL_TAG=v1.3.0-rc3 -t avail:v1.3.0-rc3 .

How to use this image

Run an Avail Node

$> docker run avail:v1.3.0-rc3

Where to Store Data

There are two main volumes:

  • /da/state, where the state of the blockchain is stored.
  • /da/keystore, where the keystore is stored.

You can bind to a host folder if you want to persist them even after remove the container:

$> docker run -v (pwd)/state:/da/state avail:v1.3.0-rc3

How to customize the node

This image uses several environmental variables to customize the node:

DA_CHAIN

It sets the chainspec file used by the node. The default value is /da/genesis/chainspec.raw.json, which allows connection to devnet06. You can also customize it by the build argument CHAIN_SPEC.

DA_NAME

The human-readable name for this node. By default, "AvailNode" is used.

DA_MAX_IN_PEERS

The maximum number of incoming connections we're accepting. The default value is 50.

DA_MAX_OUT_PEERS

The number of outgoing connections we're trying to maintain. Default value is 50.

DA_P2P_PORT

Specify p2p protocol TCP port. Default value is 30333.

BOOTNODE_1, BOOTNODE_2, and BOOTNODE_3

Defines 3 bootnodes. By default, devnet06's bootnodes are loaded.