Consensys / web3js-quorum

30 stars 21 forks source link

How to send private transaction with custom generated account? #50

Open JohannsSeb opened 1 year ago

JohannsSeb commented 1 year ago

System information

Client type: GoQuorum / quorum-dev-quickstart

Client version: v21.4.2

OS & Version: Windows

Expected behaviour

Generated Account/address with HD wallet and added to wallet via "web3.eth.accounts.wallet.add(privateKey)". Address is used to create private transaction.

Actual behaviour

Transaction is executed without producing an error, but state of private smart contract is not changed (also no events are created). Anyhow, when using the default account of node 0, the transaction processed correctly.

So my question is: how can I add accounts to web3js-quorum to execute private transactions?

Transaction with default account: .... ​blockHash: "0x4b126620e53c7c55a7e8bae38a4dd5b3706df19ba00faadf7fac4ff9993e5c57" ​blockNumber: 37998 ​from: "0xf0E2Db6C8dC6c681bB5D6aD121A107f300e9B2b5" ​gas: 3000000 ​gasPrice: "0" ​hash: "0x143fa97f62d952bbb70cd3b8eaa73ab53bfcb6690285363e535f3976d7ee4f7b" ​input: "0xb2c49a3352eb4d5cb508fa0aaedef437f38138aaa64231113ad0dbb4c2d4a16bbdd1b69ac335c4ea1329b9f02a5830b28430b4874abb73b820a95c8f0076cfeb" ​nonce: 1568 ​r: "0xa5dbe9b212ad260028d8ec36c456b83f28ecfaa68b5556d24f0c99ebb31c1861" ​s: "0x65766021f2697da9de43b1f265283870d3c20a95c153125b11179448d18ebe21" ​to: "0x2d41EF825ACD66332F8A208a97eA2B7E2547bae9" ​transactionIndex: 0 ​type: "0x0" ​v: "0x26" ​value: "0"

Transaction with custom generated account: blockHash: "0x1561cb3a5279c5fc708ee0382c29685c9e7710f5a1cc3720fc7bd1cdd6f7d77f" ​blockNumber: 38043 ​from: "0x6858DC3A3E1c2F4de7dA740bb0257ED8A0aE582b" ​gas: 3000000 ​gasPrice: "0" ​hash: "0x09a8f112ae72fc7f395adba0aaf28867bd10b30fa1a61c2ca368c42885dc2f50" ​input: "0x08ed3144737373000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000639903f000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000063a23e70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005444548414d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005534753494e000000000000000000000000000000000000000000000000000000" ​nonce: 304 ​r: "0xb8409b4f2e012a0054424ae98c5948f6ec26d3ec8e98a36f9428011658d5b5c6" ​s: "0x39413af0c423bdc1344aeb5fe43a31c776e0533e1c13900d3acff061ef3d0c54" ​to: "0x2d41EF825ACD66332F8A208a97eA2B7E2547bae9" ​transactionIndex: 0 ​type: "0x0" ​v: "0xa95" ​value: "0