📔
Liberland Wiki
  • 📖Public Documents
  • 👍Primers
    • 🙋‍♀️Congress
    • 💂Executive
    • 👨‍⚖️Judiciary
    • 🤴Senate
  • 🚦Regulations
    • ✍️Drafts
      • 👮Internal Regulation of the Security Commission on the Structural and Functional Organization of the
    • 👩‍⚖️In Force
      • 🏰Orders
        • 👨Order of the President of Liberland no. 1/2021, on the Decisions of the Cabinet.
        • 👩Order of the President of Liberland no. 2/2021, on the Interim Legislature
  • ✅Policies
    • 🧑‍⚖️In Force
      • ⚖️Justice
        • 🔏Privacy policy
  • 👨‍💻Blockchain
    • 💫White Paper
    • 👨Tokenomics Primer
    • 💫Roadmap
    • 👨API
      • ⌨️Chain Explorer API
      • For CEXes
    • 🌐Ecosystem
      • 🌉How to Bridge to Ethereum
      • 🌉How to Bridge to Solana
      • How to Bridge to TRON
      • 🔁Liberland Exchange
      • How to Acquire LLD
      • How to Use Polkadot.js
      • How to use SubWallet
      • How to use Talisman
      • Known Issues
    • 🪪For Citizens and E-Residents
      • 🗳️Voting
      • Senate
      • Onboarding
      • Claiming Residency
      • Congress
      • Governance
      • Companies
    • 🖥️For Validators, Nominators & Stakers
      • Run a validator
      • Non-technical run a validator
      • Staking
      • ETH Liquidity Staking
      • SOL Liquidity Staking
      • Update node
      • Resync node
    • For Developers & Testers
      • Build, run & test using source code
      • Run in Docker
      • Manual testing guide
      • Runtime upgrade
      • Rust API docs
      • Bootstrapping new testnet
      • Chain Crash Recovery Procedure
  • Media
    • Press Kit
Powered by GitBook
On this page
  • Docker image details
  • Usage examples
  • Minimal Bastiat (testnet) node with persistent data
  • Using custom chain spec
  • Accessing your node locally via Polkadot.js Apps
  • Complete example of running a validator on mainnet
  1. Blockchain
  2. For Developers & Testers

Run in Docker

PreviousBuild, run & test using source codeNextManual testing guide

Last updated 10 months ago

Prequirements: This guide assumes your running a Linux based operating system and have Docker already installed.

Docker image details

Liberland's node docker image is hosted on GitHub Container Registry: . It's build automatically from public . Configuration:

  • Node binary is stored at /node

  • Exposed ports: 30333, 9944.

  • Runs as unpriviledged user with UID 1000

Usage examples

Minimal Bastiat (testnet) node with persistent data

To make sure your node's data is persistant, mount a host directory as a volume using -v argument:

$ mkdir $HOME/liberland_data
$ sudo chown 1000:1000 $HOME/liberland_data
$ docker run -it --rm -v $HOME/liberland_data:/data ghcr.io/liberland/blockchain-node:latest -d /data --chain bastiat

Using custom chain spec

To use custom chain spec, you must mount it into the container:

$ mkdir $HOME/liberland_data
$ sudo chown 1000:1000 $HOME/liberland_data
$ docker run -it --rm -v $HOME/liberland_data:/data -v $HOME/custom_chain_spec.raw.json:/custom_chain_spec.raw.json ghcr.io/liberland/blockchain-node:latest -d /data --chain /custom_chain_spec.raw.json

Accessing your node locally via Polkadot.js Apps

To be able to access your node locally via Polkadot.js Apps, pass --network=host argument so that RPC port is accessible:

$ mkdir $HOME/liberland_data
$ sudo chown 1000:1000 $HOME/liberland_data
$ docker run -it --rm --network=host -v $HOME/liberland_data:/data ghcr.io/liberland/blockchain-node:latest -d /data --chain bastiat

Complete example of running a validator on mainnet

This example:

  • passes -v $HOME/liberland_data:/data to make data persistent on the host

  • passes --network=host to make RPC accessible locally and P2P accessible on all interfaces

  • passes -d to run in background

  • passes --restart always to automatically restart node on reboot / crash

  • uses mainnet chain spec

  • passes --validator option to node to enable acting as validator

$ mkdir $HOME/liberland_data
$ sudo chown 1000:1000 $HOME/liberland_data
$ docker run --name liberland -d --network=host --restart always -v $HOME/liberland_data:/data ghcr.io/liberland/blockchain-node:latest -d /data --chain mainnet --validator

You can:

  • monitor this instance with docker ps -a

  • see its logs with docker logs liberland

  • stop with docker stop liberland - note that it will restart automatically on reboot / Docker restart

  • restart with docker restart liberland

  • remove with docker rm liberland

Generate session keys

You'll now be able to access your node via .

See document.

With an instance running like this you may now follow the starting with Wait for your node to sync section.

👨‍💻
ghcr.io/liberland/blockchain-node
Dockerfile
https://polkadotjs.blockchain.liberland.org/?rpc=ws://localhost:9944
regenerate session keys
Run a validator