Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ops-bedrock:modify the script to support fast start devnet #73

Merged
merged 17 commits into from
Oct 24, 2023

Conversation

welkin22
Copy link
Contributor

@welkin22 welkin22 commented Oct 20, 2023

Description

This PR modifies the code related to the devnet section of optimism, allowing us to quickly start the devnet locally (with L1 network as BSC network and L2 network as opbnb network).

After merging the PR, we can use the following commands in the project root directory:

Initialize and start devnet:

make devnet-up-deploy

Stop devnet:

make devnet-down

Stop and clean devnet data:

make devnet-clean

View devnet logs:

make devnet-logs

To successfully start the network, please note the following:

  1. install docker, nodejs 16+, yarn, foundry, python2, python3
  2. Execute yarn install in the project root directory to install node.js dependencies. If you have previously performed a similar operation, it is recommended to delete the node_modules directory first and then execute the yarn install command again.
  3. Execute yarn build in the project root directory to build ts scripts and compile the contracts.
  4. If you encounter a ValueError: invalid mode: 'rU' while trying to load binding.gyp error when executing yarn install, this may be caused by python3 installed on your computer. You need to install python 2.7 and configure the environment variable to specify the python version to use: export npm_config_python=/path/to/executable/python.
  5. When executing for the first time, please be patient if you see the message "wait L1 up...", as the BSC network takes time to initialize.
  6. If you encounter an error during the "Deploying contracts" step, please try again as it usually recovers.
  7. Do not use the make devnet-up command, use the make devnet-up-deploy command to start devnet. The devnet-up command is not well adapted.

For detailed instructions on using devnet, please see: https://docs.bnbchain.org/opbnb-docs/docs/tutorials/running-a-local-development-environment

Rationale

We need to be able to quickly start devnet to facilitate developers to debug or troubleshoot problems

Changes

Notable changes:

  • Modify bedrock-devnet/devnet/init.py file to adapt to bsc network
  • Modified docker related script configuration to start opbnb devnet
  • Commented out problematic lines of code in packages/contracts-bedrock/deploy/021-L1StandardBridgeInit.ts and packages/contracts-bedrock/deploy/024-L1CrossDomainMessengerInit.ts
  • Increase gasPrice to 11Gwei to ensure the success rate of contract deployment

redhdx
redhdx previously approved these changes Oct 23, 2023
Copy link
Contributor

@redhdx redhdx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@owen-reorg owen-reorg merged commit 4e98121 into bnb-chain:develop Oct 24, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants