Do you mean run a devchain using existing mainnet data?
Run a local CKB dev chain using existing testnet/mainnet data
-
Copy the data directory to a new directory. The following steps will be done in this new directory.
-
Download the corresponding chain spec file based on testnet or mainnet
-
Initialize dev chain and import testnet or mainnet chain spec, taking mainnet as an example
ckb init -c dev --import-spec /path/to/downloaded/mainnet.toml --force -
Modify the imported
specs/dev.toml[params] genesis_epoch_length = 1743 # params can add the following options for configuration, keep genesis_epoch_length the same as original file initial_primary_epoch_reward = 1_917_808_21917808 secondary_epoch_reward = 613_698_63013698 max_block_cycles = 10_000_000_000 cellbase_maturity = 0 primary_epoch_reward_halving_interval = 8760 epoch_duration_target = 14400 # For development and testing purposes only. # Keep difficulty be permanent if the pow is Dummy. (default: false) permanent_difficulty_in_dummy = true # Change pow.func to Dummy [pow] func = "Dummy" -
Now CKB can be started, need to add parameters
-skip-spec-check --overwrite-specfor the first runckb run --skip-spec-check --overwrite-spec
I previously suggesting change the spec name to ckb_dev:
# change name in the first line to ckb_dev
name = "ckb_dev"
However, this will use the softfork and hardfork configurations for dev chain, to follow the mainnet or testnet forks configurations, just keep the original values.