Run a Vela Node

How to build, run, and connect a validator to the Vela testnet.

1. Prerequisites

Check your Rust version:

$ rustc --version
rustc 1.86.0 (05f9846f8 2025-03-31)

2. Clone and Build

$ git clone https://github.com/OrDex78/vela-network
$ cd vela-network
$ cargo build --release --bin vela-node

The binary will be at ./target/release/vela-node.

3. Run a Single Node

$ ./target/release/vela-node --port 8001 --validator-index 0

This starts a node listening on port 8001 for P2P and port 9001 for the HTTP API and explorer. Open http://localhost:9001 to see the explorer.

The --validator-index flag selects which keypair the node uses (0, 1, or 2). Each index maps to a different Ed25519 key in the hardcoded validator set.

4. Run 3 Validators Locally

Open three terminals:

# Terminal 1: Validator 0
$ ./target/release/vela-node --port 8001 --validator-index 0

# Terminal 2: Validator 1
$ ./target/release/vela-node --port 8002 --validator-index 1 \
    --bootstrap /ip4/127.0.0.1/tcp/8001

# Terminal 3: Validator 2
$ ./target/release/vela-node --port 8003 --validator-index 2 \
    --bootstrap /ip4/127.0.0.1/tcp/8001

On the same machine, nodes also find each other through mDNS, so the --bootstrap flag is optional locally. It's required when connecting across machines.

Each node takes turns as leader in a round-robin schedule. You should see blocks being produced and finalized across all three terminals.

5. Connect to the Public Testnet

To sync with the live testnet running on Railway, bootstrap against the public node:

$ ./target/release/vela-node --port 8001 --validator-index 0 \
    --bootstrap /dns4/vela-network-production.up.railway.app/tcp/8001

On startup, your node will connect to the public peer, send a sync request, and download all blocks it missed. After syncing, it participates in consensus normally.

The public testnet explorer is at vela-network-production.up.railway.app.

6. CLI Flags

FlagDefaultDescription
--port8001P2P listen port (HTTP API runs on port + 1000)
--validator-index0Which validator keypair to use (0, 1, or 2)
--bootstrapnoneComma-separated multiaddrs of peers to connect to

7. API Endpoints

The HTTP API runs on the P2P port + 1000 (default: 9001).

MethodEndpointDescription
GET/statusBlock height, peer count, mempool size, version
GET/block/{height}Block details by height
GET/balance/{address}Balance and nonce for an address
GET/transactions/{address}Transaction history for an address
GET/validatorsValidator set and current leader
POST/send_txSubmit a signed transaction (JSON body)
POST/faucet/{address}Request testnet tokens (24h cooldown)

Example: check node status

$ curl http://localhost:9001/status | jq
{
  "block_height": 142,
  "peer_count": 2,
  "mempool_size": 0,
  "current_leader": 1,
  "version": "0.1.0"
}