Quick tutorial
This tutorial will walk you through creating a consortium network through the Chainstack API.
Overview
To get from zero to a running consortium network through the Chainstack API, do the following:
Get your API key.
Export your API variables.
Create a project.
Create a network.
Add a node to the network.
Get the node access and credentials.
Step-by-step
Get your API key
See Create an API key.
Export your API variables
To save time when interacting with the API, export your API variables:
Create a project
See also API reference: Create Project.
Create a network
You create a network with one peer node and service nodes.
The service nodes are created automatically with no input from you.
You must provide the node details for your peer node.
where
-
NETWORK_NAME — any name you want to give to your network.
-
PROJECT_ID — the ID of the project where the network will be deployed. You can get project IDs by running
curl -X GET "$APIURL/projects/" --header "$HDR_AUTH"
. -
PROTOCOL — the protocol of the network you want to deploy:
corda
— Cordafabric
— Hyperledger Fabricquorum
— Quorummultichain
— MultiChain
-
CONSENSUS — the consensus of the protocol you want to deploy:
- Corda Single Notary —
single-notary
- Hyperledger Fabric Raft —
raft
- Quorum Raft —
raft
- Quorum IBFT —
ibft
- MultiChain round-robin —
round-robin
.
- Corda Single Notary —
-
NODE_NAME — any name you want to give to your first peer node deployed as part of the network.
-
NODE_TYPE —
dedicated
is the only available option for consortium networks. -
NODE_ROLE — use the
peer
value for the role since you are providing node details for your peer node. -
CLOUD_PROVIDER — choose the cloud provider for your node:
aws
— Amazon Web Servicesazure
— Microsoft Azuregcloud
— Google Cloud Platform
-
LOCATION — choose the location for your network:
ap-southeast-1
— Singapore. Available only for Amazon Web Services (aws
).us-east-1
— the United States, Northern Virginia. Available only for Amazon Web Services (aws
).us-west-2
— the United States, Oregon. Available only for Amazon Web Services (aws
).uksouth
— the United Kingdom, London. Available only for Microsoft Azure (azure
).asia-southeast1
— Singapore. Available only for Google Cloud Platform (gcloud
).
Example to create a Corda network on Google Cloud Platform in Singapore:
See also API reference: Create Network.
Add a peer node to the network
where
-
NODE_NAME — any name you want to give to your node.
-
NETWORK_ID — the ID of the network where the node will be deployed. You can get network IDs by running
curl -X GET "$APIURL/networks/" --header "$HDR_AUTH"
. -
CLOUD_PROVIDER — choose the cloud provider for your node:
aws
— Amazon Web Servicesazure
— Microsoft Azuregcloud
— Google Cloud Platform
-
LOCATION — choose the location for your network:
ap-southeast-1
— Singapore. Available only for Amazon Web Services (aws
).us-east-1
— the United States, Northern Virginia. Available only for Amazon Web Services (aws
).us-west-2
— the United States, Oregon. Available only for Amazon Web Services (aws
).uksouth
— the United Kingdom, London. Available only for Microsoft Azure (azure
).asia-southeast1
— Singapore. Available only for Google Cloud Platform (gcloud
).
Example to add a node on Microsoft Azure in London:
See also API reference: Create Node.
Get the node access and credentials
where NODE_ID — the ID of the node. You can get node IDs by running curl -X GET "$APIURL/nodes/" --header "$HDR_AUTH"
.
See also API reference: Retrieve Node.
You have created a consortium project, deployed a consortium network, added a node to the network, and retrived the node’s access and credentials.