用于python异步的ethereum rpc客户端库(pep 3156)
aioethereum的Python项目详细描述
因此
用于PEP 3156python事件循环的ethereum rpc客户端库。
功能
ujson support | Yes |
uvloop support | Yes |
High-level APIs | Yes |
HTTP support | Yes |
Unix domain socket (IPC) support | Yes |
SSL/TLS support | Yes |
Tested CPython versions | 3.4, 3.5, 3.6 |
Tested Geth versions | 1.7.0 |
Implemented RPC apis | admin, db, debug, eth, miner, net, personal, shh, txpool, web3 |
用法示例
简单的高级接口(通过http):
importasyncioimportaioethereumloop=asyncio.get_event_loop()asyncdefgo():client=awaitaioethereum.create_ethereum_client('http://localhost:8545',loop=loop)val=awaitclient.web3_clientVersion()print(val)loop.run_until_complete(go())# will print like 'Geth/v1.7.0-stable-6c6c7b2a/darwin-amd64/go1.9'
或通过IPC
importasyncioimportaioethereumloop=asyncio.get_event_loop()asyncdefgo():client=awaitaioethereum.create_ethereum_client('ipc://<path_to_unix_socket>',loop=loop)val=awaitclient.web3_clientVersion()print(val)loop.run_until_complete(go())# will print like 'Geth/v1.7.0-stable-6c6c7b2a/darwin-amd64/go1.9'
许可证
aioesheam是根据麻省理工学院的许可证提供的。
0.2.2(2018-04-10)
- 修复与https://www.python.org/dev/peps/pep-0492/#new-syntax;
- 仅在域时修复客户端的端口检测;
0.2.1(2017-10-08)
- 添加管理和调试管理API;
- 添加新测试;
- 添加uvloop支持(python 3.5+必需);
0.2.0(2017-10-05)
- 向代码中添加更多docstring;
- 为所有rpc方法添加测试;
- 添加管理和调试;
- 修复UnixSocket重试的错误;
- 修复Python 3.4的UnixSocket无效循环;
- baseAsyncIOClient.\u rpc标记为已弃用,将在0.3.0中删除;
0.1.1(2017-10-01)
- 添加Sphinx文档;
0.1.0(2017-09-30)
- 初始版本;
- 已实现以太坊客户端;
- 关于rpc管理的wip。