Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show All 28 Lines | |||||
static bool fCreateBlank; | static bool fCreateBlank; | ||||
static std::map<std::string, UniValue> registers; | static std::map<std::string, UniValue> registers; | ||||
static const int CONTINUE_EXECUTION = -1; | static const int CONTINUE_EXECUTION = -1; | ||||
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | ||||
static void SetupBitcoinTxArgs() { | static void SetupBitcoinTxArgs() { | ||||
gArgs.AddArg("-?", _("This help message"), false, OptionsCategory::OPTIONS); | gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-create", _("Create new, empty TX."), false, | gArgs.AddArg("-create", "Create new, empty TX.", false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-json", _("Select JSON output"), false, | gArgs.AddArg("-json", "Select JSON output", false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-txid", | gArgs.AddArg("-txid", | ||||
_("Output only the hex-encoded transaction id of the " | "Output only the hex-encoded transaction id of the resultant " | ||||
"resultant transaction."), | "transaction.", | ||||
false, OptionsCategory::OPTIONS); | false, OptionsCategory::OPTIONS); | ||||
SetupChainParamsBaseOptions(); | SetupChainParamsBaseOptions(); | ||||
gArgs.AddArg("delin=N", _("Delete input N from TX"), false, | gArgs.AddArg("delin=N", "Delete input N from TX", false, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("delout=N", _("Delete output N from TX"), false, | gArgs.AddArg("delout=N", "Delete output N from TX", false, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", _("Add input to TX"), false, | gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", false, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("locktime=N", _("Set TX lock time to N"), false, | gArgs.AddArg("locktime=N", "Set TX lock time to N", false, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("nversion=N", _("Set TX version to N"), false, | gArgs.AddArg("nversion=N", "Set TX version to N", false, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outaddr=VALUE:ADDRESS", _("Add address-based output to TX"), | gArgs.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", | ||||
false, OptionsCategory::COMMANDS); | false, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outpubkey=VALUE:PUBKEY[:FLAGS]", | gArgs.AddArg("outpubkey=VALUE:PUBKEY[:FLAGS]", | ||||
_("Add pay-to-pubkey output to TX") + ". " + | "Add pay-to-pubkey output to TX. " | ||||
_("Optionally add the \"S\" flag to wrap the output in a " | "Optionally add the \"S\" flag to wrap the output in a " | ||||
"pay-to-script-hash."), | "pay-to-script-hash.", | ||||
false, OptionsCategory::COMMANDS); | |||||
gArgs.AddArg("outdata=[VALUE:]DATA", _("Add data-based output to TX"), | |||||
false, OptionsCategory::COMMANDS); | false, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", false, | |||||
OptionsCategory::COMMANDS); | |||||
gArgs.AddArg("outscript=VALUE:SCRIPT[:FLAGS]", | gArgs.AddArg("outscript=VALUE:SCRIPT[:FLAGS]", | ||||
_("Add raw script output to TX") + ". " + | "Add raw script output to TX. " | ||||
_("Optionally add the \"S\" flag to wrap the output in a " | "Optionally add the \"S\" flag to wrap the output in a " | ||||
"pay-to-script-hash."), | "pay-to-script-hash.", | ||||
false, OptionsCategory::COMMANDS); | false, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", | "outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", | ||||
_("Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = " | "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. " | ||||
"PUBKEYS") + | "Optionally add the \"S\" flag to wrap the output in a " | ||||
". " + | "pay-to-script-hash.", | ||||
_("Optionally add the \"S\" flag to wrap the output in a " | |||||
"pay-to-script-hash."), | |||||
false, OptionsCategory::COMMANDS); | false, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("sign=SIGHASH-FLAGS", | gArgs.AddArg("sign=SIGHASH-FLAGS", | ||||
_("Add zero or more signatures to transaction") + ". " + | "Add zero or more signatures to transaction. " | ||||
_("This command requires JSON registers:") + | "This command requires JSON registers:" | ||||
_("prevtxs=JSON object") + ", " + | "prevtxs=JSON object, " | ||||
_("privatekeys=JSON object") + ". " + | "privatekeys=JSON object. " | ||||
_("See signrawtransactionwithkey docs for format of " | "See signrawtransactionwithkey docs for format of sighash " | ||||
"sighash flags, JSON objects."), | "flags, JSON objects.", | ||||
false, OptionsCategory::COMMANDS); | false, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("load=NAME:FILENAME", | gArgs.AddArg("load=NAME:FILENAME", | ||||
_("Load JSON file FILENAME into register NAME"), false, | "Load JSON file FILENAME into register NAME", false, | ||||
OptionsCategory::REGISTER_COMMANDS); | OptionsCategory::REGISTER_COMMANDS); | ||||
gArgs.AddArg("set=NAME:JSON-STRING", | gArgs.AddArg("set=NAME:JSON-STRING", | ||||
_("Set register NAME to given JSON-STRING"), false, | "Set register NAME to given JSON-STRING", false, | ||||
OptionsCategory::REGISTER_COMMANDS); | OptionsCategory::REGISTER_COMMANDS); | ||||
// Hidden | // Hidden | ||||
gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); | gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); | ||||
gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); | gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); | ||||
} | } | ||||
// | // | ||||
Show All 28 Lines | if (argc < 2 || HelpRequested(gArgs)) { | ||||
std::string strUsage = | std::string strUsage = | ||||
PACKAGE_NAME " bitcoin-tx utility version " + FormatFullVersion() + | PACKAGE_NAME " bitcoin-tx utility version " + FormatFullVersion() + | ||||
"\n\n" + | "\n\n" + | ||||
"Usage: bitcoin-tx [options] <hex-tx> [commands] Update " | "Usage: bitcoin-tx [options] <hex-tx> [commands] Update " | ||||
"hex-encoded bitcoin transaction\n" + | "hex-encoded bitcoin transaction\n" + | ||||
"or: bitcoin-tx [options] -create [commands] Create " | "or: bitcoin-tx [options] -create [commands] Create " | ||||
"hex-encoded bitcoin transaction\n" + | "hex-encoded bitcoin transaction\n" + | ||||
"\n"; | "\n"; | ||||
strUsage += gArgs.GetHelpMessage(); | strUsage += gArgs.GetHelpMessage(); | ||||
fprintf(stdout, "%s", strUsage.c_str()); | fprintf(stdout, "%s", strUsage.c_str()); | ||||
if (argc < 2) { | if (argc < 2) { | ||||
fprintf(stderr, "Error: too few parameters\n"); | fprintf(stderr, "Error: too few parameters\n"); | ||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 737 Lines • Show Last 20 Lines |