web3.py.血液工作

veriteos-web3的Python项目详细描述


#web3.py

[![加入聊天网站https://gitter.im/ethereum/web3.py](https://badges.gitter.im/ethereum/web3.py.svg)](https://gitter.im/ethereum/web3.py?utm_source=badge&utm_medium=badge&utm_campaign=pr badge&utm_content=badge

[![构建状态](https://circleci.com/gh/ethereum/web3.py.svg?style=shield)(https://circleci.com/gh/ethereum/web3.py.svg?style=shield)



*python 3.5+支持

[查看github上的更改日志](docs/releases.rst)。

de
合同源代码=''
pragma solidity^0.4.0;


contract greeter{
string public greeting;


function greeter(){
greeting='hello';
}

function setgreeting(string greeting)public{
greeting='u greeting;
}

函数greet()常量返回(字符串){
返回问候语;
}
}
'


=web3(testrpcprovider())

10000})

ract_address,abi=abi,contractFactoryClass=concisecontract)


web3.eth.contract对象的getters+setters
print('contract value:{}'。format(contract_instance.greet())
contract_instance.setgreeting('nihao',transact={'from':w3.eth.accounts[0]})
print('setting value to:nihao')
print('contract value:{}.format(contract戋instance.greet())
````


-[mac](docs/readme osx.md开发人员设置)
-[windows](docs/readme windows.md开发人员设置)
-[freebsd](docs/readme freebsd.md开发人员设置)

然后运行这些安装命令:

``sh
virtualenv venv
。venv/bin/activate
pip install-e.[dev]
```


对于不同的环境,可以设置多个"virtualenv"。例如,如果要创建"venvdocs",请执行以下操作:

``sh
virtualenv venvdocs
。venvdocs/bin/activate
pip install-e.[docs]
pip install-e.
`````

使用docker


>如果您想在docker环境中开发和测试,请使用**docker compose.yml**文件中提供的*沙盒*容器。

要启动测试环境,请运行:

```
docker compose up-d
```

这将构建一个docker容器,该容器设置有运行python测试代码的环境。

**注意:此容器未安装"go ethereum",因此无法运行go ethereum测试套件。**

无法从本地计算机运行python测试:

`````
docker compose exec sandbox bash-c'pytest-n 4-f-k"not goethesm"
````

在Docker容器中使用` bash-c`前缀。

```
docker compose exec sandbox bash-c'
````

>或者,如果您只想打开容器的会话,请在开发过程中运行:

````
````
````

您可能希望在每次保存文件时都运行测试。

为每个python环境运行一个测试:

``sh
pip install py test watch

cd venv
ptw--onfail"notify send-t 5000"test failure"python 3 test on web3.py failed"../tests../web3
````

但是如果没有颜色:

``sh


1.[设置开发环境](https://github.com/ethereum/web3.py/开发人员设置)。

2.对测试执行"tox"


测试有多个[组件](https://github.com/ethereum/web3.py/blob/master/.travis.yml l53)。您可以针对特定组件运行对的测试。例如:

``sh
但是如果您想单独运行测试,"py.test"更适合于开发工作流。例如,只运行一个文件中的测试:


``sh
py.test test tests/core/gas-strategies/test\u时间煤气价格策略。py
````
>


`` ` `发布安装程序


>释放bump=$$$version是bump的一部分,bump$$$
``


` `如何bumpversion

` ` `{{{{{{{{{{{{{{{{{{{{}}{{}{{}}{}{{}{{{}}{{{}}{{}}{{devnum}}}}}}}}{对于不稳定的不稳定的不稳定的不稳定的不稳定的不稳定的/>要发布第行的下一个版本,请指定要凹凸的部分,
如"make release bump=minor"或"make release bump=devnum"。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
socketJava加密聊天客户端未通过关联   java保存JFileChooser的状态   java如何让代码等待GUI完成?   java可序列化和接口:Parcelable在写入可序列化对象时遇到IOException   java Jersey客户端将覆盖ROBOTS响应   java空指针异常&如何克服   java如何使用JAXR设置字符集?   JavaSpring自定义转换器被覆盖   java将泛型类型的值设置为DTO字段   使用netty的java音频流服务器   java滚动条添加到面板时不显示在滚动窗格中   java windows通过IIS Url重写单点登录tomcat   Web应用程序的java容器管理安全性   java使用mybatis将POJO项数组传递到存储过程?