-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Running rippled with Docker
Elliot Lee edited this page Jun 7, 2024
·
1 revision
Example:
# Start rippled connecting to the devnet
docker run --rm --detach --name rippled_devnet rippleci/rippled:2.2.0 dev
# Check that it's ready: Complete ledgers != "empty" && Server state == "full"
docker exec rippled_devnet rippled --silent server_info | jq -r '.result.info | "Host: \(.hostid)\nVersion: \(.build_version)\nComplete ledgers: \(.complete_ledgers)\nServer state: \(.server_state)\nUptime: \(.uptime)\n"'
It typically takes less than 2 minutes to sync with Devnet.
You can use the Devnet faucet to get some test XRP:
# Get an account with some XRP created on the network
read account seed <<< $(curl --silent -X POST https://faucet.devnet.rippletest.net/accounts | jq -j '. | .account.address," ",.seed')
# Generate new account credentials from the locally running rippled instance
read new_account new_seed <<< $(docker exec rippled_devnet rippled --silent wallet_propose | jq -j '.result | .account_id, " ", .master_seed')
# Use that address to create a new account on the network (50 XRP)
docker exec rippled_devnet rippled --silent submit $seed '{"Account": "'$account'", "Amount": "50000000", "Destination": "'$new_account'", "TransactionType": "Payment"}'
# Look at those balances!
for account in $account $new_account;
do
docker exec rippled_devnet rippled --silent account_info $account validated | jq --raw-output '.result.account_data | "Account: \(.Account)\nBalance: \(.Balance)"'
done
Similar steps could be followed for other test networks such as Testnet.