basharddocs
Open app
Operate

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

KeyRoleExposure
OPERATOR_KEYOwns the stake, pays gas, registers the nodeValuable; keep in a secrets manager
SIGNER_KEYSigns certificates, challenges, slash votesHot key; can be rotated separately

Example (future operational setup)

bash
# 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 start

Environment

VariableDefaultMeaning
DEPLOYMENTmust be setContract addresses
RPC_URLmust be setBNB Smart Chain JSON-RPC endpoint
OPERATOR_KEYnoneOperator private key (from environment)
SIGNER_KEYnoneSigning private key (from environment)
PUBLIC_URLmust be setPublic HTTPS endpoint registered on chain
PORT, HOST7001, 0.0.0.0HTTP listener
DATA_DIR./data/$NODE_NAMEShards and local catalogue on the filesystem
INDEXER_URLnoneWhere challenge results are reported
CONFIRMATIONS-1 on public networks-1 reads only finalized blocks
AUDIT_INTERVAL_MS5000How often to challenge a peer
SLASH_THRESHOLD3Failures per peer per epoch before a slash vote
SYNC_GRACE0.2Share of each epoch reserved for shard sync
KEEPER1Try to advance epochs
MAX_STORAGE_GB0 (no limit)Refuse new shards beyond this disk use
REGISTER_STAKEunsetOptional: 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.