大家好,
创建系统服务: /etc/systemd/system/platon.service
, 内容如下:
[Unit]
Description=Platon service
After=network.target
#StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=10
User=platon
ExecStart=/usr/bin/platon --identity <你的节点名字> --datadir /home/platon/data --port 16789 --testnet --rpcport 6789 --rpcapi db,platon,net,web3,admin,personal --rpc --nodekey /home/platon/data/nodekey --cbft.blskey /home/platon/data/nodeblskey --verbosity 3 --rpcaddr 0.0.0.0 --syncmode full
[Install]
WantedBy=multi-user.target
启动:sudo systemctl start platon
停止:sudo systemctl stop platon
重启:sudo systemctl restart platon
Service详细指南:http://www.jinbuguo.com/systemd/systemd.service.html