Blockchain Devops

Blockchain Devops

posted 1 min read

Blockchain Devops

  • Blockchain DevOps involves the application of DevOps principles and practices in the blockchain ecosystem. It focuses on streamlining the development, deployment, testing, and operation of blockchain-based applications or networks.

Tip : The following example is completely for learning and sharing coding experiences purpose

How we can implement the devops principle in our Blockchain project?

  • We will see a simple example of how we can implement Devops in our blockchain project.

Note: We are using Foundry as our development framework. We are not going to discuss the main coding part. We will just go through the installation and requirement part!!!!

  1. Now, we will try to get the most recent deployment from a given environment in foundry. This way, we can do scripting off previous deployments in solidity.

  2. Download the following library and repo in your project:

  forge install foundry-rs/forge-std@v1.8.2 --no-commit
  forge install Cyfrin/foundry-devops --no-commit
  1. Update your foundry.toml to have read permissions on the broadcast folder.
fs_permissions = [
    { access = "read", path = "./broadcast" },
    { access = "read", path = "./reports" },
]
  1. Import the package, and call :
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
import {MyContract} from "my-contract/MyContract.sol";
.
. rest of your code
.
function interactWithPreviouslyDeployedContracts() public {
    address contractAddress = DevOpsTools.get_most_recent_deployment("MyContract", block.chainid);
    MyContract myContract = MyContract(contractAddress);
    myContract.doSomething();
}

By, following the above steps in our foudry code, we can get the most recent deployed contract code

For, L2 and rollups blockchain network you can prefer the given repo

If you read this far, tweet to the author to show them you care. Tweet a Thanks
0 votes
0 votes

More Posts

Private variables are not really private on EVM

abiEncode - Jul 8

Introduction to solidity smart contracts storage layout -- What are risks in manipulating storage???

abiEncode - Jun 30

Unlocking Ethereum: From Magic Money to Math-Powered Machines

ALLAN ROBINSON - Jul 12

Cryptography in Ethereum

ALLAN ROBINSON - Jul 12

Ethereum Basics: From Wallets to Smart Contracts

ALLAN ROBINSON - Jul 9
chevron_left