Skip to content

Web3 Quorum


A helper layer over JP Morgan’s Quorum blockchain API: web3j-quorum


Binding name: p6.web3quorum


This is a static value that can be used in various Web3j calls that require a ContractGasProvider.

This value provider specifies zero gas price with a maximum gas of three million.

Method: Quorum build(String url)

Build an instance of a Quorum object (extension of Web3j) using the supplied node URL to build an HttpService connection.


You can use the core Web3j Quorum instance build methods using UnixIpcService or WindowsIpcService for a more efficient ‘same host’ connection.

Method: Enclave buildEnclave(final Quorum quorum, final String url, final int port, final String... tesseraIpcPath) throws P6Exception

Builds an instance of an Enclave object for the given Quorum instance. The URL and port parameters are used to connect to the Tessera transaction manager.


The optional tesseraIpcPath parameter allows the specification of a Unix domain socket path for Tessera IPC.

Method: QuorumTransactionManager buildPrivateTransactionManager(final Quorum quorum, final Enclave enclave, final String originatorKey, final Credentials credentials, final String... recipientKeys) throws P6Exception

Create a private transaction manager using the Quorum instance, Enclave and credentials given. The list of recipient keys are the public keys of the transaction recipients: privateFor-public-keys.


 * Quorum example requires their 7nodes example running locally
 * plus a demo-app-smart-contract-x.x.jar deployed in P6_DATA/lib
 * See: for build instructions.
 * @import _QuorumImports


def quorum ='http://localhost:22000') 'Quorum node: ' + quorum.web3ClientVersion().send().getWeb3ClientVersion()

def enclave = p6.web3quorum.buildEnclave(quorum, 'http://localhost', 9081) 'Enclave is available'

// load the credentials from the 7nodes example filesystem
def credentials = WalletUtils.loadCredentials('', '/Users/simont/Documents/quorum-examples/examples/7nodes/keys/key1') 'Read credentials: ' + credentials

// Create a quorum transaction manager
// This object (used by the generated code) does the following:
// 1. sends the raw payload to tessera and retrieves the txHash
// 2. replace the transaction payload with the received txHash
// 3. create and sign a raw transaction using the provided credentials
// 4. invoke the eth_SendRawPrivateTransaction API to send the transaction to quorum
def qrtxm = p6.web3quorum.buildPrivateTransactionManager(quorum, enclave, TESSERA1_ENCLAVE_KEY, credentials, TESSERA7_ENCLAVE_KEY) 'Transaction manager available'

// Deploy the contract giving initial value of 42!
def ssContract = SimpleStorage.deploy(quorum, qrtxm, p6.web3quorum.ZERO_GAS_PROVIDER, BigInteger.valueOf(42)).send() 'Contract deployed, address:' + ssContract.getContractAddress() '    Transaction hash: ' + ssContract.getTransactionReceipt().get().getTransactionHash()

Quorum Imports

import org.web3j.protocol.core.methods.response.Web3ClientVersion
import org.web3j.crypto.WalletUtils


log.debug '---Starting---'