1

I know we have 'data' field to add any comments but is it possible to add our own field based on the application ie; a field like 'purchased products' which will have purchased products of a user along with transaction data in privatenet?

angelmaria
  • 1,061
  • 1
  • 13
  • 25

1 Answers1

0

Using web3.js you can use sendTransaction(). For example with the geth console:

geth attach geth.ipc
> web3.eth.sendTransaction({
    from: web3.eth.coinbase,
    to: toAddress,
    value: web3.toWei(ethers),
    data: web3.toHex("My comment")
  })

Replace toAddress with desired receipient, ethers with number of ethers to send, and "My comment" with the comment you want.

See https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsendtransaction for details.

ShaharZ
  • 103
  • 1