Local, isolated development

Run BitKeelmark locally

Create test keys, start a local node, mine a block and confirm a payment. Keep every signing key and write service on your machine or trusted private network.

Four steps to run the local test networkA route from wallet setup through node startup and proof-of-work mining to a verified payment. KEYSNODEWORKVERIFY
Use disposable local keys, keep the relay private, and replay the result before trusting a record.
Public reads, private writes: The hosted explorer shows public chain records but accepts no transactions, mining work or block writes. Run your own node and relay for those operations. Keep .local/devnet private; never reuse the unencrypted demo keys for real funds.

You need Python 3.10 or later with SQLite and OpenSSL 3.5 or later. The commands below use python. On Windows you can use py, and on Linux or macOS you may need python3. Download the source archive, read the build guide or follow the full devnet guide.

Create your wallets

python -m chain.setup

Save the printed miner, contributor and recipient addresses. Substitute them for MINER, WORKER and RECIPIENT below. Setup also creates five local reserve signers. Keep the entire .local/devnet directory private. The test keys are stored unencrypted.

Start the node and explorer

python -m chain.network --db .local/devnet/chain.sqlite --site site --port 18764

Keep this terminal open. Visit the local explorer. Explorer pages and public endpoints are read-only. Run the next commands in a second terminal to write to your local test ledger. Use Ctrl+C to stop a service you started.

Follow the chain from another node

Copy the public custodian manifest to the second machine and initialize its database. Use a trusted private network. Replace the peer URL with the first node’s private address if the nodes run on different machines, and bind the first node to that address with --host.

python -m chain --db .local/follower.sqlite init .local/devnet/custodians.json
python -m chain.network --db .local/follower.sqlite --port 18765 --peer http://127.0.0.1:18764

Mine and contribute work

python -m chain --db .local/devnet/chain.sqlite mine MINER
python -m chain.relay serve MINER

The relay mines when it has pending work or payments. In another terminal, submit three shares and check the balance after the next block.

python -m chain.relay work WORKER --count 3
python -m chain --db .local/devnet/chain.sqlite balance WORKER

Shares expire when the parent changes. The miner receives the entire subsidy if the block contains no other work. The relay holds pending submissions in memory.

Send one BKMK

One coin is 100 million atomic units. Sign locally and submit the signed file to the running relay. Use a fresh filename for each payment.

python -m chain --db .local/devnet/chain.sqlite transfer .local/devnet/miner RECIPIENT 100000000 .local/payment-one.json
python -m chain.relay send .local/payment-one.json
python -m chain --db .local/devnet/chain.sqlite verify

Refresh the explorer after the relay mines. Search the recipient address to confirm the balance.

Open explorer

Build a wallet or application

Read balances from your own replica, issue an asset with a fixed cap, or publish a small program whose state every node can replay.

Working example · Harbor register

What happens when a boat arrives?

The harbor has room for 24 boats. Each admission takes one space and increments the lifetime count. A departure frees one space. Validators reject arrivals when the harbor is full.

Reading the register…

Loading capacity…

These controls simulate changes in this tab. Only the owner can sign a real update. The bars show occupancy, without assigning individual berths.

Inspect the program and signed calls

Open the desktop wallet

python -m chain.wallet create .local/wallets/protected
python -m chain.desktop --node http://127.0.0.1:18764 --db .local/devnet/chain.sqlite

Install Tk for the desktop window. Leave out --db for watch-only access. Signing exports a file for your private relay. Check its transaction ID after mining.

Host a replica · Run the benchmarks · Check the download digest

Troubleshooting

The local port is already in use

Choose another unused port with --port, then open the matching local address. Keep services on loopback unless you are deliberately testing on a trusted private network.

A submitted share is rejected

Shares expire when the block parent changes. Request fresh work from the relay and submit it again; do not assume an expired share earned a reward.

The payment does not appear

Check the relay response, refresh the explorer and look up the recipient. If the relay restarted, create and sign a fresh payment file instead of reusing an old signed transaction.

For consensus and command details, read the ledger notes, network guide, signer guide and passphrase-protected wallet guide. The build guide covers the public chain, desktop viewer and SDK.