Update docs on default backend shortcut

pull/81/head
Michał Sałaban 3 years ago
parent a30ff4ddc9
commit b1959398bf

@ -1,8 +1,9 @@
Backends
========
Backends are the protocols and methods used to communicate with the Monero daemon and interact with
the wallet. As of the time of this writing, the only backends available in this library are:
The module comes with possibility of replacing the underlying backend. Backends are the protocols
and methods used to communicate with the Monero daemon or wallet. As of the time of this writing,
the module offers the following options:
* ``jsonrpc`` for the HTTP based RPC server,
* ``offline`` for running the wallet without Internet connection and even without the wallet file.
@ -18,6 +19,14 @@ The Python `requests`_ library is used in order to facilitate HTTP requests to t
interface. It makes POST requests and passes proper headers, parameters, and payload data as per
the official `Wallet RPC`_ documentation.
Also, ``jsonrpc`` backend is the default choice and both ``Wallet`` and ``Daemon`` classes
can be invoked in a simple form with no ``backend`` argument given. They will assume connection to
the default *mainnet* port on *localhost*, like below:
.. code-block:: python
In [1]: wallet = Wallet() # is equivalent to: wallet = Wallet(JSONRPCWallet(host='localhost', port=18081)
.. _`requests`: http://docs.python-requests.org/
.. _`Wallet RPC`: https://getmonero.org/resources/developer-guides/wallet-rpc.html

@ -1,8 +1,9 @@
Interacting with daemon
=======================
The module offers an interface to interact with Monero daemon. For the time being, like with
wallet, the only available method to connnect to a daemon is by JSON RPC commands. The initializer
The module offers an interface to interact with Monero daemon. For the time being, the only
available method to connnect to a daemon is by JSON RPC commands but the module allows for
providing a :doc:`custom backend <backends>`. The initializer
accepts keywords including, but not limited to, ``host``, ``port``, ``user``, and ``password``.
.. code-block:: python

@ -1,14 +1,14 @@
Using wallet and accounts
=========================
Since Monero 'Helium Hydra' (0.11.x) the wallet handles accounts and deterministically
generated addresses, known as *subaddresses*.
The Wallet class provides an abstraction layer to retrieve wallet information, manage accounts and
subaddresses, and of course send transfers.
The wallet
----------
The following example shows how to create and retrieve wallet's accounts and
addresses:
addresses via the default JSON RPC backend:
.. code-block:: python

@ -8,7 +8,8 @@ class Daemon(object):
Provides interface to a daemon instance.
:param backend: a daemon backend
:param \\**kwargs: arguments to initialize a JSONRPCDaemon instance if no backend is given
:param \\**kwargs: arguments to initialize a :class:`JSONRPCDaemon <monero.backends.jsonrpc.JSONRPCDaemon>`
instance if no backend is given
"""
def __init__(self, backend=None, **kwargs):
if backend and len(kwargs):

@ -26,7 +26,8 @@ class Wallet(object):
The wallet exposes a number of methods that operate on the default account (of index 0).
:param backend: a wallet backend
:param \\**kwargs: arguments to initialize a JSONRPCWallet instance if no backend is given
:param \\**kwargs: arguments to initialize a :class:`JSONRPCWallet <monero.backends.jsonrpc.JSONRPCWallet>`
instance if no backend is given
"""
accounts = None

Loading…
Cancel
Save