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

cmd: add genesis-gen tool #17

Merged
merged 6 commits into from
Apr 26, 2023
Merged

cmd: add genesis-gen tool #17

merged 6 commits into from
Apr 26, 2023

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Apr 25, 2023

Description

related issue #2

Add genesis-gen tool, helper create genesis.json file

Example

genesis-gen --chain-id 2333 \
    --epoch-size 300 \
    --validator 0xC035596a28ed3C5E357baf2860baCB6d665E81d5 \
    --premine 0x23d7B7be9B63e63F2e76b39bEA23BcD517731a0b:0x3635C9ADC5DEA0000000 \
    --validatorset-owner 0x20E088469849516610a759C7Bd60434298a91589

Changes

Notable changes:

  • use go:generate pre-convert the contract hex string to a binary file
  • contract byte code use go:embed embed binary file, avoid runtime conversion
  • add genesis-gen tool

@0xcb9ff9 0xcb9ff9 self-assigned this Apr 25, 2023
@0xcb9ff9 0xcb9ff9 added the WIP Do not merge for still in progress label Apr 25, 2023
@0xcb9ff9 0xcb9ff9 removed the WIP Do not merge for still in progress label Apr 25, 2023
@0xcb9ff9 0xcb9ff9 changed the title [WIP] cmd: add genesis-gen tool cmd: add genesis-gen tool Apr 25, 2023
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

Great to sea this tool.
But I'm afraid that some thing bad happen here...

cmd/genesis-gen/main.go Outdated Show resolved Hide resolved
cmd/genesis-gen/main.go Outdated Show resolved Hide resolved
cmd/genesis-gen/main.go Outdated Show resolved Hide resolved
core/dccontracts/upgrader.go Show resolved Hide resolved
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

LGTM
I've checked with the byte codes and shasum and find all match.

@0xcb9ff9 0xcb9ff9 merged commit 2e2db2f into dev Apr 26, 2023
@0xcb9ff9 0xcb9ff9 deleted the cmd/genesis-gen branch April 26, 2023 08:55
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.

2 participants