I've created a simple contract SimpleStorageFactory that has two methods:
create
- creates an instance of SimpleStoragecount
- just emits event with constant 123 (to check that private transactions works)set
- callsset
method of creates an instance of SimpleStorage
- truffle
- postman
npx quorum-dev-quickstart@latest --clientType besu --privacy true --outputPath quorum-test-network
cd quorum-test-network
git apply ../besu-private-transaction-bug/quorum-test-network.patch
./run.sh
There's a small patch that makes ethsigner use member1besu instead of rpcnode, so that we can use eea_sendTransaction
through node that has privacy enabled.
- import collection to Postman
- inside
besu-private-transaction-bug
, runtruffle migrate --reset -f 1
- if necessary, update contract address (from truffle output) in postman collection, variable contract_addr (if it's 0x51A21A51aa59B0b4BF99Ea7a79c7293d601FF689, it's already set up)
- check other postman variables (
from_addr
is address that was setup in ethsigner,member1_public_key
andmember2_public_key
are tessera public keys for first two members)
- run request: Create Privacy Group
- public:
- request: count/Create Public Transaction
- request: Get Public Transaction Receipt
- expect to see log with data 0x000000000000000000000000000000000000000000000000000000000000007b
- private:
- request: count/Create Private Transaction
- request: Get Private Transaction Receipt
- expect to see log with data 0x000000000000000000000000000000000000000000000000000000000000007b
- public:
- request: create/Create Public Transaction
- request: Get Public Transaction Receipt
- expect to see 2 logs (one is from SimpleStorageFactory, another from SimpleStorage)
- private:
- request: create/Create Private Transaction
- request: Get Private Transaction Receipt
- expect to see 2 logs (one is from SimpleStorageFactory, another from SimpleStorage)
- but got: "status": "0x0", and error in log: Failed to process private transaction 0xe379a9658662d1fc0e8837f57b3ded8b0151d10d1d07512ac1d9385935173d8a: PRIVATE_TRANSACTION_FAILED
-
- logs here
- public:
- request: create/Create Public Transaction
- request: set/Create Public Transaction
- request: Get Public Transaction Receipt
- expect to see 1 log
- private:
- request: create/Create Public Transaction
- request: set/Create Private Transaction
- request: Get Private Transaction Receipt
- expect to see 1 log
- but got: "status": "0x0", and error in log: Failed to process private transaction 0x20854c109f089887bc8976690b63819ece6ca3691cc9cddbda24301aad316c49: PRIVATE_TRANSACTION_FAILED
- logs here
data
in bothCreate Public Transaction
andCreate Private Transaction
was generated by script inscripts/abi-encode.ts
, which can be run bynode run scripts/abi-encode.ts
.