How to connect Orchestrate to a Blockchain network
Use the Orchestrate Gateway API to connect Orchestrate to blockchain networks. Orchestrate is compatible with all Ethereum Blockchain networks (public or private) and supports connection to multiple networks simultaneously. For example, you could connect to the Ethereum mainnet and Rinkeby
testnet on the same Orchestrate instance.
Connecting to a Blockchain network serves three purposes:
- Enables sending transactions to the network.
- Enables reading the state of the Blockchain using the Chain Proxy.
- Enables listening for events and receipts of successful (mined) Blockchain transactions.
Check the REST API Reference or the JS SDK Reference for a detailed description of all endpoints.
Register a chain
Register a chain using the Orchestrate Gateway API by sending a POST
request to the /chains
endpoint.
- REST Request
- JavaScript (SDK)
- JSON response
{
"name": "mainnet",
"urls": ["https://mainnet.infura.io/v3/a73136601e6f4924a0baa4ed880b535e"],
"listener": {
"backOffDuration": "1s",
"depth": 0,
"externalTxEnabled": false,
"fromBlock": "latest"
}
}
const chain = await client.registerChain({
name: "mainnet",
urls: ["https://mainnet.infura.io/v3/a73136601e6f4924a0baa4ed880b535e"],
listener: {
fromBlock: "latest",
backoffDuration: "1s",
depth: 0,
externalTxEnabled: false,
},
});
{
"uuid": "b4374e6f-b28a-4bad-b4fe-bda36eaf849c"
"chainID": "1",
"name": "mainnet",
"urls": ["https://mainnet.infura.io/v3/a73136601e6f4924a0baa4ed880b535e"],
"listenerBackOffDuration": "5s",
"listenerCurrentBlock": 0,
"listenerDepth": 0,
"listenerExternalTxEnabled": false,
"listenerStartingBlock": 5000,
"tenantID": "tenant",
"createdAt": "2020-07-09T12:35:42.115395Z",
"updatedAt": "2020-07-09T12:35:42.115395Z",
}
name
- name of the chain. Must be unique.urls
- list of URLs of Ethereum nodes to connect tolistener
(optional) - Transaction Listener configurationfromBlock
- block from which the Transaction Listener should start processing transactions (defaultlatest
)backoffDuration
- time to wait before trying to fetch a new mined block (for example1s
or1m
, default is5s
)depth
- block depth after which the Transaction Listener considers a block final and processes it (default0
)externalTxEnabled
- whether to listen to external transactions, meaning not crafted by Orchestrate (defaultfalse
)
Register a private GoQuorum (Tessera) chain
To send private transactions using GoQuorum, you will have to register a private transaction manager when creating a chain.
- REST Request body
- JavaScript (SDK)
- JSON result
{
"name": "mainnet",
"urls": ["https://mainnet.infura.io/v3/a73136601e6f4924a0baa4ed880b535e"],
"listener": {
"backOffDuration": "1s",
"depth": 0,
"externalTxEnabled": false,
"fromBlock": "latest"
},
"privateTxManager": {
"type": "Tessera",
"url": "http://tessera:3000"
}
}
const chain = await client.registerChain({
name: "mainnet",
urls: ["https://mainnet.infura.io/v3/a73136601e6f4924a0baa4ed880b535e"],
listener: {
fromBlock: "latest",
backoffDuration: "1s",
depth: 0,
externalTxEnabled: false,
},
privateTxManager: {
type: "Tessera",
url: "http://tessera:3000",
},
});
{
"uuid": "b4374e6f-b28a-4bad-b4fe-bda36eaf849c"
"chainID": "1",
"name": "mainnet",
"urls": ["https://mainnet.infura.io/v3/a73136601e6f4924a0baa4ed880b535e"],
"listenerBackOffDuration": "5s",
"listenerCurrentBlock": 0,
"listenerDepth": 0,
"listenerExternalTxEnabled": false,
"listenerStartingBlock": 5000,
"privateTxManager": {
"uuid": "a4374e6f-b28a-4bad-b4fe-bda36eaf849c"
"chainUUID": "b4374e6f-b28a-4bad-b4fe-bda36eaf849c",
"createdAt": "2020-07-09T12:35:42.115395Z",
"type": "Tessera",
"url": "http://tessera:3000",
},
"tenantID": "tenant",
"createdAt": "2020-07-09T12:35:42.115395Z",
"updatedAt": "2020-07-09T12:35:42.115395Z",
}
privateTxManager
(optional) - to be used for GoQuorum (Tessera) private transactionsurl
- transaction manager endpointtype
- currently only supportsTessera
If using Hyperledger Besu private transactions, configuring the private transaction manager is not required.