Spike: Integrating support for private transactions in Express App
Description
As a developer I want the express app developed in issue #1562 to communicate with the deployed smart contract in a HL-Besu network and be able to do private transactions via the endpoints exposed with this express application.
Proposed Solution
Follow the documentation Interact with private contracts to modify the existing express code.
Acceptance Criteria
If deploying the supply-chain smart contract:
- Register some products in the network via the endpoint exposed for that in particular.
- Get the products via the express API and check if they were registered correctly in the blockchain.
Please assign it to me.
I'll take this issue
@suvajit-sarkar @jagpreetsinghsasan
For this issue, a private transaction has been managed manually. To carry out said transaction, the following process has been followed.
First, following, the abi and bin files have been created using the comple.js and SimpleStorage.sol files from the documentation.
https://besu.hyperledger.org/en/stable/private-networks/tutorials/contracts/#use-eth_sendsignedtransaction.
Then we proceed to execute the node private_tx.js. I attach the necessary files here. (Change the extension to .js)
private_tx.txt
keys.txt
The directory structure that you must have to execute the contract is the following:
It has been done successfully for the IBFT and QBFT consensus with version 21.10.6 and for the QBFT consensus version 22.10.2
Besu-IBFT-21.10.6
Besu-QBFT-21.10.6
Besu-QBFT-22.10.2
And the setup for the tests carried out has been the following:
