@@ -13,28 +13,28 @@ greater detail.
1313Configuration
1414~~~~~~~~~~~~~
1515
16- After installing web3.py (via ``pip install web3 ``), you'll need to specify
17- async or sync web3, the provider, and any middleware you want to use
18- beyond the defaults.
16+ After installing web3.py (via ``pip install web3 ``), you'll need to configure
17+ a provider endpoint and any middleware you want to use beyond the defaults.
1918
2019
2120Providers
2221---------
2322
24- Providers are how web3.py connects to the blockchain. The library comes with the
23+ :doc: ` providers ` are how web3.py connects to a blockchain. The library comes with the
2524following built-in providers:
2625
27- - `` Web3. IPCProvider` ` for connecting to ipc socket based JSON-RPC servers.
28- - `` Web3. HTTPProvider` ` for connecting to http and https based JSON-RPC servers.
29- - `` Web3. WebsocketProvider` ` for connecting to ws and wss websocket based JSON-RPC servers.
30- - `` AsyncWeb3. AsyncHTTPProvider` ` for connecting to http and https based JSON-RPC servers.
26+ - :class: ` ~web3.providers.ipc. IPCProvider ` for connecting to ipc socket based JSON-RPC servers.
27+ - :class: ` ~web3.providers.rpc. HTTPProvider ` for connecting to http and https based JSON-RPC servers.
28+ - :class: ` ~web3.providers.websocket. WebsocketProvider ` for connecting to ws and wss websocket based JSON-RPC servers.
29+ - :class: ` ~web3.providers.async_rpc. AsyncHTTPProvider ` for connecting to http and https based JSON-RPC servers.
3130
3231
33- Synchronous Provider Examples:
34- ------------------------------
32+ Examples
33+ ^^^^^^^^
34+
3535.. code-block :: python
3636
37- >> > from web3 import Web3
37+ >> > from web3 import Web3, AsyncWeb3
3838
3939 # IPCProvider:
4040 >> > w3 = Web3(Web3.IPCProvider(' ./path/to/geth.ipc' ))
@@ -48,33 +48,19 @@ Synchronous Provider Examples:
4848 >> > w3.is_connected()
4949 True
5050
51-
52- Asynchronous Provider Example:
53- ------------------------------
54-
55- .. note ::
56-
57- The AsyncHTTPProvider is still under active development. Not all JSON-RPC
58- methods and middleware are available yet. The list of available methods and
59- middleware can be seen on the :class: `~web3.providers.async_rpc.AsyncHTTPProvider ` docs
60-
61- .. code-block :: python
62-
63- >> > from web3 import AsyncWeb3
64-
51+ # AsyncHTTPProvider:
6552 >> > w3 = AsyncWeb3(AsyncWeb3.AsyncHTTPProvider(' http://127.0.0.1:8545' ))
6653
6754 >> > await w3.is_connected()
6855 True
6956
70- For more information, (e.g., connecting to remote nodes, provider auto-detection,
71- using a test provider) see the :ref: `Providers <providers >` documentation.
57+ For more context, see the :doc: `providers ` documentation.
7258
7359
7460Middleware
7561----------
7662
77- Your web3.py instance may be further configured via middleware.
63+ Your web3.py instance may be further configured via :doc: ` middleware ` .
7864
7965web3.py middleware is described using an onion metaphor, where each layer of
8066middleware may affect both the incoming request and outgoing response from your
@@ -88,8 +74,8 @@ Several middleware are :ref:`included by default <default_middleware>`. You may
8874:meth: `clear <Web3.middleware_onion.clear> `) any of these middleware.
8975
9076
91- Your Keys
92- ~~~~~~~~~
77+ Accounts and Private Keys
78+ ~~~~~~~~~~~~~~~~~~~~~~~~~
9379
9480Private keys are required to approve any transaction made on your behalf. The manner in
9581which your key is secured will determine how you create and send transactions in web3.py.
@@ -103,6 +89,7 @@ In this case, you'll need to have your private key available locally for signing
10389transactions.
10490
10591Full documentation on the distinction between keys can be found :ref: `here <eth-account >`.
92+ The separate guide to :doc: `transactions ` may also help clarify how to manage keys.
10693
10794
10895Base API
@@ -148,8 +135,8 @@ web3.eth API
148135~~~~~~~~~~~~
149136
150137The most commonly used APIs for interacting with Ethereum can be found under the
151- ``web3.eth `` namespace. As a reminder, the :ref: ` Examples < examples > ` page will
152- demonstrate how to use several of these methods.
138+ ``web3.eth `` namespace. As a reminder, the :doc: ` examples ` page will demonstrate
139+ how to use several of these methods.
153140
154141
155142Fetching Data
@@ -177,13 +164,14 @@ API
177164- :meth: `web3.eth.get_uncle_count() <web3.eth.Eth.get_uncle_count> `
178165
179166
180- Making Transactions
181- -------------------
167+ Sending Transactions
168+ --------------------
182169
183170The most common use cases will be satisfied with
184171:meth: `send_transaction <web3.eth.Eth.send_transaction> ` or the combination of
185172:meth: `sign_transaction <web3.eth.Eth.sign_transaction> ` and
186- :meth: `send_raw_transaction <web3.eth.Eth.send_raw_transaction> `.
173+ :meth: `send_raw_transaction <web3.eth.Eth.send_raw_transaction> `. For more context,
174+ see the full guide to :doc: `transactions `.
187175
188176.. note ::
189177
@@ -213,13 +201,12 @@ API
213201Contracts
214202---------
215203
216- The two most common use cases involving smart contracts are deploying and executing
217- functions on a deployed contract.
204+ web3.py can help you deploy, read from, or execute functions on a deployed contract.
218205
219206Deployment requires that the contract already be compiled, with its bytecode and ABI
220207available. This compilation step can be done within
221208`Remix <http://remix.ethereum.org/ >`_ or one of the many contract development
222- frameworks, such as `Brownie <https://eth-brownie.readthedocs .io/ >`_.
209+ frameworks, such as `Ape <https://docs.apeworx .io/ape/stable/index.html / >`_.
223210
224211Once the contract object is instantiated, calling ``transact `` on the
225212:meth: `constructor <web3.contract.Contract.constructor> ` method will deploy an
@@ -233,8 +220,8 @@ instance of the contract:
233220 >> > tx_receipt.contractAddress
234221 ' 0x8a22225eD7eD460D7ee3842bce2402B9deaD23D3'
235222
236- Once loaded into a Contract object, the functions of a deployed contract are available
237- on the ``functions `` namespace:
223+ Once a deployed contract is loaded into a Contract object, the functions of that
224+ contract are available on the ``functions `` namespace:
238225
239226.. code-block :: python
240227
@@ -295,7 +282,7 @@ a contract, you can leverage web3.py filters.
295282 >> > new_filter.get_new_entries()
296283
297284 More complex patterns for creating filters and polling for logs can be found in the
298- :ref: ` Filtering < filtering > ` documentation.
285+ :doc: ` filters ` documentation.
299286
300287
301288API
0 commit comments