How to Setup Environment


In order to set your environment up in preparation for following the Runbook to test a BIP, follow these steps:

  1. Clone the Beanstalk GitHub repository and change directories into the new folder.
  2. 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.

  3. Checkout the branch in the GitHub pull request linked in the BIP runbook.
  4. Change directories into the protocol folder.
  5. Rename the .env-sample file to .env and set the FORKING_RPC, BLOCK_NUMBER and MAINNET_RPC environment variables.
  6. 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:

  7. Install all packages.
  8. Compile the Solidity code.
  9. Fork mainnet locally.
  10. 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.