Running a Mina block producer in minutes with Pulumi

Mina is a constant-size blockchain written in OCaml. We were eager to try itprogramatically before their mainnet release.

We decided to give it a try in a Kubernetes cluster on Amazon EKS. Mina already maintains Helm charts, so deployment was easy.

We normally use Terraform, but we recently got familiar with Pulumi, a newer infrastructure-as-code framework. There are key differences with Terraform: while Terraform requires using its own DSL, Pulumi lets you use a variety of programming languages. That being said, the ecosystem seems to be mostly focused on TypeScript, so this is what we will be using.

Pulumi is a fairly recent project, born when Kubernetes use was already mainstream. A typical cloud deployment nowadays consists of a Kubernetes cluster as its core and some “satellite” cloud-specific services. It is very easy to deploy a cluster and a helm chart programatically with Pulumi: this is what we will be doing as part of this tutorial.

Deploy a block producer

You need to download and install Pulumi, the AWS CLI and Kubectl. We also use k9s to easily access the cluster.

Clone our mina-pulumi repository.

Login to the AWS cli using your account credentials.

Clone our Mina repository.

Install the Typescript dependencies:

Populate three files with your Testworld key:

  • in a file called key.pub , write your public key
  • in a file called key, write your encrypted private key
  • in a file called password , write the password for your private key

Then simply run:

This will take some time since it will:

  • deploy an EKS cluster
  • Deploy the block-producer helm chart
  • Start the block producing container with your credentials

When done, you can export the kubeconfig file for your new cluster:

Then launch k9s:

You will see your pod running:

You can press Enter to observe the containers, then press key down to select the install_key container and observe that it succesfully imported your key:

Then you may select the coda container and press s key to open a shell.

Then run

You should see your node in state “Bootstrapped” then “Catchup” and finally “Synced”.

Congratulations! You are now running a Mina node in the cloud.

About MIDL.dev

We are a proof-of-stake infrastructure company. We create and maintain open-source framework for safe staking operations. We support the leading proof-of-stake cryptocurrencies: Tezos, Polkadot. We are eager to improve our Mina tooling to make it production-ready once the mainnet launches, and submit Helm chart improvements upstream as we go!

Staking-as-a-service provider.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store