简体   繁体   中英

Sending public transactions with Web3j's Quorum client

How does one send public transactions using Web3j's quorum client?

Currently I am sending private transactions with this code, and even if my "privyFor" list is empty it is sent as a private transaction .

HttpService httpService = BuildHttpService(NODE);

Quorum quorum = Quorum.build(httpService);



ArrayList<String> privyFor = new ArrayList<>();



// note that privyFor is an empty list

ClientTransactionManager transactionManager = new ClientTransactionManager(quorum, ACCOUNT_ADDRESS, privyFor);

When we do not set the privateFor value, this transaction is deemed public, which means all nodes will receive this transaction and see the value inside the contract object.

I created a public transaction I have

return instance.set(65, {privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="]});

Remove it to

return instance.set(70, );

And the transaction will be public to all in network 在此处输入图片说明

You can see my 70 value transaction is visible to all node peers .

Or you can see geth network coding too. I am attaching screenshot below .

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM