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

Support local deployment #371

Merged
merged 4 commits into from
Sep 15, 2023
Merged

Support local deployment #371

merged 4 commits into from
Sep 15, 2023

Conversation

Mister-EA
Copy link
Contributor

This PR facilitates the generation of the genesis contracts for a local deployment of a BSC network.

The node-deploy repository currently modifies the genesis contract templates using sed which is prone to error and not easy to maintain due to overwriting the original files, but with this PR the genesis configurations for a local network can be generated simply by including the flag --network local .

Motivation

To run a local network several additional steps need to be coordinated to enable recently added features: e.g. initializing the whitelisted relayers, enabling the finality reward, enabling malicious vote slashing etc. These steps are normally performed through standard transactions or through governance, but the flows may be complicated especially in a local environment.

To facilitate these steps, the initialization is done in the contract code itself when generating the bytecode for the genesis contracts. This PR ensures that these initializations happen automatically when passing the --network local flag. (i.e. node generate-genesis.js --network local.

Additional improvements

  • Automatically calculating the hexadecimal bscChainId value from the chainid flag.
  • Ability to define custom whitelist relayer addresses for local deployment.
  • Ability to initialize the initial BNB holders by running node generate-initHolders.js --initHolders <commaSeparatedAddresses>

@buddh0
Copy link
Contributor

buddh0 commented Aug 24, 2023

maybe we need delete bscChaindId in file package.json

Comment on lines +4 to +15
address: "0x37B8516a0F88E65D677229b402ec6C1e0E333004",
balance: web3.utils.toBN("500000000000000000000").toString("hex") // 500e18
},
{
address: "0x6c468CF8c9879006E22EC4029696E005C2319C9D",
balance: web3.utils.toBN("500000000000000000000").toString("hex") // 500e18
},

{
address: "0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186",
balance: web3.utils.toBN("500000000000000000000000000").toString("hex") // 500000000e18
},
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have private keys available for those accounts? or how we can access those funds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, they were already there in the template. You can add your own addresses to the list via the template, and manage the keys yourself.

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