Create a new Platform Deployment
What is an Initial Deployment
An initial Platform Deployment consists of a set of off-chain components and an initial on-chain state.
Off-chain Components
The initial Platform Deployment consists of
- At least four Block Producer nodes.
- (Optional) A Reader node.
- (Optional) The Partisia Platform Browser, that consists of 3 services
- The frontend, that serves the UI of the blockchain.
- The backend, that indexes the blocks and transactions that is executed.
- The database, where it stores relations and interactions for accounts and addresses.
- (Optional) Execution Engine nodes.
All these components are available as docker images.
Initial On-chain State
The initial on-chain state of a Platform Deployment is defined by the genesis block.
This initial state includes a set of governance smart contracts that allows you to manage the blockchain. These governance contracts solve different types of tasks, and you can see the contract state in the Partisia Platform Browser.
The following governance contracts are part of the initial state:
System Update
Management of the blockchain as the root account. With this contract you can enable blockchain features, install modules and contracts, and upgrade the deployment. The actions on this contract can only be invoked by the root account of the blockchain.
Browser link: http://<host>:8300/contracts/04c5f00d7c6d70c3d0919fd7f81c7b9bfe16063620
BP Orchestration
Chooses the committee of block producers, to produce blocks for the blockchain. Stores the authentication information for each block producer and manages the approved set of block producer nodes.
Browser link: http://<host>:8300/contracts/04203b77743ad0ca831df9430a6be515195733ad91
Gaining Access
In order to create and start an initial Platform Deployment, you must gain access to the GitLab docker registry that contains all the docker images required for starting a Platform Deployment.
GitLab Docker Registry
- Install Docker
- Log in to gitlab registry (this will allow you to pull the docker images). This can be done by running the following command and using your GitLab Deploy Token:
docker login registry.gitlab.com
- To be able to connect to Execution Engine nodes, you must add the line
127.0.0.1 dockerto your host file.
The Local Test Instance
An example on how to start a local testing deployment of Platform can be found in the platform-dev-runner repository, which you need to clone using Git
git clone https://gitlab.com/secata/platform/platform-dev-runner.git
The README in the platform-dev-runner repository describes how to start the local test instance, which includes
- Four Block Producer nodes
- A Reader node
- The Partisia Platform Browser
- Four Execution Engine nodes
Danger
The example of a local test instanse in the platform-dev-runner repository is not recommended for production, see the deployment layout for more details on depoyment recommendations.
Creating a New Deployment
Generating the Initial Resources
The first step is to create the genesis block that defines the initial state, a root account
and the configurations for the initial components.
This is done by running the genesis-creator component, which will create the following files:
- The genesis block:
genesis.zip - The root key:
root.pk - The reader node configuration file:
reader-node.json - Four block producer configuration files:
bc-node-0.json,bc-node-1.json,bc-node-2.json,bc-node-3.json - Four execution engine configuration files:
ee-node-0.json,ee-node-1.json,ee-node-2.json,ee-node-3.json
All the generated configuration files can be used directly (without modification) when starting up the components of the Platform Deployment.
Tip
The README in the platform-dev-runner repository provides more details on how to run the genesis-creator.
Starting the Components
When starting a component, the genesis block (genesis.zip) and the configuration file for the component
(e.g.bc-node-0.json) must be made available for the docker container running the component.
The platform-dev-runner repository contains a docker compose file that illustrates how to start the different components in a local test deployment. See more details in the README in the platform-dev-runner repository.
The configuration files for Partisia Platform Browser are not generated, but the platform-dev-runner repository contains example configurations for Browser.
You must start the four block producer nodes. Furthermore, your can start a reader node, the Partisia Platform Browser, and the amount of execution engines that you require.
When all components are started, you can visit Browser at http://<host>:8300 to view your deployment.
Modifying the Platform Deployment
The genesis-creator generated a root key (root.pk) for the Platform Deployment.
This root key can be used to modify the deployment, see more details here.
Danger
The root key must be stored safely.
- It must be protected against unauthorized access, since it allows anyone with access to modify the deployment.
- Furthermore, proper backup must be in place, since losing access to the root key will lock you out of any future modifications and upgrade of the deployment. It is not possible to recover a lost root key.