当前位置: 首页 > 工具软件 > rippled > 使用案例 >

rippled服务节点搭建学习

连德义
2023-12-01

系统要求


近两年内发行的Linux发行版本,包括但不限于Debian,Ubuntu,Centos。
推荐Debian9+,Centos7+


硬件要求


正式主节点,推荐32G Ram+4 Core,固态硬盘500G起步;
每年5T增量
Rippled版本
正式版v1.5.0


起步


↓一下以Debian10为演示:
前提工作
    稳定的网络。
设置环境变量
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


配置apt源



wget https://raw.githubusercontent.com/oooldking/script/master/superupdate.sh

###wget https://cdn.jsdelivr.net/gh/oooldking/script/superupdate.sh

###↑备用下载

sudo ./superupdate.sh aliyun

###配置阿里云源,加快下载速度


安装命令(Debian)



sudo apt -y update

sudo apt -y install apt-transport-https ca-certificates wget gnupg





wget -q -O - "https://repos.ripple.com/repos/api/gpg/key/public" |  sudo apt-key add -





echo "deb https://repos.ripple.com/repos/rippled-deb buster stable" >/etc/apt/sources.list.d/ripple.list



#检查(optional)

cat /etc/apt/sources.list.d/ripple.list









sudo apt -y update



sudo apt -y install rippled





sudo systemctl start rippled.service



sudo systemctl enable rippled.service


安装命令(CentOS)

 



cat << REPOFILE | sudo tee /etc/yum.repos.d/ripple.repo

[ripple-stable]

name=XRP Ledger Packages

baseurl=https://repos.ripple.com/repos/rippled-rpm/stable/

enabled=1

gpgcheck=0

gpgkey=https://repos.ripple.com/repos/rippled-rpm/stable/repodata/repomd.xml.key

repo_gpgcheck=1

REPOFILE



sudo yum -y update

sudo yum install rippled

sudo systemctl daemon-reload

sudo systemctl enable rippled

sudo systemctl start rippled



#-或手动安装-----------

wget https://repos.ripple.com/repos/rippled-rpm/stable/rippled-1.5.0-1.el7.x86_64.rpm

#1.6版本↓

wget https://repos.ripple.com/repos/rippled-rpm/stable/rippled-1.6.0-1.el7.x86_64.rpm
tips:利用pget多线程下载,立马下载完毕  (或者用axel多线程下载器)
pget.zip
(2.2 MB)

./pget -p=128 https://repos.ripple.com/repos/rippled-rpm/stable/rippled-1.5.0-1.el7.x86_64.rpm
https://mirrors.ripple.com/rpm/el7/stable/x86_64/

/opt/ripple/bin/validator-keys create_keys

/opt/ripple/bin/validator-keys create_token --keyfile /root/.ripple/validator-keys.json

###复制[validator_token]下面的字符

##粘贴到/opt/ripple/etc/rippled.cfg 的[validator_token]指令下面

#单独写,非全量服务节点

#配置交易历史

[node_db]

# Other settings unchanged ...

online_delete=512000

advisory_delete=0





[ledger_history]

10240

#full


重要说明



[voting]

reference_fee = 20

account_reserve = 0

owner_reserve = 20

#交易费用,账户保留,信任网关第一次设置初始化后,再次修改都无效,以第一次的值为主
创世转账单位是:枚


关键配置路径以及配置文件



/opt/ripple/etc

###瑞博配置文件



/var/lib/rippled/db

#db数据保存路径


操作
第一次启动/opt/ripple/bin/rippled --debug -v --start --conf /etc/opt/ripple/rippled.cfg
第N次启动/opt/ripple/bin/rippled --debug -v --net --conf /etc/opt/ripple/rippled.cfg
 


性能配置(请勿轻易修改默认参数)



send_queue_limit=10240

#websocket发送队列


[transaction_queue]

ledgers_in_queue=1024

minimum_queue_size=100000

#测试请忽略

{

   "result" : {

      "status" : "success",

      "validation_key" : "DUET SITS CON STAG CROW NINE HAWK TUNA AM HOME KONG OH",

      "validation_private_key" : "patdv4yHtku9wE9qFcDTuc6g8HceeLgsHyre8nJWijWJv3byHx4",

      "validation_public_key" : "n9KhSkxdUgCN1zFQZGbZJB1ecGvjEwevT1et4fBoVen7Ep21bYQN",

      "validation_seed" : "ssz1Lcn35EwuiVKTZu7gdB2epiVvJ"

   }

}

#测试请忽略
测试命令
--replay --load
accept_ledger
nmcli d
networkManager
curl --insecure https://localhost:51235/crawl
image.png
image.png
一键启动脚本

#!/bin/sh

nohup /usr/local/bin/rippled -v --net --conf=/root/ripplecfg1/rippled1.cfg >>/dev/null &

nohup /usr/local/bin/rippled -v --net --conf=/root/ripplecfg1/rippled2.cfg  >>/dev/null &

nohup /usr/local/bin/rippled -v --load --conf=/root/ripplecfg1/rippled3.cfg  >>/dev/null &

nohup /usr/local/bin/rippled -v --net --conf=/root/ripplecfg1/rippled4.cfg  >>/dev/null &

nohup /usr/local/bin/rippled -v --net --conf=/root/ripplecfg1/rippled5.cfg  >>/dev/null &

exit 0
设置开放防火墙

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

iptables -I INPUT -p tcp --dport 443 -j ACCEPT

iptables -I INPUT -p tcp --dport 50000:59999 -j ACCEPT

iptables -I INPUT -p tcp --dport 60000:60100 -j ACCEPT

iptables-save

cat /etc/sysconfig/iptables-config
链接伙伴节点

rippled -v --conf /home/xxx/rippled/rippled4.cfg connect 127.0.0.1 51236

 类似资料: