mirror of
https://github.com/FlipsideCrypto/web3.py.git
synced 2026-02-06 10:56:47 +00:00
brief docs on contract events
This commit is contained in:
parent
18eedaaaf6
commit
83448036c8
25
README.md
25
README.md
@ -99,17 +99,28 @@ web3.config.defaultBlock = "latest"
|
||||
... 23212
|
||||
```
|
||||
|
||||
### Timeouts, blocking and nonblocking requests
|
||||
|
||||
|
||||
All function and property requests block until a respose is received. Asynchronous function calling has not yet been implemented.
|
||||
You can listen for events using the `on` and `pastEvents` functions on a
|
||||
contract.
|
||||
|
||||
```python
|
||||
# Blocks indefinitely
|
||||
>>> web3.eth.getBalance("0xaddress", timeout=None)
|
||||
23423234
|
||||
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.
|
||||
|
||||
|
||||
### `web3`
|
||||
|
||||
#### web3.db.*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user