Skip to content

Commit

Permalink
3.7.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
pipermerriam committed Feb 27, 2017
1 parent deead20 commit c1980da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 84 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.7.2
-----

* support for windows named pipes.

3.7.1
-----

Expand Down
84 changes: 1 addition & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,10 @@
[![Join the chat at https://gitter.im/pipermerriam/web3.py](https://badges.gitter.im/pipermerriam/web3.py.svg)](https://gitter.im/pipermerriam/web3.py?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://travis-ci.org/pipermerriam/web3.py.png)](https://travis-ci.org/pipermerriam/web3.py)

[Documentation on ReadTheDocs](http://web3py.readthedocs.io/)


A python implementation of [web3.js](https://github.com/ethereum/web3.js)

* Python 2.7, 3.4, 3.5 support


## Installation

```sh
pip install web3
```


### Testing

For testing you can use the `TestRPCProvider`. This depends on
`eth-testrpc>=0.9.0` which must be eithe installed independently or with the
following installation command.

```sh
pip install web3[tester]
```

Then in your code:


```python
from web3 import Web3, TestRPCProvider

# Initialising a Web3 instance with an RPCProvider:
web3rpc = Web3(TestRPCProvider())

# or specifying host and port.
web3rpc = Web3(TestRPCProvider(host="127.0.0.1", port="8545"))
```

The `TestRPCProvider` uses an EVM backed by the `ethereum.tester` module from
the `pyethereum` package. This can be quite useful for testing your code which
uses `web3.py`.


### Setting defaults
```python
web3.eth.defaultAccount = <default from address>
web3.eth.defaultBlock = "latest"
# Can also be an integer or one of "latest", "pending", "earliest"
```

### Interacting with contracts


```python
>>> abi = json.joads("<abi-json-string>")
>>> ContractFactory = web3.eth.contract(abi, code="0x...")
>>> ContractFactory.deploy()
... '0x461e829a731d96539ec1f147232f1d52b475225ed343e5853ff6bf3b237c6e79'
>>> contract = web3.eth.contract(abi, address="0x...")
>>> contract.transact().someMethod()
... '0xfbb0f76aa6a6bb8d178bc2b54de8fc7ca778d704af47d135c188ca7b5d25f2e4'
>>> contract.call().return13()
... 13
>>> contract.estimateGas().someMethod()
... 23212
```

You can listen for events using the `on` and `pastEvents` functions on a
contract.

```python
def transfer_callback(log_entry):
... # do something with the log.

# create a filter and register a callback.
filter = MyContract.on("Transfer", {})
filter.watch(transfer_callback)

filter.stop_watching()
```


> The underlying asynchronous operations are managed by `gevent`.

### Timeouts, blocking and nonblocking requests

Web3.py does not currently support asynchronous calling patterns.
Read more in the [documentation on ReadTheDocs](http://web3py.readthedocs.io/)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

setup(
name='web3',
version='3.7.1',
version='3.7.2',
description="""Web3.py""",
long_description=readme,
author='Piper Merriam',
Expand Down

0 comments on commit c1980da

Please sign in to comment.