* - standardise versions for all nym-sdk workspace dependencies - prepend sqlx-pool-guard with 'nym-' * Test remove nym-api from deps * Add oneliner to client_pool doc comments * Add note to commented out docs.rs link in sdk * remove nym-api from script * add publishing file * bring non-binary / contract / tools into workspace version * added more info to publishing.md * make deps workspace version * remove uploaded sphinx-types crate from script * remove erroueously included ignore-defaults * add zeroise to feature * chore: Release * add topology to batch * more cargo versioning * more cargo versioning - wasm utils * more cargo versioning - wasm utils * Add publish=false to manifest for cargo workspaces / crates.io publishing exclusion * remove script now switched to manifest based exclusion * rename import based on rename of contracts-common dep * Making workspace versions for publication + removing unnecessary crates from publication * Remove OOD info from publishing sdk guide * rename contract imports + remove package * temp commit: continuing with removal of path from cargo manifest and replacing with workspace version import for publication * continuing with cargo.toml updates * dryrun only erroring on known version problem crates * remove old published-crates file * Minor comment change * remove default features warning * Additional info on workspace dep comment re publish list * Add missing description to cargo.toml * Fix missing feature flags * Add missing descriptions * Fix remaining path import * Add workspace repo / homepage / documentation links to cargo.toml files * remove workspace version from excluded crate * Remove todo descriptions * Minor comment change * add homepage etc * move from bls git import to nym_bls_fork crate * Modify rest of imports from path to workspace import, excluding binaries * add directory/homepage info * fix cargo fmt * add notes to gitignore * better solution to contracts/ experiment * wasm -> nym_wasm crate renaming * fix fatfinger * add metadata to ecash cargo.toml * stub publishing guide * fix misrevolved netlink- version * Fixes and block publication of rebase re: LP * first pass @ workflows
Testnet manager
This is extremely experimental tool. Only to be used internally. Expect a lot of breaking changes.
Currently (as of 11.07.24), it exposes the following commands:
build-info
Show build information of this binary. Does it need any more than that?
initialise-new-network
pre-requisites:
- you must have built all nym-contracts and put them in the same directory (just run
make contractsfrom the root directory)
Initialises new testnet network:
- attempts to retrieve paths to all .wasm files of the nym-contracts based on provided arguments
- uploads all the contracts to the specified nyxd
- creates mnemonics for all contract admins
- transfers some tokens to each created account
- instantiates all the contracts
- performs post-instantiation migration (like sets vesting contract address inside the mixnet contract)
- queries each contract and retrieves its build information to display any warnings if they were built using some ancient commits
- persists all the network info (addresses, mnemonics, etc.) in the database for future use
note: if you intend to bond-local-mixnet afterward, you want to set --custom-epoch-duration-secs to a rather low
value (like 60s)
load-network-details
Attempt to load testnet network details using either the provided name, or if nothing was specified, the latest one created.
It outputs contents of an .env file you'd use with that network.
bypass-dkg
pre-requisites:
- you must have built the
dkg-bypass contract(just runmake build-bypass-contractfrom this directory)
Attempts to bypass the DKG by overwriting the contract state with pre-generated keys:
- generates data for each specified ecash signer:
- ecash keys via a ttp
- ed25519 identity keys
- cosmos mnemonic
- validates the existing DKG contract to make sure the DKG hasn't actually already been run and checks the group contract to make sure its empty
- persists the signer data generated at the beginning
- uploads the bypass contract
- overwrites the contract state (endpoints, keys, etc.) using the uploaded contract
- restores the original DKG contract code
- adds the ecash signers to the CW4 group
- transfers some tokens to each ecash signer so they could actually execute txs
initialise-post-dkg-network
pre-requisites:
- you must have built all nym-contracts and put them in the same directory (just run
make contractsfrom the root directory) - you must have built the
dkg-bypass contract(just runmake build-bypass-contractfrom this directory)
Initialises new network and bypasses the DKG. It's just the equivalent of running initialise-new-network
and bypass-dkg separately:
- runs equivalent of
initialise-new-network - runs equivalent of
bypass-dkg
create-local-ecash-apis
pre-requisites:
- you must have built all nym-contracts and put them in the same directory (just run
make contractsfrom the root directory) - you must have built the
dkg-bypass contract(just runmake build-bypass-contractfrom this directory) - you must have built
nym-apibinary
Attempt to create brand new network, in post DKG-state, using locally running nym-apis.
- runs equivalent of
initialise-post-dkg-network, with one difference: rather than requiring you to provide api endpoints to all signers, it defaults tohttp:://127.0.0.1:X, whereX = 10000 + i, based on the number of apis specified in the args - runs
nym-api initfor all required api - copies over keys generated during
bypass-dkginto the correct path for each API, - generates an
.envfile to use in all subsequentruncommands - generates and outputs (either as raw string or
jsonif used with--output=json) run commands for each nym-api using full canonical and absolute paths (so you could paste them regardless of local directory)
bond-local-mixnet
pre-requisites:
- you must have a running network including nym-api (just run
create-local-ecash-apisand start the binaries) - the mixnet epoch must be waiting for transition (thus
--custom-epoch-duration-secsrecommendation) - you must have built
nym-nodebinary
Attempt to bond minimal local mixnet (3 mixnodes + 1 gateways) and output the run commands.
- runs
nym-node init4 times, including once inmode==entry(with credentials) - generates mnemonics for each node
- generates bonding signatures for each node
- transfers some tokens to each bond owner
- performs bonding of mixnode/gateway
- assigns all nodes to the active set by:
- starting epoch transition
- reconciling epoch events
- advancing current epoch and assigning the nodes to the set
- generates and outputs (either as raw string or
jsonif used with--output=json) run commands for each nym-node using full canonical and absolute paths (so you could paste them regardless of local directory)
create-local-client
pre-requisites:
- you must have a running MIXNET including nym-api AND nym-nodes (just run
create-local-ecash-apisfollowed bybond-local-mixnetand start the binaries) - you must have built
nym-clientbinary
Initialise a locally run nym-client, adjust its config and output the run command:
- runs
nym-client initin credentials mode - updates its config to add
minimum_mixnode_performance = 0andminimum_gateway_performance = 0thus ignoring the lack of a network monitor - generates and outputs run command for the client using full canonical and absolute paths (so you could paste it regardless of local directory)
Extra
For reference, my workflow was as follows:
note: for the very first run you'll have to explicitly provide mnemonics and nyxd
- rebuild whichever binary/contract was needed
cargo run -- create-local-ecash-apis --bypass-dkg-contract ../../../target/wasm32-unknown-unknown/release/dkg_bypass_contract.wasm --number-of-apis=2 --nym-api-bin ../../../target/release/nym-api --built-contracts ../../../contracts/target/wasm32-unknown-unknown/release --custom-epoch-duration-secs=60- run the apis in separate terminal window
cargo run -- bond-local-mixnet --nym-node-bin ../../../target/release/nym-node- start all the nym-nodes
cargo run -- create-local-client --nym-client-bin ../../../target/debug/nym-client- usually at this point I was using
nym-clito get some ticketbooks into my client before running it with the command that was output in the previous step