一.rippled镜像生成
- 下载源码压缩包
wget -P /opt/docker/image/xrp/ -O rippled.zip https://github.com/WietseWind/docker-rippled/archive/master.zip
- 解压压缩包
unzip rippled.zip
- 编写镜像build脚本
# vim /opt/docker/image/xrp/docker-rippled-master/build.sh
#!/bin/bash
docker build . -t ripple:1.6.0
- 生成镜像
# bash /opt/docker/image/xrp/docker-rippled-master/build.sh
Sending build context to Docker daemon 21.5kB
......
Successfully built 74d6baca2fb1
Successfully tagged ripple:1.6.0
- 查看镜像
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ripple 1.6.0 74d6baca2fb1 40 seconds ago 144MB
二.rippled容器生成
- 创建xrp的配置文件目录、数据目录、日志目录
mkdir -p /opt/docker/xrp/{config,data,logs}
- 编写ripple主网配置文件
注:可参考以前文章,编写ripple主网配置文件
# vim /opt/docker/xrp/config/rippled.cfg
#网络设置
[server]
port_rpc_admin_local
port_peer
port_ws_admin_local
[port_rpc_admin_local]
port = 5005
ip = 192.168.21.11
admin = 0.0.0.0/0
protocol = http
[port_peer]
port = 51235
ip = 0.0.0.0
protocol = peer
[port_ws_admin_local]
port = 6006
ip = 127.0.0.1
admin = 127.0.0.1
protocol = ws
[node_size]
medium
#持久化存储设置
[node_db]
type=RocksDB
path=/var/lib/rippled/db/rocksdb
open_files=2000
filter_bits = 12
cache_mb = 256
file_size_mb = 8
file_size_mult = 2
online_delete=2000
advisory_delete=0
[database_path]
/var/lib/rippled/db
[debug_logfile]
/var/log/rippled/debug.log
[sntp_servers]
time.windows.com
time.apple.com
time.nist.gov
pool.ntp.org
[validators_file]
validators.txt
[rpc_startup]
{ "command": "log_level", "severity": "warning" }
[ssl_verify]
1
- 编写rippled主网节点网配置文件
# vim /opt/docker/xrp/config/validators.txt
[validator_list_sites]
https://vl.ripple.com
[validator_list_keys]
ED2677ABFFD1B33AC6FBC3062B71F1E8397C1505E1C42C64D11AD1B28FF73F4734
- 编写容器启动脚本
# vim /opt/docker/xrp/run.sh
#!/bin/bash
docker run -itd --restart=unless-stopped -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone --name xrp -v $(pwd)/data:/var/lib/rippled/db -v $(pwd)/config:/etc/opt/ripple -v $(pwd)/logs:/var/log/rippled -p 51235:51235 -p 5005:5005 -p 6006:6006 ripple:1.6.0
- 启动rippled容器
# bash /opt/docker/xrp/run.sh
c408026853157fc9d00f0fea33ef28dbddef79197e594ff0c53246f66af6412d
- 查看容器日志
# docker logs -f xrp
Loading: "/etc/opt/ripple/rippled.cfg"
2020-Dec-01 12:11:21.759217763 UTC LedgerConsensus:NFO Consensus engine started (Node: 0000000000000000000000000000000000000000, Cookie: 15513635029653302583)
2020-Dec-01 12:11:21.759435389 UTC Application:NFO process starting: rippled-1.6.0
2020-Dec-01 12:11:21.759471378 UTC JobQueue:NFO Auto-tuning to 6 validation/transaction/proposal threads.
2020-Dec-01 12:11:21.784681131 UTC NodeStore:DBG NodeStore.main target size set to 131072
2020-Dec-01 12:11:21.784732174 UTC NodeStore:DBG NodeStore.main target age set to 120000000000
2020-Dec-01 12:11:21.784753090 UTC TaggedCache:DBG LedgerCache target size set to 256
2020-Dec-01 12:11:21.784796956 UTC TaggedCache:DBG LedgerCache target age set to 180000000000
2020-Dec-01 12:11:21.785046637 UTC Amendments:DBG Amendment 4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373 is supported.
- 查看当前rippled节点版本
# rippled --version
rippled version 1.6.0