hopli is a CLI for common HOPR operator workflows:
- identity file creation and maintenance
- node funding (native and HOPR tokens)
- Safe + module setup and migration
- winning-probability contract operations
Prerequisites:
- Rust toolchain from
rust-toolchain.toml(currently1.91) - access to an RPC endpoint for your target network
Build:
cargo build --releaseRun:
cargo run -- --help
# or after build:
./target/release/hopli --helpOn-chain commands require:
--network(network key, for exampleanvil-localhost)--provider-url(RPC endpoint)
Optional:
--contracts-root(directory containingcontracts-addresses.json)- If omitted, embedded contract config from
hopr-bindingsis used.
You can also set:
export HOPLI_CONTRACTS_ROOT=/path/to/contractsCommands that operate on identities accept either:
--identity-directory(optionally--identity-prefix)--identity-from-path
For identity create, use --identity-directory.
Supported environment variables:
IDENTITY_PASSWORDNEW_IDENTITY_PASSWORDPRIVATE_KEYMANAGER_PRIVATE_KEY
Equivalent CLI flags are available (--password-path, --new-password-path, --private-key, --manager-private-key).
Get top-level help:
hopli --helpSubcommands:
hopli identity(id)hopli faucethopli safe-module(sm)hopli win-prob(wp)
Use --help at any level for details, for example:
hopli safe-module create --helpCreate two identities:
hopli identity create \
--identity-directory ./identities \
--identity-prefix node_ \
--number 2 \
--password-path ./secrets/identity.pwdRead addresses and peer IDs:
hopli identity read \
--identity-directory ./identities \
--identity-prefix node_ \
--password-path ./secrets/identity.pwdRotate identity password:
hopli identity update \
--identity-directory ./identities \
--identity-prefix node_ \
--password-path ./secrets/identity.pwd \
--new-password-path ./secrets/identity-new.pwdConvert peer ID/public key:
hopli identity convert-peer --peer-or-key 16Uiu2HAm...Fund identities and/or explicit addresses:
hopli faucet \
--network anvil-localhost \
--provider-url http://127.0.0.1:8545 \
--identity-directory ./identities \
--identity-prefix node_ \
--password-path ./secrets/identity.pwd \
--address 0x0123...,0x0456... \
--hopr-amount 10 \
--native-amount 0.1 \
--private-key <PRIVATE_KEY>Create safe + module setup:
hopli safe-module create \
--network anvil-localhost \
--provider-url http://127.0.0.1:8545 \
--identity-directory ./identities \
--password-path ./secrets/identity.pwd \
--admin-address 0xAdmin1...,0xAdmin2... \
--threshold 1 \
--allowance 10 \
--hopr-amount 10 \
--native-amount 0.1 \
--private-key <PRIVATE_KEY> \
--manager-private-key <MANAGER_PRIVATE_KEY>Migrate existing safe/module to another network config:
hopli safe-module migrate \
--network anvil-localhost2 \
--provider-url http://127.0.0.1:8545 \
--safe-address 0xSafe... \
--module-address 0xModule... \
--identity-directory ./identities \
--password-path ./secrets/identity.pwd \
--private-key <PRIVATE_KEY>Move nodes to a new safe/module pair:
hopli safe-module move \
--network anvil-localhost \
--provider-url http://127.0.0.1:8545 \
--old-module-address 0xOldModule... \
--new-safe-address 0xNewSafe... \
--new-module-address 0xNewModule... \
--node-address 0xNode1...,0xNode2... \
--private-key <PRIVATE_KEY> \
--manager-private-key <MANAGER_PRIVATE_KEY>Set:
hopli win-prob set \
--network anvil-localhost \
--provider-url http://127.0.0.1:8545 \
--winning-probability 0.5 \
--private-key <PRIVATE_KEY>Get:
hopli win-prob get \
--network anvil-localhost \
--provider-url http://127.0.0.1:8545Convert from f64 to contract encoding:
hopli win-prob convert --winning-probability 0.5cargo fmt --all
cargo clippy --all-targets --all-features
cargo testGPL-3.0-only. See LICENSE.