-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Starting a test parallel network from an existing ledger state
For testing purposes, it may be useful to start a new network, but start from an existing ledger state.
- Run a server connected to the network that you want to clone.
- Copy the db to all of the validators on the new/private network.
- You can start rippled with:
rippled --ledger <ledger hash>
. - When rippled is running, the server_info request returns a response with a
result.info.complete_ledgers
field. -
fast_load=1
in the[node_db]
config section is supposed to load the last ledger regardless of which one it is.
If the ledger does not advance:
-
Use a unique
[node_seed]
in each node's config file. -
Start with
--valid
along with--ledger <hash>
. -
Consider
[peer_private]
1
. It keeps random connections out, which can be helpful for a private net. Also, having a specific[network_id]
is good because that puts a cookie in every peer message that identifies the network. It's an integer, so conflict is possible, but it also helps make the network closed off.
Note that having fast_load = 1
in the config is similar to using --load
when starting the service. It loads the last ledger in the database, just like --load
, and then it reads from disk in parallel. This makes it faster to sync to the network.
- Consider deleting:
wallet.db
,peerfinder.sqlite
. - Add
[fast_load]
.
Here are some steps to try:
- Have a server sync'd to the Mainnet (or desired network) and shut down rippled.
- In the DB directory, remove
wallet.db
andpeerfinder.sqlite
and then create a tar file that can be copied around. - Extract the database to each node in the test network.
This assumes that you have the test network already configured so that they can see each other with things like ips_fixed and the UNL configured. This is important; if the network doesn't work with a generic ledger from scratch, then it won't work with a ledger copied from the Mainnet. You'll save trouble-shooting steps if you configure the network first and have it bring up a genesis ledger. Then, once you have that, shut it down, delete the data and copy the Mainnet data to it.
Start rippled on each node at the same time. They'll sync up to each other in a few minutes.
-
Set up a unique
[node_seed]
in each node's config file; this mostly has the same effect as deletingwallet.db
. -
Set up
[peer_private]
, which could have a similar effect as deletingpeerfinder.sqlite
. -
Start rippled with a
--ledger
hash and the--valid
option. -
Have fast_load configured anyway, to save time on startup.