Reference / Mining

Run the Ravelnonce testnet node

This repository runs one hosted HTTP node with a local CPU mining demo. It is not a peer-to-peer network, production mainnet, audited implementation, or wallet for real funds.

Requirements and startup

Apply the app-owned schema and start the node
# Use a disposable PostgreSQL database. Never point this demo at production data.
export DATABASE_URL='postgresql://USER:PASSWORD@HOST:5432/DISPOSABLE_DB?sslmode=require'
export NEXT_PUBLIC_APP_URL='http://localhost:3000'
export SEO_INDEXABLE='true'
npx prisma db push
npm run dev

The first node request configures the deterministic height-0 genesis block. The existing auth and faucet models are preserved by this additive schema change. No hand-written database migration is used.

Mine and submit a complete example

The CLI creates ephemeral Ed25519 keys in memory, asks for a block template, mines within the testnet target, submits the reward block, signs and submits a spend, then mines that transaction into the next block. It also attempts a competing spend, an invalid signature, and a block with the wrong target. It prints public IDs and balances only; private key material is neither printed nor saved.

Run the demo and checks from the repository root
# In a second terminal, from this repository:
node scripts/ravelnonce-testnet.mjs demo --base-url http://localhost:3000
npm run test
BASE_URL=http://localhost:3000 npm run test:e2e
npm run lint
SKIP_ENV_VALIDATION=1 npm run build
npm run typecheck

The CLI demo mutates the node by design. Run it only against a disposable database. It may add two valid blocks to a node that already contains testnet history.

What the node demonstrates

See the testnet protocol rules for byte layouts and consensus choices, or the REST API reference for requests. The explorer and status page expose only this node's append-only history.

Testnet limitations

There is no peer discovery, P2P transport, chain synchronization, side-branch storage, fork choice, or reorganization. The timestamp rule has no future-time check. Browser key generation, key backup/recovery, scripts, and multisig are not supported. The existing faucet only records pending requests and does not deliver funds. These choices do not establish a production mainnet protocol.