Installation Guide
Prerequisites
- Connected to a properly configured Kubernetes cluster (with the necessary access and permissions).
- Helmfile installed (official installation guide).
- Helm installed (official installation guide).
- Kubectl configured to access your Kubernetes cluster.
- Node.js and npm installed (required for smart contract deployment).
1. Creating Namespaces
To ensure a successful installation, create the following namespaces:
- node1
- node2
- node3
- node4
- browse
- infra
Run the following command to create all namespaces at once:
kubectl create namespace node1; \\\
kubectl create namespace node2; \
kubectl create namespace node3; \
kubectl create namespace node4; \
kubectl create namespace browse; \
kubectl create namespace infra
2. Run the following command to create all namespaces at once:
You need to create a docker-registry type secret in each of the namespaces listed above.
Below is an example for the node1 namespace. Replace USER and PASSWORD with the credentials that will be sent on installation day by the Hamsa team
kubectl create secret docker-registry acr-secret \\\
\--namespace=node1 \
\--docker-server=hamsaprivacyacrdev.azurecr.io \
\--docker-username=USER \
\--docker-password=PASSWORD
Important:Important: Repeat the command for each namespace (node2, node3, node4, browse, and infra), adjusting the --namespace parameter accordingly.
3. Downloading the Project
You will receive two folders:
- Helmfiles for installation (containing the specifications for what will be installed on your Kubernetes cluster).
- Scripts (containing ready-made test scenarios to show how the solution works).
The Helmfile and demonstration script files will be sent on the day of installation.
4. Helmfiles Directory Structure
/envs
├── 1
├── 2
├── 3
├── 4
├── browser
└── infra
Each numbered folder represents the node of an institution. To simulate the complete environment, we will install all four:
- 1 is the Central Bank.
- 2 is Selic
- 3 is Bank A
- 4 is Bank B
5. Initial Configuration
5.1 L1 Blockchain Configuration in the Demo Project
Within the demonstration files:
- Edit the hardhat.config.js file:
- Change the server_L1_besu parameter to the address of your Layer 1.
- Ensure the first configured account has enough balance to deploy the smart contracts.
- Adjust network parameters (ChainID and any other custom configurations, if needed).
- Deploy the smart contracts by running:
npm run p2-deploy-L1-all
- Copy the output (contract addresses). These addresses will be used to configure and install the nodes, and will also be needed during demos.
5.2 Updating the Kubernetes Configurations in the Helmfiles
Now we will edit the installation Helmfiles.
5.2.1 File /envs/qa-envs.yaml
Update the following parameters with the values obtained in the previous step:
L1-url: <URL configured in Hardhat>
dvp-L1url: <same URL as the parameter above>
L1-chainId: <ChainID configured in Hardhat>
DVP_L1MATCHSCADDRESS: <dvp_match_address>
DVP_L1TMSCADDRESS: <l1_tmsc_address>
ROLLUP_VERIFYCONFIG_VERIFYCONTRACT: <l1_verifier_address>
L1_EVENTADDRESS: <l1_event_address>
5.2.2 Files /envs/4/values-app-envs.yaml
Check and adjust the following parameters:
L1_DEPLOYERKEYS: <Keys with balance for interacting with L1-verifier>
DVP_L1MATCHSUBMITTERKEYS: <Keys with balance for dvp-match>
Make sure these keys have enough balance if your blockchain requires transaction fees.
5.3 Configuring Settlement (Asset) Keys
Check if the keys (private keys) are correctly set in each institution’s file:
- CentralBank:
/envs/1/values-app-msft-node.yaml - Selic:
/envs/2/values-app-msft-node.yaml - BankA: /envs/3/values-app-msft-node.yaml
- BankB: /envs/4/values-app-msft-node.yaml
Each institution must have its own key to avoid conflicts..
6. Deploying Services with Helmfile
In each directory under /envs, run helmfile install as described below.
6.1 Deploying Central Bank (envs/1)
cd envs/1\
helmfile install
**Note: Rollup is disabled by default to save resources. If needed, uncomment
node-rollup,prover, andmongoDbin thehelmfile.yamlfile..
6.2 Deploying Selic (envs/2)
cd envs/2\
helmfile install
6.3 Deploy BankA (envs/3)
cd envs/3\
helmfile install
6.4 Deploy BankB (envs/4)
cd envs/4\
helmfile install
Note: Rollup is also disabled by default here. Uncomment if needed.
6.5 Deploy Browser (Explorer for Nodes 3 and 4)
cd envs/browser\
helmfile install
This browser is used to explore the BankA and BankB nodes.
6.6 Deploying the Infrastructure (Prometheus/Grafana/Kafka)
Only Kafka is mandatory to install.
If you want detailed metrics (Prometheus and Grafana), open helmfile.yaml in /envs/infra and uncomment the references to Prometheus and Grafana.
cd envs/infra\
helmfile install
By default, only Kafka is enabled.
7. Post-deployment Validation
- Check running services:
kubectl get pods
- Optionally, if you installed Grafana and Prometheus, you can access them to validate metrics and performance.
8. Demonstration Scripts
- After installation and configuration, use the Demonstration Scripts to run test scenarios that showcase how the solution works.
- These scripts will be sent separately, along with detailed instructions.
Updated 4 months ago
