Stand-Alone Mode
You can run rippled in stand-alone mode without a consensus of trusted servers. In stand-alone mode, rippled does not communicate with any other servers in the Ripple peer-to-peer network, but you can do most of the same actions on your local server only. Stand-alone provides a method for testing rippled behavior, including the effects of Amendments before those Amendments have gone into effect across the decentralized network.
When you run rippled in stand-alone mode, you have to tell it what ledger version to start from:
- Create a new genesis ledger from scratch.
- Load an existing ledger version from disk.
Caution: In stand-alone mode, you must manually advance the ledger.
New Genesis Ledger
In stand-alone mode, you can have rippled create a new genesis ledger. This provides a known state, with none of the ledger history from the production Ripple Consensus Ledger. (This is very useful for unit tests, among other things.)
- To start
rippledin stand-alone mode with a new genesis ledger, use the-aand--startoptions:
rippled -a --start --conf=/path/to/rippled.cfg
In a genesis ledger, the genesis account holds all 100 billion XRP. The keys of the genesis account are hardcoded as follows:
Address: rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh
Secret: snoPBrXtMeMyMHUVTgbuqAfg1SUTb ("masterpassphrase")
Caution: If you create a new genesis ledger, the hard-coded default Reserve is 200 XRP minimum for an account, with an increment of 50 XRP per object in the ledger. These values are higher than the current reserve requirements of the production network. (See also: Fee Voting)
Load Saved Ledger
You can start with a ledger version that was saved to disk if your rippled server was previously synced with the Ripple peer-to-peer network (either the production network or the Test Net).
1. To retrieve existing ledgers, start rippled normally:
rippled --conf=/path/to/rippled.cfg
2. Wait until rippled is synced:
When rippled is synced with the state of the network, the response from the server_info command shows a server_state value that is full, proposing, or validating.
3. (Optional) Retrieve specific ledger versions:
If you only want the most recent ledger, you can skip this step.
If you want to load a specific historical ledger version, use the ledger_request command to make rippled fetch it. If rippled does not already have the ledger version, you may have to run the ledger_request command multiple times until it has finished retrieving the ledger.
If you want to replay a specific historical ledger version, you must fetch both the ledger version to replay and the ledger version immediately before it.
4. Shut down rippled:
rippled stop --conf=/path/to/rippled.cfg
5. Start rippled in stand-alone mode, loading the saved ledger.
To load the most recent ledger version, you can use the -a and --load options:
rippled -a --load --conf=/path/to/rippled.cfg
To instead load a specific historical ledger, use the --ledger parameter with the ledger index or identifying hash of the ledger version to load:
rippled -a --ledger 19860944 --conf=/path/to/rippled.cfg
(TODO: test this)
6. Manually advance the ledger.
When you load a ledger with --ledger in stand-alone mode, it goes to the current open ledger, so you must manually advance the ledger:
rippled ledger_accept --conf=/path/to/rippled.cfg
Advancing Ledgers in Stand-Alone Mode
In stand-alone mode, rippled does not communicate to other members of the peer-to-peer network or participate in a consensus process. Instead, you must manually advance the ledger index using the ledger_accept command:
rippled ledger_accept --conf=/path/to/rippled.cfg
In stand-alone mode, rippled makes no distinction between a "closed" ledger version and a "validated" ledger version. (For more information about the difference, see The Ripple Ledger Consensus Process.)
Whenever rippled closes a ledger, it reorders the transactions according to a deterministic but hard-to-game algorithm. (This is an important part of consensus, since different rippled servers may see transactions in a different order.) When using rippled in stand-alone mode, you should manually advance the ledger before submitting a transaction that depends on the result of a previous transaction. Otherwise, the second transaction might be executed before the first transaction when you manually advance the ledger. Note: You can safely submit multiple transactions from a single account to a single ledger, because rippled sorts transactions from the same account in ascending order by Sequence number.
