Start an interactive console to connect to a Quorum node, you can refer to document Setup geth interactive JavaScript console to build an interactive console
Create an Ethereum account. If you have already created an Ethereum account on the node, you can use the existing account to complete the follow-up operation
// create a account that use empty password
var account = personal.newAccount("");
// using an existing account in node
// var account = eth.accounts[0]
// unlock account for 300 seconds with empty password
personal.unlockAccount(account, "", 300);
// set it as default account
web3.eth.defaultAccount = account;
Specify the address of the private smart contract, the public key of the nodes participating in the private smart contract, and the ABI, and then initiate the call. You can refer to the steps in Deploy private contract to deploy smart contracts and get the address and ABI of the smart contract.
Note: The ‘privateFor’ parameter for sending a private transaction must be consistent with the parameters for deploying the private smart contract, otherwise the smart contract will be inconsistent.
// tx-mangager public key list; it should be same with the list that when your deploy the private contract
var privateFor = ["WLyCI0x1NBdy2VI4IdmxGYhRP7PKGL6wD87iN5vKp3w="];
// your private contract address that you want to call
var address = "0x0000000";
// your contarct ABI that address corresponds to
var abi = [{"constant":true,"inputs":[],"name":"storedData","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"initVal","type":"uint256"}],"payable":false,"type":"constructor"}];
var contract = eth.contract(abi).at(address)
// call get method of demo contract
contract.get()
// call set method of demo contract, and create a new private transaction
contract.set(999, {from: account, privateFor: privateFor })