A Guide to Successful DevOps in Web3

alvinslee

Alvin Lee

Posted on January 13, 2023

A Guide to Successful DevOps in Web3

As web3 engineering grows in complexity, there is an increasing need for DevOps practices and philosophies that have proven proficiency with web2 apps at scale, sometimes to billions of users.

In this article, we’ll explore how DevOps—an engineering philosophy that facilitates fast and efficient collaboration, maintenance, and release of software—works in web3. We’ll walk through tools that you can use as-is from traditional software engineering, and we’ll look at offerings that are specifically intended for end-to-end blockchain application development.

What Is DevOps?

DevOps is a software-development philosophy that emphasizes collaboration, communication, and integration between various engineering stakeholders.

Used well, DevOps can drastically increase the speed and quality of software development as well as the reliability and resilience of the systems being developed. DevOps creates a unified pipeline that facilitates efficient coding and testing, continuous delivery, robust releases, monitoring, and planning.

Given the many complex operations DevOps brings together, it tends to require separate tools for each component. As a result, there is an extremely mature ecosystem of DevOps tools available for web3 engineers.

There are, however, nuances associated with web3 that don't translate from web2. One such case is the use of a public, decentralized ledger as a backend as opposed to private, centralized databases. Fortunately, web3-specific DevOps tooling is growing rapidly, thanks to companies like ConsenSys which provides the essential tools for every stage of development to streamline web3 engineering.

DevOps Tooling for Web3

As stated earlier, web3 DevOps is a mixture of traditional web2 engineering tools and offerings that cater to web3’s unique needs. In this section, we’ll survey the tools available for each component of the DevOps pipeline. Let’s walk through some of the DevOps stages and see how they look in web3:

  • Build
  • Test
  • CI/CD
  • Monitor
  • Planning and Feedback

Build

Perhaps the most obvious and visible component, the build or development team is responsible for creating new features, improving existing features, fixing bugs, and documenting code.

Blockchain engineering usually entails the creation of special programs called smart contracts that run on top of a blockchain. As a result, a unique set of tools is required for building such apps. There are many development environments available, such as Remix IDE, that facilitate this. However, the most popular and robust option available is the Truffle suite.

The Truffle suite allows developers to work seamlessly with web3 components such as wallets, chains, and node providers. Some of the things you can do with Truffle include:

  1. Code smart contracts using Solidity
  2. Write scripts that deploy smart contracts to a chain of your choice
  3. Allow for seamless integration of node providers like Infura
  4. Integrate other useful third-party libraries like Ethlint

Other options include Brownie and Hardhat for EVM smart contracts, Anchor for Solana, and the Playground GUI for Flow.

Testing

Testing is a critical component of web3 DevOps, as it helps ensure the quality and reliability of the software. This is even more critical with web3, where you often deal with contracts that are immutable and extraordinarily expensive to deploy and maintain.

There are several types of testing that may be used in a DevOps environment including unit, integration, functional, and performance testing. In the case of web3 (and more specifically blockchain), unit testing and integration testing are perhaps the most important. The former involves testing individual units or components of the software to ensure that they are working correctly. The latter is more focused on how different components of the software work together.

Developers/Ops engineers are often advised to set up a local instance of a blockchain for testing before deploying it to a public network. One of the most popular tools that allows us to do this is Ganache. Since Ganache is maintained by the same development team, it seamlessly integrates into the Truffle suite.

Tests are usually written the same way as in web2, using libraries like Mocha and ChaiTruffle also has built-in support for tests.

A traditional Truffle test and a test using Mocha

By their very nature, smart contracts tend to be immutable and unforgiving of critical security flaws. As a result, the degree of web3 security testing is much higher than what is expected out of a traditional web2 project. If the contract is expected to handle a large amount of money and/or assets, it is strongly suggested that external security audits be conducted in addition to the testing mentioned above.

Continuous Integration and Continuous Delivery

Continuous Integration and Continuous Delivery, often abbreviated as CI/CD, involves automating the build, test, and deployment process for software updates and new features.

Once the development team publishes new code to the repository, the CI component integrates the code into the codebase to ensure there are no breaking changes. Once the changes are deemed satisfactory, a new build is triggered (by the CD tool) and deployed to the various environments (typically staging and production).

Although certain tests and testing environments may be different when working with web3 dapps, Truffle works exceptionally well with traditional CI/CD tools such as Gradle, Jenkins, and CircleCI.

Some of the things these tools offer out of the box include:

  • Auto-deployment on successfully passing tests and creating a new build
  • Live build requests
  • Integration with a number of tools including GitHub and Assembla
  • Audit logs

As mentioned above, installation and setup of your chosen tool is almost identical to any other software engineering project, with enterprise support available when needed.

Monitoring

Monitoring, like its sister components, also ensures the performance and reliability of systems. It does this by tracking the health and performance of systems, and by identifying and resolving issues in a timely manner.

Key aspects of monitoring in DevOps include collecting and storing log data from systems, configuring systems to send alerts when certain conditions or thresholds are met, and dashboards that display real-time performance and health of systems.

When dealing with dapps, we are interested in monitoring both the overall health of the blockchain as well as activity and incidents that are specific to our smart contracts. Leading node providers like Infura present both these macro and micro assessments via readily accessible APIs and dashboards.

In the case of general blockchain, Infura provides APIs you can use to access any information relevant for that particular blockchain. Some of the web3 information you might want to monitor includes:

  • Current gas price
  • Block number
  • Balance of a particular address
  • Compiled smart contract code at a particular address
  • Gas fee history

Dashboard of web3 data

If you’re using Infura’s nodes, they will also give you detailed information on the health of your smart contract/dapp, how much traffic Infura is witnessing, how many users are interacting with it, etc.

Planning and Feedback

Planning and feedback ensure that the entire development process is aligned with business goals and priorities, and that timely progress is being made. This includes agile planning using methodologies like Scrum and Kanban, mechanisms that facilitate continuous feedback, and metrics that track progress and identify areas for improvement.

Most of the tools used for planning and feedback in traditional software engineering, such as Jira, Trello, Slack, and Datadog, can be used in web3 development as well. For blockchain-specific metrics, you can continue to use the monitoring tools highlighted in the previous section (for example, Infura).

Conclusion

As web3 and blockchain engineering grow in complexity, they require large teams to collaboratively deliver results quickly and efficiently. Therefore, the DevOps philosophy has become as integral to web3 engineering teams as it has been for traditional software.

Web3 engineers will find that existing DevOps tools work very well for their use cases, and the ecosystem of tools coming up to serve the nuances of web3 is also growing all the time.

💖 💪 🙅 🚩
alvinslee
Alvin Lee

Posted on January 13, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related