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
- Node.js 20.18.1 or newer and npm.
- A disposable PostgreSQL database reachable through
DATABASE_URL. NEXT_PUBLIC_APP_URL=http://localhost:3000for local development. These values belong in your local environment, never in committed files.
# 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 devThe 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.
# 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 typecheckThe 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
- Confirmed UTXO reads, Ed25519 transaction signatures, pending input reservations, and atomic block acceptance.
- SHA-256d transaction and block identifiers, ordered merkle roots, bounded proof of work, subsidy and fee validation.
- Explorer records and status readings from the same persisted chain state.
- Stable HTTP 400 validation/consensus errors, HTTP 409 conflicts, HTTP 413 request size limits, and generic HTTP 500 errors.
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.