How to create & sign a transaction from c++ code
nidhaloff opened this issue · 2 comments
Hey y'all,
I hope you are doing well.
I'm trying to figure out how to create and sign a transaction from c++ code.
I know how to do this with cleos or eosjs. However, how can I do this in plain c++?
I searched a lot before opening the issue, but it looks like there are no examples out there.
An example from the transaction generator plugin:
https://github.com/EOSIO/eos/blob/master/plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp#L158
Many examples in the unittests, for example:
https://github.com/EOSIO/eos/blob/master/unittests/misc_tests.cpp#L1079
Assuming you are using an a RPC endpoint, you need to supply proper JSON for the HTTP request. Use cleos --print-request
to determine that. There are many stages, mutliple requests, including fetching data from the chain, etc. MIght also help to look at the cleos source code, as well.