自动设置奇偶校验以太坊实例,并在测试后将其销毁
testing.parit的Python项目详细描述
安装
使用pip:
$ pip install testing.parity
并且testing.parity需要路径中的parity服务器。
用法
使用testing.parity.ParityServer:
创建奇偶校验实例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
要求
- Python2.7、3.4、3.5、3.6
许可证
apache许可证2.0
历史记录
1.0.1(2018-08-03)
- 首次发布
1.0.2(2018-08-06)
- 添加了--min-gas-price选项