Class: MoneroDaemonRpc

MoneroDaemonRpc(config)

Implements a Monero daemon using monero-daemon-rpc.

Constructor

new MoneroDaemonRpc(config)

Constructs the daemon.
Parameters:
Name Type Description
config object defines the rpc configuration as a map
Properties
Name Type Description
uri string is the uri of the rpc endpoint
protocol string is the protocol of the rpc endpoint
host string is the host of the rpc endpoint
port int is the port of the rpc endpoint
user string is a username to authenticate with the rpc endpoint
pass string is a password to authenticate with the rpc endpoint
maxRequestsPerSecond string is the maximum requests per second to allow
pollInterval int is the poll interval to check for updates in ms (default 5000)
Source:

Methods

(static) _convertRpcSyncInfo(rpcSyncInfo) → {MoneroDaemonSyncInfo}

Initializes sync info from RPC sync info.
Parameters:
Name Type Description
rpcSyncInfo is the rpc map to initialize the sync info from
Source:
Returns:
is sync info initialized from the map
Type
MoneroDaemonSyncInfo

(static) _convertRpcTx(rpcTx, tx)

Transfers RPC tx fields to a given MoneroTx without overwriting previous values. TODO: switch from safe set
Parameters:
Name Type Description
rpcTx is the RPC map containing transaction fields
tx is the MoneroTx to populate with values (optional)
Source:
Returns:
tx is the same tx that was passed in or a new one if none given

(static) _prefixedHexToBI(hex)

Converts a '0x' prefixed hexidecimal string to a BigInteger.
Parameters:
Name Type Description
hex is the '0x' prefixed hexidecimal string to convert
Source:
Returns:
BigInteger is the hexicedimal converted to decimal

(async) _getBlockHeaderByHeightCached(height, maxHeight)

Retrieves a header by height from the cache or fetches and caches a header range if not already in the cache.
Parameters:
Name Type Description
height number is the height of the header to retrieve from the cache
maxHeight number is the maximum height of headers to cache
Source:

(async) _getMaxBlocks(startHeight, maxHeight, maxReqSize) → {Array.<MoneroBlock>}

Get a contiguous chunk of blocks starting from a given height up to a maximum height or amount of block data fetched from the blockchain, whichever comes first.
Parameters:
Name Type Description
startHeight number is the start height to retrieve blocks (default 0)
maxHeight number is the maximum end height to retrieve blocks (default blockchain height)
maxReqSize number is the maximum amount of block data to fetch from the blockchain in bytes (default 3,000,000 bytes)
Source:
Returns:
are the resulting chunk of blocks
Type
Array.<MoneroBlock>