See https://github.com/ethereumjs/ethereumjs-tx/blob/master/docs/index.md for format
Common parameters
Send transaction
Contract deployment
(with go: https://medium.com/@akshay_111meher/creating-offline-raw-transactions-with-go-ethereum-8d6cc8174c5d
with Javascript Web3 0.2x.x - see "web3.eth.contract" and "MyContract.new.getData" to deploy manually
https://gist.github.com/tomconte/6ce22128b15ba36bb3d7585d5180fba0
)
Contract method
(with Javascript Web3 0.2x.x - see "web3.eth.contract" and "myContractInstance.myMethod.getData")
const ethTx = require('ethereumjs-tx');
...
const tx = new ethTx(txParams);
const privKey = Buffer.from('deadbeef000000...', 'hex');
tx.sign(privKey);
Or from account, see https://ethereum.stackexchange.com/questions/3386/create-and-sign-offline-raw-transactions
var Accounts = require('web3-eth-accounts');
var accounts = new Accounts();
accounts.signTransaction(...)
const serializedTx = tx.serialize();
const rawTx = '0x' + serializedTx.toString('hex');
console.log(rawTx)
This gets us a raw transaction string, which can be used on geth console
eth.sendRawTransaction(<rawTx string>)
Alternatively,