Skip to main content

Module devnet

Module devnet 

Source
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§

DevnetAccount
A devnet participant.
DevnetEvm
One devnet EVM chain.
DevnetFile
devnet.json, as written by paralock devnet up (the npm CLI). The ths mnemonic it also holds is never read.
DevnetRelayer
The devnet relayer.
DevnetZcash
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.