11# Test Signer CLI
22
3- Command-line helper for drafting, signing, and broadcasting Mina payments via the public GraphQL API. It wraps the ` mina-signer ` library so you can submit transactions without wiring up a full wallet or SDK.
3+ Command-line helper for drafting, signing, and broadcasting Mina payments via
4+ the public GraphQL API. It wraps the ` mina-signer ` library so you can submit
5+ transactions without wiring up a full wallet or SDK.
46
57## Getting Started
8+
69- ** Prerequisites:** Node.js 18+ (for native ` fetch ` ) and npm.
710- ** Install dependencies:** ` npm install `
8- - ** Quick run:** ` node mina-test-signer.js <private_key> <recipient_address> [graphql_url] [nonce] `
11+ - ** Quick run:**
12+ ` node mina-test-signer.js <private_key> <recipient_address> [graphql_url] [nonce] `
913
10- The optional ` graphql_url ` flag lets you override the default target defined in ` config.js ` .
14+ The optional ` graphql_url ` flag lets you override the default target defined in
15+ ` config.js ` .
1116
1217## Workflow
18+
13191 . ` mina-test-signer.js ` parses CLI arguments and wires the supporting services.
14- 2 . ` payment-service.js ` derives the sender public key, composes a payment payload, and signs it with ` mina-signer ` .
15- 3 . ` graphql-client.js ` sends the signed payload to the Mina daemon and can check whether the transaction reached the pool.
16- 4 . ` utils.js ` provides small helpers for GraphQL string construction and CLI validation.
17- 5 . ` config.js ` centralises network defaults and usage messaging.
18-
19- - ` mina-test-signer.js ` – CLI entry point orchestrating validation, signing, submission, and pool verification.
20- - ` payment-service.js ` – Thin wrapper around ` mina-signer ` with sensible defaults for MINA amounts and fees.
21- - ` graphql-client.js ` – Minimal fetch-based GraphQL transport for sending payments and querying pooled commands.
22- - ` utils.js ` – GraphQL stringification helpers plus basic CLI argument validation/parsing.
20+ 2 . ` graphql-client.js ` sends the signed payload to the Mina daemon and can check
21+ whether the transaction reached the pool.
22+ 3 . ` utils.js ` provides small helpers for GraphQL string construction and CLI
23+ validation.
24+ 4 . ` config.js ` centralises network defaults and usage messaging.
25+
26+ - ` mina-test-signer.js ` – CLI entry point orchestrating validation, signing,
27+ submission, and pool verification.
28+ - ` payment-service.js ` – Thin wrapper around ` mina-signer ` with sensible
29+ defaults for MINA amounts and fees.
30+ - ` graphql-client.js ` – Minimal fetch-based GraphQL transport for sending
31+ payments and querying pooled commands.
32+ - ` utils.js ` – GraphQL stringification helpers plus basic CLI argument
33+ validation/parsing.
2334- ` config.js ` – Configuration constants and usage text surfaced by the CLI.
24- - ` key/ ` – Sample key material for experimentation; do not use in production environments.
35+ - ` key/ ` – Sample key material for experimentation; do not use in production
36+ environments.
2537
26- Check the console output for a transaction id; you can re-run the pool check or the ` getPooledUserCommands ` helper to confirm inclusion.
27- Provide a ` nonce ` argument when you need to synchronise with on-chain account state manually.
28- The CLI prints emoji-enhanced step logs and a summary table so you can spot successes and failures at a glance.
29- GraphQL errors (including malformed responses) cause the CLI to exit with a non-zero status so they can be surfaced in scripts and CI.
30-
31- ## Customisation Tips
32- - Update ` CONFIG.DEFAULT_GRAPHQL_URL ` in ` config.js ` to point at your daemon or a hosted GraphQL endpoint.
33- - Tweak ` CONFIG.MINA_UNITS.DEFAULT_AMOUNT_MULTIPLIER ` and ` DEFAULT_FEE_MULTIPLIER ` to adjust the default transaction values.
34- - Extend ` GraphQLClient ` with additional queries (e.g. account state, balances) if you need richer diagnostics.
38+ Check the console output for a transaction id; you can re-run the pool check or
39+ the ` getPooledUserCommands ` helper to confirm inclusion. Provide a ` nonce `
40+ argument when you need to synchronise with on-chain account state manually. The
41+ CLI prints emoji-enhanced step logs and a summary table so you can spot
42+ successes and failures at a glance. GraphQL errors (including malformed
43+ responses) cause the CLI to exit with a non-zero status so they can be surfaced
44+ in scripts and CI.
3545
3646## Private key format
3747
@@ -42,5 +52,8 @@ For clarity, private key is in output format of:
4252```
4353
4454## Safety Notes
45- - Treat private keys in plain text with care. Prefer environment variables or a secure secrets manager for real deployments.
46- - The example keys under ` key/ ` are for local testing only; they are publicly known and should never hold funds.
55+
56+ - Treat private keys in plain text with care. Prefer environment variables or a
57+ secure secrets manager for real deployments.
58+ - The example keys under ` key/ ` are for local testing only; they are publicly
59+ known and should never hold funds.
0 commit comments