Deploying a Node

The preferred method for deploying a node is using the Pulumi deployment scripts, which will generate the necessary scalable GCP infrastructure to run a Representative Node. The configuration options can be used to control the components that Pulumi deploys.

1

Install Prerequisites

Login is not required, and the deployment process can leverage multiple backends (eg, Google Cloud Bucket or Pulumi Hosted). If you choose to store the stack in a cloud environment, then log in to the preferred provider.

  1. Node JS Version 20.18.0

If using macOS then the following are require prerequisites to compile from source and can be installed with brew

  • jq, coreutils, python

2

Clone the Node Repository

git clone [email protected]:KeetaNetwork/node.git keeta-node
cd keeta-node/deployment
3

Create Deployment Config

Use the example config/example.json to set the desired configuration parameters. Copy the example to your desired Pulumi stack name (eg, config/test.json) and update the configuration to fit your needs.

4

Initialize Pulumi Stack

The deployment is designed to work with a KMS to manage encrypting secrets, such as the SEED used by the Representative for voting and other sensitive data. Here we initialize the Pulumi stack with a KMS. <name> should match the name of the configuration file created in the previous step, and the GCPKMS URL should match a KMS created in your GCP Project.

pulumi stack init <name> --secrets-provider="gcpkms://projects/<p>/locations/<l>/keyRings/<r>/cryptoKeys/<k>"
5

Define GCP Project for Pulumi

Define the GCP environment that Pulumi should deploy to. This will add the GCP Project to the Pulumi.<name>.yaml file that was initialized in the previous step.

config --stack <name> set gcp:project
6

Add Encrypted Representative SEED

Encrypted variables can be added to the Pulumi configuration as secrets, encrypted with the KMS provided earlier. In this case, KEETANET_LAMBDA_SEED is the environment variable the node uses along with the index of the Representative from Regions in the configuration to compute the private key used for Voting by the Representative. The SEED should be a 32-character hex string. For example, using openssl, a seed could be generated with openssl rand -hex 32

pulumi config --stack <name> set --secret keetanet-cloud-deploy:KEETANET_LAMBDA_SEED
7

Deploy the Pulumi Stack

The following command will build the necessary binaries and deploy all of the infrastructure components. Pulumi will display the changes with a prompt to proceed or cancel.

make do-deploy

Last updated