2016-12-28 17:50:45 +00:00
|
|
|
Providers
|
|
|
|
|
========
|
|
|
|
|
|
|
|
|
|
.. py:module:: web3.providers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Providers are in control of the actual interactions with the blockchain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. py:currentmodule:: web3.providers.rpc
|
|
|
|
|
|
|
|
|
|
|
2017-01-11 01:11:32 +00:00
|
|
|
HTTPProvider
|
|
|
|
|
------------
|
2016-12-28 17:50:45 +00:00
|
|
|
|
2017-01-11 01:11:32 +00:00
|
|
|
.. py:class:: RPCProvider(endpoint_uri[, request_kwargs])
|
2016-12-28 17:50:45 +00:00
|
|
|
|
2017-01-11 01:11:32 +00:00
|
|
|
This provider handles interactions with an HTTP or HTTPS based JSON-RPC server.
|
2016-12-28 17:50:45 +00:00
|
|
|
|
2017-01-11 01:11:32 +00:00
|
|
|
* ``endpoint_uri`` should be the full URI to the RPC endpoint such as
|
|
|
|
|
``'https://localhost:8545'``. For RPC servers behind HTTP connections
|
|
|
|
|
running on port 80 and HTTPS connections running on port 443 the port can
|
|
|
|
|
be omitted from the URI.
|
|
|
|
|
* ``request_kwargs`` this should be a dictionary of keyword arguments which
|
|
|
|
|
will be passed onto the http/https request.
|
2016-12-28 17:50:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
IPCProvider
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
.. py:class:: IPCProvider(ipc_path=None, testnet=False):
|
|
|
|
|
|
|
|
|
|
This provider handles interaction with an IPC Socket based JSON-RPC
|
|
|
|
|
server.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. py:currentmodule:: web3.providers.tester
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EthereumTesterProvider
|
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
|
|
.. py:class:: EthereumTesterProvider():
|
|
|
|
|
|
|
|
|
|
This provider can be used for testing. It uses an ephemeral blockchain
|
|
|
|
|
backed by the ``ethereum.tester`` module.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TestRPCProvider
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
.. py:class:: TestRPCProvider():
|
|
|
|
|
|
|
|
|
|
This provider can be used for testing. It uses an ephemeral blockchain
|
|
|
|
|
backed by the ``ethereum.tester`` module. This provider will be slower
|
|
|
|
|
than the ``EthereumTesterProvider`` since it uses an HTTP server for RPC
|
|
|
|
|
interactions with.
|