自动设置一个 parity-ethereum 实例,并在测试后销毁它
项目描述
关于
testing.parity自动设置一个奇偶校验实例,并在测试后销毁它。
安装
使用点子:
$ pip install testing.parity
并且testing.parity需要您的 PATH 中的奇偶校验服务器。
用法
使用testing.parity.ParityServer创建 Parity 实例:
import testing.parity
import json
import urllib.request
# Lanuch new Parity-Ethereum server
with testing.parity.ParityServer() as parity:
# test that jsonrpc responds
result = urllib.request.urlopen(
urllib.request.Request(
parity.url(),
headers={'Content-Type': "application/json"},
data=json.dumps({
"jsonrpc": "2.0",
"id": "1234",
"method": "eth_blockNumber",
"params": []
}).encode('utf-8')
))
print(json.load(result))
# Parity server is terminated here
要求
Python 2.7、3.4、3.5、3.6
执照
阿帕奇许可证 2.0
历史
1.0.1 (2018-08-03)
首次发布
1.0.2 (2018-08-06)
添加了 --min-gas-price选项
1.0.3 (2018-09-24)
在版本字符串中支持 Parity-Ethereum
1.0.4 (2019-01-18)
支持 Parity 版本 >= 2.2.0
1.0.5 (2019-07-17)
更新 chainspec 以支持君士坦丁堡 EIP
1.0.6 (2019-08-07)
允许启用 websocket 接口
1.0.7 (2019-10-19)
修复 Parity 版本 >= 2.5.8 的 InstantSeal 引擎