1 2016-03-19 10:00:32 <wumpus> EncodeHexTx for transactions, HexStr for general binary data
 2 2016-03-19 18:49:47 <Chris_Stewart_5> What is the easiest way to write a bitcoin core transaction to stdout?
 3 2016-03-19 18:49:57 <Chris_Stewart_5> is there a function some where?
 4 2016-03-19 19:03:32 <belcher> maybe Chris_Stewart_5 bitcoin-cli gettransaction [txid]
 5 2016-03-19 19:06:04 <Chris_Stewart_5> belcher: I mean within the bitcoin core code base, not using a command line utility. Specifically I want to run a test in bitcoin core and out the hex to stdout
 6 2016-03-19 19:06:41 <Chris_Stewart_5> so it would be something like cout << <call function to get tx hex>
 7 2016-03-19 19:09:20 <Chris_Stewart_5> inside of the cpp file
 8 2016-03-19 19:20:22 <jonasschnelli> Chris_Stewart_5: JSON or BIN/HEX?
 9 2016-03-19 19:21:48 <jonasschnelli> Chris_Stewart_5: internally you can call "UniValue getrawtransaction(const UniValue& params, bool fHelp)" and pass it to LogPrinf()
10 2016-03-19 19:26:06 <Chris_Stewart_5> jonasschnelli: I got an answer from sipa that fit my needs, these three lines in sequence
11 2016-03-19 19:26:29 <Chris_Stewart_5> 156     CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
12 2016-03-19 19:26:31 <Chris_Stewart_5> 157     ss << tx;
13 2016-03-19 19:26:33 <Chris_Stewart_5> 158     printf("Transaction: %s\n", HexStr(ss).c_str());
14 2016-03-19 19:26:42 <Chris_Stewart_5> sends the tx to stdout in hex format