pyrxd.devnet — Local regtest dev node¶
One-command local Radiant regtest node for development.
Wraps a radiant-core regtest node running in docker so a developer can
stand up an isolated chain, mine blocks, and fund an address without learning
the node’s RPC surface. This is the dev-facing promotion of the in-test
_RegtestNode helper (tests/test_htlc_regtest_e2e.py).
Everything here targets regtest only — an ephemeral, throwaway chain bound
to the local docker host. The RPC credentials are deliberately fixed (it is a
localhost-only regtest sandbox reached via docker exec, never exposed), so
separate CLI invocations (up, mine, fund, down) reconnect to the same
node with no state file to keep in sync.
Prerequisites: docker on PATH and the radiant-core regtest image
present locally (see RegtestNode.IMAGE).
- exception pyrxd.devnet.DevnetError[source]¶
Bases:
RuntimeErrorA devnet operation failed (docker missing, node not up, RPC error).
- class pyrxd.devnet.DevKey[source]¶
Bases:
objectA freshly generated, pre-funded regtest key handed to the developer.
- class pyrxd.devnet.RegtestNode[source]¶
Bases:
objectA self-managed, isolated
radiant-coreregtest node (docker).The node is identified by a fixed container name so that
up/mine/fund/downinvoked as separate processes all operate on the same chain.upis the only call that creates the container; the others attach to the running one and raiseDevnetErrorif it is absent.- IMAGE = 'radiant-core:v3.1.1-amd64'¶
- CONTAINER = 'pyrxd-devnet'¶
- RPC_USER = 'pyrxd'¶
- RPC_PASSWORD = 'pyrxd'¶
- WALLET = 'devnet'¶
- classmethod build_image(version='v3.1.1', *, no_cache=False)[source]¶
Build the regtest image from an OFFICIAL Radiant-Core release binary.
Wraps the published
radiant-<version>-linux-x64daemon (SHA-256-verified against the release checksum file) in a small ubuntu:22.04 image taggedradiant-core:<version>-amd64. Builds from the Dockerfile embedded in this module, so it works for apip install pyrxddeveloper with no repo checkout as well as from a clone. Returns the built image tag.This is the dev-facing replacement for the previously ad-hoc image that was built outside the repo;
pyrxd regtest setupcalls it.
- start(*, fresh=False, initial_blocks=101)[source]¶
Start the regtest node, create the dev wallet, and mature a coinbase.
Idempotent unless
freshis set: if the container is already running it is left untouched (the chain state is preserved).fresh=Truetears the existing container down first for a clean chain.
- mine(n=1, address=None)[source]¶
Mine
nblocks toaddress(a fresh wallet address by default).Returns the new chain height.
- fund(address, amount_rxd, *, confirm=True)[source]¶
Faucet: send
amount_rxdRXD toaddressfrom the dev wallet.Mines one block to confirm the payment unless
confirmis False. Returns the funding txid.