首页 > 文章列表 > python中geth如何使用?

python中geth如何使用?

Python geth
363 2022-08-07

1、安装命令

pip install py-geth

2、快速启动运行连接到 mainnet 的geth

>>> from geth import LiveGethProcess
>>> geth = LiveGethProcess()
>>> geth.start()

3、或者是用于测试的私人本地区块链。

>>> from geth import DevGethProcess
>>> geth = DevGethProcess('testing')
>>> geth.start()

默认情况下,DevGethProcess 在 geth 使用的默认 datadir 设置测试链。如果要更改这些测试链的位置,可以指定替代 base_dir。

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。