|
1 | | -The following instructions show you how to set up configurations to use a chain other than the default chains. |
| 1 | +To use chains other than the [defaults](releases.md#current-status), supply a set of custom configuration files. |
2 | 2 |
|
3 | | -1. Create a directory `~/dynamic-configs` in the user home directory. |
| 3 | +1. Ensure the chain name starts with the word `dynamic` e.g. `dynamic-mynetwork`. |
4 | 4 |
|
5 | | -2. Use a chain name that starts with the word `dynamic` e.g. `dynamic-my-network`, and create three files in the `dynamic-configs` directory: |
| 5 | +2. Create the following files for dynamic configs. The examples for Cardona are in `zk/examples/dynamic-configs` and can be edited as required: |
6 | 6 |
|
7 | | - - `dynamic-{network}-allocs.json`: the allocs file. |
8 | | - - `dynamic-{network}-chainspec.json`: the chainspec file. |
9 | | - - `dynamic-{network}-conf.json`: an additional configuration file. |
10 | | - - `dynamic-{network}.yaml`: the run config file for erigon. |
| 7 | + - `dynamic-{network}-allocs.json` - the allocs file. |
| 8 | + - `dynamic-{network}-chainspec.json` - the chainspec file. |
| 9 | + - `dynamic-{network}-conf.json` - an additional configuration file. |
| 10 | + - `dynamic-{network}.yaml` - the run config file for erigon. |
11 | 11 |
|
12 | | - Use any of the example yaml files at the root of the repo as a base and edit as required, but ensure the chain field is in the format `dynamic-{network}` and matches the names of the config files above. |
| 12 | + You can use any of the example yaml files at the root of the repo as a base and edit as required, but ensure the `chain` field is in the format `dynamic-{network` and matches the names of the config files above. |
13 | 13 |
|
14 | | -3. Check the examples for Cardona in [`zk/examples/dynamic-configs`](https://github.com/0xPolygonHermez/cdk-erigon/tree/zkevm/zk/examples/dynamic-configs), copy these into your dynamic-configs folder, and edit as required. |
| 14 | +3. Put the erigon config file, along with the other files, in the directory of your choice. For example `dynamic-mynetwork`. |
15 | 15 |
|
16 | | - !!! tip "Allocs file format conversation" |
17 | | - If you have allocs in the Polygon format from the original network launch, save this file to the root of the `cdk-erigon` code base and run the following: |
18 | | - |
19 | | - ```sh |
20 | | - go run cmd/hack/allocs/main.go [your-file-name] |
21 | | - ``` |
22 | | - |
23 | | - This converts the file to the format required by erigon and forms the `dynamic-{network}-allocs.json` file. |
| 16 | + !!! tip |
| 17 | + - If you have allocs in the Polygon format from the original network launch, save this file to the root of the `cdk-erigon` code base and run `go run cmd/hack/allocs/main.go [your-file-name]` to convert it to the format needed by erigon. |
| 18 | + - This creates the `dynamic-{network}-allocs.json` file. |
24 | 19 |
|
25 | | - !!! tip "Contract addresses" |
26 | | - Find the contract addresses for the `dynamic-{network}.yaml` in the files output when launching the network: |
| 20 | + !!! tip |
| 21 | + Find the following contract addresses for the `dynamic-{network}.yaml` in the output files created at network launch: |
27 | 22 |
|
28 | | - - zkevm.address-sequencer => create_rollup_output.json => sequencer |
29 | | - - zkevm.address-zkevm => create_rollup_output.json => rollupAddress |
30 | | - - zkevm.address-admin => deploy_output.json => admin |
31 | | - - zkevm.address-rollup => deploy_output.json => polygonRollupManagerAddress |
32 | | - - zkevm.address-ger-manager => deploy_output.json => polygonZkEVMGlobalExitRootAddress |
| 23 | + - `zkevm.address-sequencer` => `create_rollup_output.json` => `sequencer` |
| 24 | + - `zkevm.address-zkevm` => `create_rollup_output.json` => `rollupAddress` |
| 25 | + - `zkevm.address-admin` => `deploy_output.json` => `admin` |
| 26 | + - `zkevm.address-rollup` => `deploy_output.json` => `polygonRollupManagerAddress` |
| 27 | + - `zkevm.address-ger-manager` => `deploy_output.json` => `polygonZkEVMGlobalExitRootAddress` |
33 | 28 |
|
34 | | -4. The mount point for the folder on docker container is `~/dynamic-configs`, i.e. the home directory of the erigon user. |
| 29 | +4. Mount the directory containing the config files on a Docker container. For example `/dynamic-mynetwork`. |
35 | 30 |
|
36 | | -5. To use the new config when starting erigon, update the `--config` flag with the path to the config file e.g. `--config="/path/to/home-dir/dynamic-networks/dynamic-mynetwork.yaml"`. |
| 31 | +5. To use the new config when starting erigon, use the `--cfg` flag with the path to the config file e.g. `--cfg="/dynamic-mynetwork/dynamic-mynetwork.yaml"`. |
0 commit comments