This guide will get you up and running with the Xian blockchain stack as quickly as possible. For advanced details, see the Reference section at the end.
- Mac: Docker Desktop for Mac
- Linux: Docker Engine and Docker Compose
Note: Docker Desktop (Mac) includes Docker Compose. On Linux, install Docker Compose separately after Docker Engine.
make setup CORE_BRANCH=mainnet CONTRACTING_BRANCH=mainnet
This will pull all required Xian repositories.
make core-build
make core-up
make init
make configure CONFIGURE_ARGS='--moniker "<your node name>" --genesis-file-name "genesis-mainnet.json" --validator-privkey "<your validator privatekey>" --seed-node-address "[email protected]" --copy-genesis'
make core-shell
make up
pm2 logs --lines 1000
exit
make core-down
make core-bds-build
make core-bds-up
make init
make configure CONFIGURE_ARGS='--moniker "<your node name>" --genesis-file-name "genesis-mainnet.json" --validator-privkey "<your validator privatekey>" --seed-node-address "[email protected]" --copy-genesis --service-node'
make core-bds-shell
make up-bds
pm2 logs --lines 1000
exit
make core-bds-down
make core-dev-build
make core-dev-up
make init
make configure CONFIGURE_ARGS='--moniker "<your node name>" --genesis-file-name "genesis-mainnet.json" --validator-privkey "<your validator privatekey>" --seed-node-address "[email protected]" --copy-genesis --service-node'
make core-dev-shell
make up
pm2 logs --lines 1000
exit
make core-dev-down
git clone https://github.com/xian-network/contracting
cd contracting
# (Optional) Create a new feature branch
# git checkout -b <new-branch-name>
make contracting-dev-build
make contracting-dev-up
pytest contracting/
exit
make core-dev-shell
pytest xian-core/tests/
exit
Action | Command |
---|---|
Start node (core only) | make core-up |
Start node with BDS | make core-bds-up |
Start dev environment with BDS | make core-dev-up |
Stop node | make down |
Stop container | make core-dev-down |
If you are running on Ubuntu/Debian, you may want to secure your node with UFW:
sudo apt install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp comment 'SSH'
sudo ufw allow 26656/tcp comment 'Tendermint P2P'
sudo ufw allow 26657/tcp comment 'Tendermint RPC'
sudo ufw allow 26660/tcp comment 'Tendermint Prometheus'
sudo ufw allow 80/tcp comment 'HTTP'
sudo ufw allow 443/tcp comment 'HTTPS'
sudo ufw enable
sudo ufw status numbered
Warning: Always allow SSH before enabling UFW to avoid locking yourself out.
- Docker permission errors: Try running with
sudo
or add your user to thedocker
group. - Ports already in use: Make sure no other services are using the required ports (26656, 26657, 26660, 5000).
- Containers not starting: Run
docker-compose ps
ordocker ps
to check status. Usedocker-compose logs
for details. - Database connection issues: Ensure the
xian-db
network is running and not blocked by firewall.
xian-net
: Main network for service communication and internet access. Exposes ports 26657, 26656, 26660, 5000.xian-db
: Isolated network for database access (PostgreSQL only accessible within this network).
docker-compose-core.yml
: Base config for Xian nodedocker-compose-core-dev.yml
: Adds dev settingsdocker-compose-core-bds.yml
: Adds BDS with PostgreSQL
Combine with -f
flag, e.g.:
docker-compose -f docker-compose-core.yml -f docker-compose-core-bds.yml up
make up
— Start node without BDSmake up-bds
— Start node with BDSmake core-up
— Start node (core only)make core-bds-up
— Start node with BDSmake core-dev-up
— Start dev environment with BDSmake down
— Stop nodemake core-dev-down
— Stop container
If you need to initialize CometBFT manually:
make core-dev-shell
make init
For more details, see the comments in each Docker Compose file or the Makefile.