Tags
In order to set your environment up in preparation for following the Runbook to test a BIP, follow these steps:
- Clone the
Beanstalk
GitHub repository. - Checkout the branch in the GitHub pull request linked in the .BIP Runbooks
- Change directories into the
protocol
folder. - Rename the
.env-sample
file to.env
and set theFORKING_RPC
,BLOCK_NUMBER
andMAINNET_RPC
environment variables. - Install all packages.
- Compile the Solidity code.
- Fork mainnet locally.
- Open another terminal window in order to run commands against your mainnet fork. At this point you are ready to follow the Runbook for the given BIP.
Suggestion: name the repository based on which BIP you are verifying. BIP-X
will be the name of the directory on your computer after cloning the repository.
git clone git@github.com:BeanstalkFarms/Beanstalk.git BIP-X
git checkout example-branch
cd protocol/
mv .env-sample .env
FORKING_RPC
and MAINNET_RPC
should be set to the same RPC URL; we recommend getting an API key on Alchemy (this will be provided to BCM Signers). Choose a BLOCK_NUMBER
after the facets being added/changed have already been deployed and before they are added to Beanstalk. This means if you are testing a BIP during the Voting Period, you can go to Etherscan and pick any recent block number. The following is an example .env
file:
FORKING_RPC=https://eth-mainnet.g.alchemy.com/v2/api-key
BLOCK_NUMBER=16300774
MAINNET_RPC=https://eth-mainnet.g.alchemy.com/v2/api-key
ETHERSCAN_KEY=
npm install
npx hardhat compile
npx hardhat node