Expand description
The local devnet started by the npm CLI (npx paralock dev / paralock devnet up): its devnet.json, the keys
this binary keeps for it, the ths faucet and block production.
Starting and stopping the devnet (ths, anvil, contract deployment) stays in the npm CLI; this module only uses a running one.
Structs§
- Devnet
Account - A devnet participant.
- Devnet
Evm - One devnet EVM chain.
- Devnet
File devnet.json, as written byparalock devnet up(the npm CLI). The ths mnemonic it also holds is never read.- Devnet
Relayer - The devnet relayer.
- Devnet
Zcash - Zcash endpoints of the devnet.
- Faucet
- The devnet’s ths dashboard: the regtest faucet.
- Miner
- Mines regtest blocks only while nobody else does: the TypeScript maker mines one every 3 s, and a second miner would shorten every other swap’s Zcash window in wall-clock time.
Constants§
- ANVIL_
KEYS - Anvil’s well-known development keys (mnemonic
test test … junk), accounts 0 to 9. They are public: never use them outside a local chain. On the devnet the TypeScript maker uses 0, the taker 1 and the relayer 2.
Functions§
- address_
of - The regtest P2PKH address of a private key.
- create_
private_ dir - Creates
dir(and its parents) with mode 0700 on Unix. - load_
or_ create_ key - Reads the private key in
path, creating a random one (mode 0600) on first use. - read_
devnet - Reads
<state_dir>/devnet.json. - write_
private_ file - Writes a new file readable only by its owner (mode 0600 on Unix); fails if it exists.