| 427 | } |
| 428 | |
| 429 | func usage() { |
| 430 | fmt.Fprint(os.Stderr, `Usage: |
| 431 | |
| 432 | tx SUBCOMMAND ...args... |
| 433 | |
| 434 | Available subcommands are: id, validate, trace, log, result, build. |
| 435 | |
| 436 | All subcommands except build expect a transaction program on standard |
| 437 | input, assigning it a default version of 3 and a default runlimit of |
| 438 | 2^63-1. The -runlimit and -version flags can override those default |
| 439 | values. These subcommands also accept a -witness flag tells tx to |
| 440 | expect a transaction witness tuple on standard input instead (such as |
| 441 | can be produced with the "block tx -raw" command, qv), which dictates |
| 442 | the version and runlimit. |
| 443 | |
| 444 | The id subcommand causes tx to compute the transaction's ID and send |
| 445 | it to standard output. Errors in the transaction beyond the "finalize" |
| 446 | instruction are not detected. |
| 447 | |
| 448 | The validate subcommand causes tx to validate the transaction. Exit |
| 449 | value 0 means the transaction is valid, non-zero means it is not. |
| 450 | |
| 451 | The trace subcommand causes an execution trace of the tx to be sent to |
| 452 | standard output. |
| 453 | |
| 454 | The log subcommand causes the transaction's log entries to be sent to |
| 455 | standard output in assembly-language syntax, one per line. Errors in |
| 456 | the transaction beyond the "finalize" instruction are not detected. |
| 457 | |
| 458 | The result subcommand parses the transaction log for information |
| 459 | produced by "standard" issuance, retirement, input, and output |
| 460 | contracts and prints the information in human-readable form. |
| 461 | |
| 462 | The build subcommand creates a transaction. It is used like this: |
| 463 | |
| 464 | tx build [-ttl TIME] [-tags TAGS] DIRECTIVE ...args... DIRECTIVE ...args... |
| 465 | |
| 466 | where each DIRECTIVE is one of "issue," "input," "output," and |
| 467 | "retire." Each directive adds an entry to the transaction being |
| 468 | built. The -ttl flag specifies the transaction's time to live; its |
| 469 | format must be understood by Go's time.ParseDuration. The -tags flag |
| 470 | specifies a hex- or JSON-encoded set of tags for the transaction. |
| 471 | |
| 472 | Each directive has its own set of arguments: |
| 473 | |
| 474 | issue: |
| 475 | -version V integer version of the asset contract to use |
| 476 | -blockchain HEX hex-encoded blockchain ID for unanchored issuances |
| 477 | -tag TAG hex- or JSON-encoded asset tag |
| 478 | -quorum N integer quorum |
| 479 | -prv 'S1 S2 ...' hex-encoded, space-separated private keys for signing |
| 480 | -pub 'P1 P2 ...' hex-encoded, space-separated public keys |
| 481 | -amount N integer amount to issue |
| 482 | -refdata D hex- or JSON-encoded reference data |
| 483 | -nonce HEX hex-encoded issuance nonce |
| 484 | |
| 485 | input: |
| 486 | -quorum N integer quorum |