Skip to content

Commit c852b8c

Browse files
committed
improve Providers context docs; closes #1609
1 parent 79aba6d commit c852b8c

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Contents
1515
quickstart
1616
overview
1717
node
18+
providers
19+
examples
20+
troubleshooting
1821
v5_migration
1922
v4_migration
2023
filters
2124
contracts
22-
providers
2325
ens_overview
2426
middleware
25-
examples
26-
troubleshooting
2727
web3.main
2828
web3.eth
2929
web3.eth.account

docs/quickstart.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ Using Web3
3535

3636
To use the web3 library you will need to initialize the
3737
:class:`~web3.Web3` class and connect to an Ethereum node.
38-
The quickest way to do so for free is by setting up an account on
39-
`Infura <https://infura.io/>`_. On Infura, create a project and copy
40-
the Project ID. Then set the environment variable ``WEB3_INFURA_PROJECT_ID``.
38+
There are several ways to configure this connection; the
39+
full details can be found in the :ref:`Providers<providers>`
40+
documentation.
41+
42+
The quickest way to connect to a mainnet node for free is by setting up an
43+
account on `Infura <https://infura.io/>`_. On the Infura dashboard, create
44+
a project, copy the Project ID, then set the environment variable
45+
``WEB3_INFURA_PROJECT_ID`` before running your script or application.
4146

4247
.. code-block:: shell
4348

docs/troubleshooting.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ Often, the best way to guarantee a correct environment is with ``virtualenv``, l
3838

3939
.. _use_metamask_accounts:
4040

41+
Why isn't my web3 instance connecting to the network?
42+
--------------------------------------------------------
43+
You can check that your instance is connected via the ``isConnected`` method:
44+
45+
.. code-block:: python
46+
47+
>>> w3.isConnected()
48+
False
49+
50+
There's a variety of explanations for why you may see ``False`` here. If you're
51+
running a local node, such as Geth, double-check that you've indeed started the
52+
binary and that you've started it from the intended directory - particularly if
53+
you've specified a relative path to its ipc file.
54+
55+
If that does not address your issue, it's probable that you still have a
56+
Provider configuration issue. There are several options for configuring
57+
a Provider, detailed :ref:`here<providers>`.
58+
4159
How do I use my MetaMask accounts from Web3.py?
4260
--------------------------------------------------------
4361
Often you don't need to do this, just make a new account in Web3.py,

newsfragments/1609.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve documentation that introduces and troubleshoots Providers.

0 commit comments

Comments
 (0)