SubspaceRunning a Local Node

Running a Commune Node

Requirements

Installing on Ubuntu:

sudo apt install docker.io docker-compose sudo apt install wget # Ubuntu has **yq** on apt since 23.04 sudo apt install yq # On older versions, you can install it with: sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && \ sudo chmod +x /usr/bin/yq

Docker Image

We provide the laster Docker image for the Commune node in this Github package at the latest tag. You can pull the image with the command:

docker pull ghcr.io/agicommies/subspace:dd5a1e5

Chain specs

You can get the chain specs file from the main/specs/main.json file at github.com/agicommies/subspace/blob/current/specs/main.json:

wget https://github.com/agicommies/subspace/raw/current/specs/main.json

Getting bootnodes

You can currently get the bootnodes list with:

wget https://github.com/agicommies/communex/raw/main/docs/bootnodes.txt

Deploying the config

# cd into this directory if you haven't already cd docs/running_a_node/

Pick a directory to store the node data, and copy the chain specs, bootnodes list and start script into it:

export COMMUNE_NODE_DIR="/commune-node" echo COMMUNE_NODE_DIR=$COMMUNE_NODE_DIR > .env mkdir -p "$COMMUNE_NODE_DIR/specs" cp main.json "$COMMUNE_NODE_DIR/specs/main.json" cp bootnodes.txt "$COMMUNE_NODE_DIR/bootnodes.txt" cp node-start.sh "$COMMUNE_NODE_DIR/node-start.sh"

Note

  • Make sure that the COMMUNE_NODE_DIR variable is correctly set in your shell and in the .env file (used by docker-compose).
  • Make sure you don't have old node data in that directory if you want to run the node fresh!

Running the node

The provided docker-compose.yml file expects the environment variable COMMUNE_NODE_DIR to be set to the node data directory, that will be mounted to /node-data inside the container. It will serve the P2P connection at 30333 and the RPC service at 9933.

docker-compose up -d

By default the node will work in archive mode, which means it will store all the chain data (gigabytes). This can be changed by replacing the --pruning=archive and --sync=full flags with --sync=warp in the docker-compose.yml script.

Now you can track the telemetry using this link


References: