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.
20+ 2 . ` payment-service.js ` derives the sender public key, composes a payment
21+ payload, and signs it with ` mina-signer ` .
22+ 3 . ` graphql-client.js ` sends the signed payload to the Mina daemon and can check
23+ whether the transaction reached the pool.
24+ 4 . ` utils.js ` provides small helpers for GraphQL string construction and CLI
25+ validation.
17265 . ` config.js ` centralises network defaults and usage messaging.
1827
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.
28+ - ` mina-test-signer.js ` – CLI entry point orchestrating validation, signing,
29+ submission, and pool verification.
30+ - ` payment-service.js ` – Thin wrapper around ` mina-signer ` with sensible
31+ defaults for MINA amounts and fees.
32+ - ` graphql-client.js ` – Minimal fetch-based GraphQL transport for sending
33+ payments and querying pooled commands.
34+ - ` utils.js ` – GraphQL stringification helpers plus basic CLI argument
35+ validation/parsing.
2336- ` config.js ` – Configuration constants and usage text surfaced by the CLI.
24- - ` key/ ` – Sample key material for experimentation; do not use in production environments.
37+ - ` key/ ` – Sample key material for experimentation; do not use in production
38+ environments.
2539
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.
40+ Check the console output for a transaction id; you can re-run the pool check or
41+ the ` getPooledUserCommands ` helper to confirm inclusion. Provide a ` nonce `
42+ argument when you need to synchronise with on-chain account state manually. The
43+ CLI prints emoji-enhanced step logs and a summary table so you can spot
44+ successes and failures at a glance. GraphQL errors (including malformed
45+ responses) cause the CLI to exit with a non-zero status so they can be surfaced
46+ in scripts and CI.
3047
3148## 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.
49+
50+ - Update ` CONFIG.DEFAULT_GRAPHQL_URL ` in ` config.js ` to point at your daemon or
51+ a hosted GraphQL endpoint.
52+ - Tweak ` CONFIG.MINA_UNITS.DEFAULT_AMOUNT_MULTIPLIER ` and
53+ ` DEFAULT_FEE_MULTIPLIER ` to adjust the default transaction values.
54+ - Extend ` GraphQLClient ` with additional queries (e.g. account state, balances)
55+ if you need richer diagnostics.
3556
3657## Private key format
3758
@@ -42,5 +63,8 @@ For clarity, private key is in output format of:
4263```
4364
4465## 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.
66+
67+ - Treat private keys in plain text with care. Prefer environment variables or a
68+ secure secrets manager for real deployments.
69+ - The example keys under ` key/ ` are for local testing only; they are publicly
70+ known and should never hold funds.
0 commit comments