Convenience functions

dogecoin-python - Easy-to-use Dogecoin API client

connect_to_local(filename=None)

Connect to default dogecoin instance owned by this user, on this machine.

Returns a :class:~dogecoinrpc.connection.DogecoinConnection object.

Parameters:
  • - (filename) – Path to a configuration file in a non-standard location (optional)

Source code in dogecoinrpc/__init__.py
def connect_to_local(filename=None):
    """
    Connect to default dogecoin instance owned by this user, on this machine.

    Returns a :class:`~dogecoinrpc.connection.DogecoinConnection` object.

    Arguments:

        - `filename`: Path to a configuration file in a non-standard location (optional)
    """
    cfg = read_default_config(filename) or {}
    port = int(cfg.get("rpcport", "18332" if cfg.get("testnet") else "22555"))
    rpcuser = cfg.get("rpcuser", "")
    rpcpassword = cfg.get("rpcpassword", "")

    return DogecoinConnection(rpcuser, rpcpassword, "localhost", port)

connect_to_remote(user, password, host='localhost', port=22555, use_https=False)

Connect to remote or alternative local dogecoin client instance.

Returns a :class:~dogecoinrpc.connection.DogecoinConnection object.

Source code in dogecoinrpc/__init__.py
def connect_to_remote(user, password, host="localhost", port=22555, use_https=False):
    """
    Connect to remote or alternative local dogecoin client instance.

    Returns a :class:`~dogecoinrpc.connection.DogecoinConnection` object.
    """
    return DogecoinConnection(user, password, host, port, use_https)