6 月 022018
 

基于Parity的以太坊Ethereum服务节点配置

https://www.parity.io/
https://wiki.parity.io/

设置主机名

root@iZj6c9916uw4zmw3xu97tpZ:~# hostnamectl set-hostname parity
root@iZj6c9916uw4zmw3xu97tpZ:~# vi /etc/hosts
#192.168.100.200 iZj6c9916uw4zmw3xu97tpZ iZj6c9916uw4zmw3xu97tpZ
192.168.100.200 parity

下载安装包

root@parity:~# curl -O https://releases.parity.io/v1.10.8/x86_64-unknown-linux-gnu/parity_1.10.8_ubuntu_amd64.deb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.9M 100 10.9M 0 0 24.6M 0 --:--:-- --:--:-- --:--:-- 24.7M
root@parity:~#

执行安装

root@parity:~# dpkg -i parity_1.10.8_ubuntu_amd64.deb
Selecting previously unselected package parity.
(Reading database ... 133088 files and directories currently installed.)
Preparing to unpack parity_1.10.8_ubuntu_amd64.deb ...
Unpacking parity (1.10.8) ...
Setting up parity (1.10.8) ...
root@parity:~#

查看安装路径

root@parity:~# dpkg -L parity
/.
/usr
/usr/bin
/usr/bin/parity-evm
/usr/bin/ethkey
/usr/bin/ethstore
/usr/bin/parity
root@parity:~#

添加用户

root@parity:~# su - tom
tom@parity:~$

编写启动脚本

#!/bin/bash
#

nohup /usr/bin/parity --mode=active --chain=foundation --base-path==/data/ethereum \
--port=30303 --min-peers=25 --max-peers=50 \
--jsonrpc-port=8545 --jsonrpc-interface=192.168.100.200 \
--jsonrpc-apis=web3,eth,pubsub,net,parity,parity_pubsub,traces,rpc,shh,shh_pubsub \
--jsonrpc-hosts=all --jsonrpc-threads=4 --jsonrpc-cors=all &
tom@parity:~$ chmod 700 start.sh

启动服务后使用接口命令请求

[bill@localhost ~]$ curl --data '{"method":"net_version","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST capi.paycpro.io:8545
{"jsonrpc":"2.0","result":"1","id":1}
[bill@localhost ~]$

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据