Run a storage node
Responsibilities, keys, configuration and the HTTP surface of a storage node.
A storage node stores shards, signs certificates, answers and issues proof-of-access challenges, syncs and repairs shards across committee changes, votes on slashes and helps advance epochs.
Requirements
- Node.js 22.5 or newer, persistent disk for shards, a stable public HTTPS endpoint.
- An operator wallet with BNB for gas and BSHD for self stake.
- A separate signer key used only for signatures.
Two keys
| Key | Role | Exposure |
|---|---|---|
OPERATOR_KEY | Owns the stake, pays gas, registers the node | Valuable; keep in a secrets manager |
SIGNER_KEY | Signs certificates, challenges, slash votes | Hot key; can be rotated separately |
Example (future operational setup)
# Keys are already exported in the environment by your secrets manager:
# OPERATOR_KEY, SIGNER_KEY
cd apps/node
DEPLOYMENT=./deployments/<network>.json \
RPC_URL=$RPC_URL \
PUBLIC_URL=https://node.your-domain \
NODE_NAME=node-1 PORT=7001 DATA_DIR=/var/lib/bashard \
INDEXER_URL=$INDEXER_URL \
pnpm startEnvironment
| Variable | Default | Meaning |
|---|---|---|
DEPLOYMENT | must be set | Contract addresses |
RPC_URL | must be set | BNB Smart Chain JSON-RPC endpoint |
OPERATOR_KEY | none | Operator private key (from environment) |
SIGNER_KEY | none | Signing private key (from environment) |
PUBLIC_URL | must be set | Public HTTPS endpoint registered on chain |
PORT, HOST | 7001, 0.0.0.0 | HTTP listener |
DATA_DIR | ./data/$NODE_NAME | Shards and local catalogue on the filesystem |
INDEXER_URL | none | Where challenge results are reported |
CONFIRMATIONS | -1 on public networks | -1 reads only finalized blocks |
AUDIT_INTERVAL_MS | 5000 | How often to challenge a peer |
SLASH_THRESHOLD | 3 | Failures per peer per epoch before a slash vote |
SYNC_GRACE | 0.2 | Share of each epoch reserved for shard sync |
KEEPER | 1 | Try to advance epochs |
MAX_STORAGE_GB | 0 (no limit) | Refuse new shards beyond this disk use |
REGISTER_STAKE | unset | Optional: register on first start with this self stake |
HTTPS is mandatory
An https:// app cannot fetch shards from an http:// node because browsers block mixed content, and the operator form rejects plain HTTP endpoints. Put the node behind a TLS reverse proxy such as Caddy or nginx.
Durability is your job
Shards live in DATA_DIR on the local filesystem. Use a persistent volume and back it up. If a node loses its disk it must rebuild shards from peers, and repeated challenge failures lead to slashing.
Registering
Register either from the Node operator page in the app or by setting REGISTER_STAKE on first start. Registration records the endpoint, signer, commission and self stake on chain. Eligible nodes enter the committee at the next epoch boundary if their stake ranks in the top 20.
The node's HTTP endpoints are listed in the API reference.