Comprehensive set of tools and utilities for working with the StellopayCore contract.
A command-line interface for managing payroll operations.
# Install from source
git clone https://github.com/stellopay/stellopay-core
cd stellopay-core/tools/cli
cargo install --path .
# Or install from registry
cargo install stellopay-cliThe CLI exposes five top-level commands. Run stellopay-cli <COMMAND> --help for per-command flags.
| Command | Description |
|---|---|
deploy |
Deploy a new contract |
info |
Get contract information |
status |
Show CLI status |
emergency-withdraw |
Emergency withdrawal of tokens |
webhook |
Webhook management (see subcommands below) |
stellopay-cli deploy --network testnet --owner <OWNER_ADDRESS>
stellopay-cli deploy --network testnet --owner <OWNER_ADDRESS> --wasm ./target/release/contract.wasm| Flag | Required | Description |
|---|---|---|
--network |
No (default: testnet) | Network to deploy to |
--owner |
Yes | Owner address |
--wasm |
No | WASM file path |
stellopay-cli info --contract-id <CONTRACT_ID>| Flag | Required | Description |
|---|---|---|
--contract-id |
No | Contract ID to inspect |
stellopay-cli statusNo flags. Displays current CLI configuration status.
stellopay-cli emergency-withdraw --contract-id <CONTRACT_ID> --token <TOKEN_ADDRESS> --recipient <ADDRESS> --amount <AMOUNT>| Flag | Required | Description |
|---|---|---|
--contract-id |
No | Contract ID |
--token |
Yes | Token address |
--recipient |
Yes | Recipient address |
--amount |
Yes | Amount to withdraw (i128) |
Webhook subcommands manage event subscriptions:
stellopay-cli webhook register --name <NAME> --description <DESC> --url <URL> --events <EVENTS> --secret <SECRET>
stellopay-cli webhook update --webhook-id <ID> [--name <NAME>] [--url <URL>] ...
stellopay-cli webhook delete --webhook-id <ID>
stellopay-cli webhook list --owner <ADDRESS>
stellopay-cli webhook get --webhook-id <ID>
stellopay-cli webhook stats
stellopay-cli webhook test --webhook-id <ID> --event-type <TYPE>| Subcommand | Description |
|---|---|
register |
Register a new webhook |
update |
Update an existing webhook |
delete |
Delete a webhook |
list |
List webhooks for an owner |
get |
Get webhook information |
stats |
Get webhook statistics |
test |
Test webhook delivery |
webhook list, webhook get, and webhook stats are read-only — they call
SorobanHttpClient::query (defined in tools/cli/src/utils.rs) instead of
SorobanHttpClient::invoke. The two methods are intentionally distinct:
query |
invoke |
|
|---|---|---|
| Purpose | Read-only contract simulation | Submits a transaction |
| Requires a signer/secret key | No | Yes |
| Mutates on-chain state | No | Yes |
| Used by | webhook list, webhook get, webhook stats |
webhook register/update/delete/test, emergency-withdraw |
query posts the contract id, method, and arguments to the RPC's /query
endpoint with read_only: true and never accepts or forwards a signer. It
returns a serde_json::Value (the result field of the RPC response, or the
full response body if no result field is present), and surfaces both
transport-level failures (non-2xx HTTP status) and RPC-level failures (an
error field in the response body) as Err. See the /// doc comment on
SorobanHttpClient::query for the exact contract.
Tests for this path live in tools/cli/tests/integration_tests.rs (the
test_query_* tests) and run against a local mock RPC server via wiremock,
covering: a successful result, an empty result, a response with no result
field, an RPC-level error field, a non-2xx HTTP status, a malformed
(non-JSON) body, and a check that the outgoing request never carries a
signer field.
# ~/.stellopay/config.toml
[network]
rpc_url = "https://soroban-testnet.stellar.org:443"
network_passphrase = "Test SDF Network ; September 2015"
[contract]
default_contract_id = "CONTRACT_ID_HERE"
[auth]
secret_key = "SECRET_KEY_HERE"
# Or use environment variable: STELLOPAY_SECRET_KEY
[defaults]
token = "TOKEN_ADDRESS_HERE"
frequency = "monthly"The authoritative source for available commands is the Commands enum in tools/cli/src/lib.rs. To regenerate this reference after changing the CLI definition:
cargo run -p stellopay-cli -- --help
cargo run -p stellopay-cli webhook --helpThe following commands documented in earlier versions of this file do not exist in the current CLI:
payroll create / update / delete / listdeposit,pay,bulk-paycontract deploy / initialize / pause / unpause / transfer-ownershiptoken add / remove / listpayment process / process-all / schedule / historyreport payroll / payments / balancesanalyze events / reportdebug transaction / trace / state / gastest setup / deploy / accounts / generate / run / reportload-test,stress-test,benchmarkgenerate bindings / client / docs / openapi / contract-docshealth,stream,export,monitor
These are aspirational features not yet implemented. If you need them, please open a feature request.
For real-time event monitoring, query the contract via the Soroban RPC or a block explorer:
stellar contract id --id <CONTRACT_ID>The CLI does not ship built-in analyze, stream, debug, or monitor subcommands.
# Run unit tests
cargo test
# Run integration tests
cargo test --test integration_tests
# Run end-to-end tests (if configured)
npm test -- --testPathPattern=e2eExisting test scripts are available at scripts/test.sh.
Contract bindings can be generated using the Soroban CLI directly:
# Generate TypeScript bindings (requires soroban-cli)
soroban contract bindings typescript --contract-id <CONTRACT_ID> --output-dir ./src/bindingsThe CLI does not ship a built-in generate subcommand.
Build, test, and monitoring scripts are available in the scripts/ directory as shell scripts with descriptive comments.
-
Install CLI Tools:
cargo install stellopay-cli
-
Set up Development Environment:
git clone https://github.com/stellopay/stellopay-core cd stellopay-core -
Deploy Test Contract:
stellopay-cli deploy --network testnet --owner <OWNER_ADDRESS>
-
Run Tests:
cargo test
For detailed usage instructions, see the Integration Guide.
Accuracy note: This document was reconciled against the
Commandsenum intools/cli/src/lib.rs. If the CLI gains new subcommands, update this file to match. Runcargo run -p stellopay-cli -- --helpto verify.