feat: add genesis file generator example#629
Open
TucksonDev wants to merge 47 commits into
Open
Conversation
…m/OffchainLabs/arbitrum-orbit-sdk into add-genesis-file-generator-script
gzeoneth
requested changes
Nov 5, 2025
| 1. Install dependencies | ||
|
|
||
| ```bash | ||
| yarn install |
Member
There was a problem hiding this comment.
need to also yarn install in project root and yarn build for sdk dist
spsjvc
reviewed
Nov 19, 2025
Comment on lines
+97
to
+99
| const genesisHashesStr = genesisHashes.toString(); | ||
| const genesisBlockHash = genesisHashesStr.split(',')[0].split(':')[1].trim(); | ||
| const sendRootHash = genesisHashesStr.split(',')[1].split(':')[1].trim(); |
Member
There was a problem hiding this comment.
if we don't end up creating a function that wraps the call to run the docker container, we might do something like this:
parseGenesisHashes(hashes: Hex)
Comment on lines
+90
to
+92
| const genesisHashes = execSync( | ||
| `docker run -v $(pwd):/data/genesisDir --entrypoint genesis-generator ${nitroNodeImage} --genesis-json-file /data/genesisDir/genesis.json --initial-l1-base-fee ${l1BaseFee}`, | ||
| ); |
Member
There was a problem hiding this comment.
if we want to wrap a docker run command
prepareGenesisHashes(params: {
genesis,
nitroNodeImageTag,
initialParentBaseFee
})
Comment on lines
+78
to
+84
| execSync( | ||
| `docker build -t genesis-file-generator https://github.com/OffchainLabs/genesis-file-generator.git`, | ||
| ); | ||
|
|
||
| // Generate genesis file | ||
| console.log(`Generate genesis file...`); | ||
| execSync(`docker run --env-file ./.env genesis-file-generator > genesis.json`); |
Member
There was a problem hiding this comment.
if we want to wrap a docker run command
prepareGenesis(chainConfig: ChainConfig): Genesis
Member
|
Approved OffchainLabs/genesis-file-generator#6, can remove the tag after merging |
…add-genesis-file-generator-script
Contributor
|
Updated this example to make it compatible with contract v3.2.0 |
- Require GENESIS_FILE_GENERATOR_IMAGE env var and pull image directly instead of building from a branch - Parse chain config from serializedChainConfig (new format emitted by genesis-file-generator v0.0.2+); remove deprecated genesisConfiguration.config path - .env.example: rename ARB_OS_VERSION -> ARBOS_VERSION=51 to match genesis-file-generator env naming; bump NITRO_NODE_IMAGE to v3.9.9-rc.3-3a38667; add GENESIS_FILE_GENERATOR_IMAGE placeholder Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
…mple genesis-file-generator supports additional env vars that get embedded into the output genesis.json. Since `docker run --env-file ./.env` forwards them automatically, the SDK example only needs to document them: - LOAD_DEFAULT_PREDEPLOYS (default true): whether to include the default predeploy bundle (Safe, Multicall3, EntryPoint, etc.) in the alloc - ENABLE_NATIVE_TOKEN_SUPPLY (default false): enables native token supply management in ArbOS (mint/burn via third-party bridges) - ENABLE_TRANSACTION_FILTERING (default false): enables protocol-level transaction filtering for regulatory/compliance use cases Verified end-to-end: flags propagate into arbOSInit fields or alloc content of the generated genesis.json. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
a-thomas-22
reviewed
Apr 27, 2026
Co-authored-by: Alec Thomas <112640918+a-thomas-22@users.noreply.github.com>
…cat` process' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
….3-rc-deffec7 (NIT-5124) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an example script to generate a genesis.json file and obtain the genesis information, making use of the genesis-file-generator script.