Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

b8

b8 coordinates a local Alkanes stack. It runs every service as a direct child process and ships a web dashboard to manage the whole thing:

  • Bitcoin Core with txindex
  • rockshrew-mono running the alkanes.wasm metashrew indexer
  • Blockstream electrs for the esplora HTTP API Espo expects
  • espo as the secondary explorer/indexer

The config file is intentionally Espo-shaped. b8 reads <data-dir>/config.json, keeps the Espo fields compatible, and uses the optional top-level b8 section for build sources, credentials, ports, the dashboard address, and bootstrap hooks. When services start, b8 generates a network-specific Espo config under <data-dir>/<network>/run.

Dashboard

b8

That is the whole first-time setup: b8 creates <data-dir>/config.json and its SQLite database <data-dir>/b8.db if they do not exist and serves the dashboard on http://127.0.0.1:8180/. On the first visit you are prompted to choose an admin username and password (entered twice); the account is stored in b8.db with an argon2 hash and every later visit requires signing in. After that you get the installation UX — pick mainnet or regtest, press Install, and watch the stage checklist plus the live install log while b8 downloads Bitcoin Core, fetches the pinned sources, and builds the stack. On regtest, install also mines funds, submits the diesel-bot mint OP_RETURN, and verifies Espo balances end-to-end.

Once a network is installed the dashboard manages it. Everything is reachable from the sidebar — networks, the selected network's endpoints, and account settings:

  • mainnet and regtest side by side, each with its own port range and databases, both runnable at the same time
  • Start stack / Stop stack with ordered readiness waits (bitcoind → electrs → metashrew → espo)
  • per-service start / stop / restart, pid, uptime, and indexed heights
  • live log tailing for every service and for the installer
  • sidebar links to the Espo explorer, Espo RPC, esplora API, metashrew RPC, and bitcoind RPC of whichever network is running
  • Settings to change the admin password (changing it signs out every other session), and Sign out

Every service is a child process of b8 in its own process group; stopping a service SIGTERMs its group, and quitting b8 (Ctrl-C) stops everything.

The listen address comes from b8.dashboard in config.json (default 127.0.0.1:8180) and can be overridden with --listen:

b8 --data-dir /tmp/b8-data --listen 0.0.0.0:8180

CLI commands

The dashboard is the default command. The headless equivalents still exist:

b8 install              # install mainnet
b8 -regtest install     # install regtest
b8 start                # start mainnet, block until Ctrl-C
b8 -regtest start       # start regtest, block until Ctrl-C

--data-dir defaults to /home/b8-data.

start fails unless install has already completed for the selected network. Stopping b8 stops all child processes.

Data Layout

<data-dir>/
  bin/                  installed binaries and alkanes.wasm
  deps/                 source trees used for builds
  config.json           user config
  b8.db                 SQLite database (dashboard accounts and sessions)
  mainnet/
    db/{bitcoin,metashrew,espo,electrs}/
    logs/               per-service logs + install.log
    run/espo.config.json
  regtest/
    db/{bitcoin,metashrew,espo,electrs}/
    logs/
    run/espo.config.json

Mainnet and regtest share the same root but keep separate databases and runtime files.

Ports

Defaults are in config.json.sample. Mainnet starts at 8766 for bitcoind RPC and 8677 for metashrew. Regtest uses a separate range starting at 18766, so both networks can run at once. Change ports in <data-dir>/config.json, stop the affected stack from the dashboard, and start it again.

Services

Every stack component implements the Service trait in src/services/ — one file per service (bitcoind.rs, electrs.rs, alkanes.rs, metashrew.rs, espo.rs). A service declares everything unique to it: its pinned upstream repo and revision, system dependencies, build recipe, prebuilt-artifact locations, runtime process and arguments, dependencies on other services (start order is derived from these), readiness probe, post-start hooks, dashboard height probe, and endpoint links. The installer, process supervisor, and dashboard are service-agnostic and only walk the registry, so adding a component to the stack means adding one file and one registry entry.

Local source trees named in a service's local_candidates (or a b8.sources override in config.json) are used before cloning the pinned repository. Set:

"b8": {
  "build_from_source": false
}

to copy already-built local artifacts instead of compiling.

System Dependencies

To bootstrap the b8 binary from source on a clean Ubuntu host, run:

scripts/install-system-deps.sh
cargo build --release

That script intentionally installs only the generic tools needed to compile and run b8 itself. The Alkanes-specific build dependencies, including native libraries, protobuf tooling, source checkout tools, and the wasm32-unknown-unknown Rust target, are installed during install when build_from_source is enabled. Set B8_SKIP_SYSTEM_DEPS=1 if you want to manage those stack dependencies yourself.

Regtest Bootstrap

On regtest, install always creates a wallet, mines mature funds, submits the diesel-bot mint OP_RETURN, mines it, waits for metashrew and Espo to index it, and verifies Espo address and outpoint balances for alkane 2:0. The proof is written to:

<data-dir>/regtest/run/diesel-mint-proof.json

If configured, b8 can also run a bootstrap command after the built-in diesel verification. The command receives:

  • B8_DATA_DIR
  • B8_NETWORK
  • B8_BITCOIND_RPC
  • B8_METASHREW_RPC
  • B8_ESPO_RPC
  • B8_RPC_USER
  • B8_RPC_PASS

The hook is optional and is intended for local follow-up setup after the required diesel proof has passed.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages