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?
Asked
Active
Viewed 830 times
1
-
But no one has answered yet...:( – angelmaria Nov 22 '17 at 09:29
1 Answers
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
-
2Instead of passing comment in 'data' field . Can we create a new field with new name? – angelmaria Jan 15 '18 at 05:49
-
1What if I need to add a custom field along with transaction details when a function call from contract is done? – lekshmi Aug 21 '18 at 06:29