Saturday, April 27, 2024
HomeProgrammingWeb3 Meets DevOps: Pipeline, Prod | by Donovan Brown | Sep, 2022

Web3 Meets DevOps: Pipeline, Prod | by Donovan Brown | Sep, 2022


Web3 wants DevOps

Half 10 — Constructing a DevOps pipeline for the Ethereum blockchain

Photograph by Taylor Vick on Unsplash

Within the earlier submit of this sequence — Web3 Meets DevOps: Pipeline, QA — I deployed the applying to my QA surroundings. On this submit, I’ll cowl what it takes to deploy to the Ethereum Mainnet.

I created a brand new department named “weblog/part10” for this text.

git checkout -b weblog/part10

To deploy to Mainnet, I would like an Infura node like I used for Rinkeby. Not like with Rinkeby, I would like an account with Ether. Utilizing the identical undertaking I created within the earlier submit, I acquired my Community Endpoints for Mainnet. The API KEY is similar for all networks.

Infura Undertaking Settings (Mainnet)

To deploy to Mainnet the community should be added to the truffle-config.js. The perfect useful resource for including the community is the official Truffle Suite docs.

As with Rinkeby, utilizing the HDWalletProvider, I added the Mainnet to the networks part.

Infrastructure

Below the iac job of the prod stage, in azure-pipelines.yml, I added two duties, as proven under:

The primary activity downloads the iac artifact created through the construct stage of the pipeline. This artifact comprises three Bicep information and a PowerShell script.

The second activity executes the PowerShell script, which makes use of the three Bicep information to deploy an Azure Static Net App. I take advantage of the -rgName $(resourceGroup)-prod argument, which places all of the assets in a useful resource group for my manufacturing surroundings. Discover the usage of the service connection I created earlier as the worth of the azureSubscription underneath inputs.

Contracts

The contracts are deployed into the Mainnet utilizing the Infura node. Below the deploy_contracts job of the prod stage, I added the next:

Discover on line 12 that I cross in mainnet to the --network argument and set the suitable surroundings variables for the API KEY and MNEMONIC.

Not like the Dev and QA environments, there isn’t a have to delete the assets as a part of the pipeline. So, there isn’t a guide approval to delete the useful resource group.

The frontend might be deployed into the Azure Static Net App deployed within the iac job of the prod stage. Below the deploy_frontend job of the prod stage, I added the next:

Variables

This stage reuses the variables created within the QA surroundings in half 9.

Two variables added to pipeline

As soon as the pipeline accomplished, the Prod surroundings data was added to the Extensions part of the run.

This sequence documented the method of making use of DevOps finest practices to Web3 growth. This might be prolonged by including extra instruments, resembling code and dependency scanning, static code evaluation, and integration exams.

Irrespective of the kind of software program you might be growing, implementing DevOps finest practices will add worth and enhance your workforce’s velocity, all whereas decreasing errors.

Thanks for studying. Till subsequent time!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments