公共Atom节点经常不稳定,所以个人RPC节点必不可少。本文搭建步骤基于Ubuntu 22.04 LTS版本。
搭建个人节点主要分3个步骤:
- Bitcoin节点搭建
- Atom节点搭建
- 网络设置
sudo snap install node sudo snap install bitcoin-core sudo apt install podman pip3 install podman-compose
[Unit] Description=Mount F partition Requires=dev-disk-by\x2dpartuuid-b68b7c74\x2dd438\x2d4652\x2db469\x2d8fb5c92c0b85.device After=dev-disk-by\x2dpartuuid-b68b7c74\x2dd438\x2d4652\x2db469\x2d8fb5c92c0b85.device [Mount] What=PARTUUID=b68b7c74-d438-4652-b469-8fb5c92c0b85 Where=/mnt/b68b7c74-d438-4652-b469-8fb5c92c0b85 Type=auto Options=defaults,umask=0077,uid=xx,gid=xx [Install] WantedBy=multi-user.target
# It is not recommended to modify this file in-place, because it will # be overwritten during package upgrades. If you want to add further # options or overwrite existing ones then use # $ systemctl edit bitcoind.service # See "man systemd.service" for details. # Note that almost all daemon options could be specified in # /etc/bitcoin/bitcoin.conf, but keep in mind those explicitly # specified as arguments in ExecStart= will override those in the # config file. [Unit] Description=Bitcoin daemon Documentation=https://github.com/bitcoin/bitcoin/blob/master/doc/init.md # https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ After=network-online.target Wants=network-online.target # Requires='mnt-b68b7c74\x2dd438\x2d4652\x2db469\x2d8fb5c92c0b85.mount' RequiresMountsFor=/mnt/2414d32b-8d4d-4365-b6a7-95dd40b7ee64 /mnt/b68b7c74-d438-4652-b469-8fb5c92c0b85/Bitcoin [Service] ExecStart=/snap/bitcoin-core/current/bin/bitcoind -daemon \ -pid=/var/run/user/1000/bitcoind.pid \ -conf=/home/xx/F/Bitcoin/bitcoin.conf \ -datadir=/home/xx/F/Bitcoin ExecStop=/snap/bitcoin-core/current/bin/bitcoin-cli -conf=/home/xx/F/Bitcoin/bitcoin.conf stop WorkingDirectory=/home/xx/F/Bitcoin Type=forking PIDFile=/var/run/user/1000/bitcoind.pid Restart=on-failure TimeoutStopSec=600 [Install] WantedBy=default.target
# container-atomicals-rpc-electrumx.service # autogenerated by Podman 3.4.4 # Wed Dec 27 16:07:42 CST 2023 [Unit] Description=Podman container-atomicals-rpc-electrumx.service Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target After=bitcoin.service RequiresMountsFor=/mnt/2414d32b-8d4d-4365-b6a7-95dd40b7ee64 /mnt/b68b7c74-d438-4652-b469-8fb5c92c0b85 [Service] Type=forking TimeoutStartSec=60 TimeoutStopSec=60 WorkingDirectory=/home/xx/data/atom/atomicals-rpc ExecStart=/home/xx/.local/bin/podman-compose -f /home/xx/data/atom/atomicals-rpc/docker-compose.yml up -d ExecStop=/home/xx/.local/bin/podman-compose -f /home/xx/data/atom/atomicals-rpc/docker-compose.yml down Restart=on-failure RemainAfterExit=yes [Install] WantedBy=default.target
# https://github.com/fatedier/frp/blob/dev/conf/frps_full_example.toml bindAddr = "0.0.0.0" bindPort = 6000 # 服务端监听的tcp端口 kcpBindPort = 6000 # 服务端监听的kcp端口 quicBindPort = 6001 # 服务端监听的quic端口 transport.maxPoolCount = 10 log.to = "/var/log/frp/frps.log" log.level = "info" log.maxDays = 30 log.disablePrintColor = true detailedErrorsToClient = false auth.method = "token" auth.token = "frpc与frps交互的密码" allowPorts = [ { start = 20000, end = 20010 } ] # 允许frpc连接的端口范围,vps可根据此设置防火墙端口白名单