The Daemon and its Network¶
| Class | What it is | From |
|---|---|---|
MoneroNetworkType | mainnet, testnet or stagenet (Glossary) | the network of a daemon, of a wallet, of an address |
MoneroVersion | the version of a daemon, or of a wallet server | get_version |
MoneroDaemonInfo | the state of the daemon: height, network, connections, size of the chain | get_info |
MoneroDaemonSyncInfo, MoneroConnectionSpan | how far the daemon is in syncing the chain, and the blocks that it is downloading from its peers | get_sync_info |
MoneroPeer, MoneroBan | a peer of the daemon, and a peer that it bans | get_peers, get_peer_bans, set_peer_ban |
MoneroDaemonNetworkStats | the traffic of the daemon | get_network_stats |
MoneroDaemonUpdateCheckResult, MoneroDaemonUpdateDownloadResult | a new version of monero, and its download | check_for_update, download_update |
MoneroRpcPaymentInfo | the credits of a daemon that is paid for its RPC: the base of the results that report them |
MoneroDaemonListener is told of the new blocks: Listening to a Wallet.
MoneroNetworkType ¶
Bases: IntEnum
Enumerates a Monero network type.
MAINNET = 0 class-attribute instance-attribute ¶
0 indicates Mainnet network.
STAGENET = 2 class-attribute instance-attribute ¶
2 indicates Stagenet network.
TESTNET = 1 class-attribute instance-attribute ¶
1 indicates Testnet network.
MoneroVersion ¶
Bases: SerializableStruct
Models a Monero version.
is_release instance-attribute ¶
States if the monero software version corresponds to an official tagged release (True), or not (False).
number instance-attribute ¶
Number of the monero software version.
__init__() ¶
Initialize a new Monero version.
deserialize(json) staticmethod ¶
Deserialize a MoneroVersion from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroVersion in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroVersion | deserialized instance. |
MoneroDaemonInfo ¶
Bases: MoneroRpcPaymentInfo
Models information got from a Monero daemon.
adjusted_timestamp instance-attribute ¶
Current time approximated from chain data, as Unix time.
block_size_limit instance-attribute ¶
Backward compatibility, same as block_weight_limit, use that instead.
block_size_median instance-attribute ¶
Backward compatibility, same as block_weight_median, use that instead.
block_weight_limit instance-attribute ¶
Maximum allowed adjusted block size based on latest 100000 blocks.
block_weight_median instance-attribute ¶
Median adjusted block size of latest 100000 blocks.
bootstrap_daemon_address instance-attribute ¶
Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it.
cumulative_difficulty_high instance-attribute ¶
Most-significant 64 bits of the 128-bit cumulative difficulty.
cumulative_difficulty_low instance-attribute ¶
Least-significant 64 bits of the 128-bit cumulative difficulty.
database_size instance-attribute ¶
The size of the blockchain database, in bytes.
difficulty_high instance-attribute ¶
The most-significant 64 bits of the 128-bit network difficulty.
difficulty_low instance-attribute ¶
The least-significant 64 bits of the 128-bit network difficulty.
free_space instance-attribute ¶
Available disk space on the node.
height instance-attribute ¶
Current length of longest chain known to daemon.
height_without_bootstrap instance-attribute ¶
Current length of the local chain of the daemon.
is_busy_syncing instance-attribute ¶
States if new blocks are being added (True) or not (False).
is_offline instance-attribute ¶
States if the node is offline (True) or online (False).
is_regtest instance-attribute ¶
States if the node is running in regtest mode (True) or not (False).
is_restricted instance-attribute ¶
Indicates that the node RPC interface is restricted (True) or not (False).
is_synchronized instance-attribute ¶
States if the node is synchronized (True) or not (False).
network_type instance-attribute ¶
Network type (MAINNET, TESTNET, or STAGENET).
num_alt_blocks instance-attribute ¶
Number of alternative blocks to main chain.
num_incoming_connections instance-attribute ¶
Number of peers connected to and pulling from your node.
num_offline_peers instance-attribute ¶
Number of peers that are marked as not reachable on the network.
num_online_peers instance-attribute ¶
Number of peers that are marked as reacheble on the network.
num_outgoing_connections instance-attribute ¶
Number of peers that you are connected to and getting information from.
num_rpc_connections instance-attribute ¶
Number of RPC client connected to the daemon (Including this RPC request).
num_txs instance-attribute ¶
Total number of non-coinbase transactions in the chain.
num_txs_pool instance-attribute ¶
Number of transactions that have been broadcast but not included in a block.
start_timestamp instance-attribute ¶
Start time of the daemon, as UNIX time.
target instance-attribute ¶
Current target for next proof of work.
target_height instance-attribute ¶
The height of the next block in the chain.
update_available instance-attribute ¶
States if a newer Monero software version is available.
version instance-attribute ¶
The version of the Monero software the node is running.
was_bootstrap_ever_used instance-attribute ¶
States if a bootstrap node has ever been used since the daemon started.
__init__() ¶
Initialize a Monero daemon info.
deserialize(json) staticmethod ¶
Deserialize a MoneroDaemonInfo from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroDaemonInfo in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroDaemonInfo | deserialized instance. |
MoneroDaemonSyncInfo ¶
Bases: MoneroRpcPaymentInfo
Models daemon synchronization information.
height instance-attribute ¶
Daemon blockchain height.
next_needed_pruning_seed instance-attribute ¶
The next pruning seed needed for pruned sync.
overview instance-attribute ¶
Overview of current block queue where each character in the string represents a block set in the queue. '.' = requested but not received, 'o' = set received, 'm' = received set that matches the next blocks needed
peers instance-attribute ¶
List of peers connected to the node
spans instance-attribute ¶
Currently connected peers to download blocks from.
target_height instance-attribute ¶
Target height the node is syncing from (will be 0 if node is fully synced).
__init__() ¶
Initialize a Monero daemon sync info.
deserialize(json) staticmethod ¶
Deserialize a MoneroDaemonSyncInfo from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroDaemonSyncInfo in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroDaemonSyncInfo | deserialized instance. |
MoneroConnectionSpan ¶
Bases: SerializableStruct
Monero daemon connection span.
connection_id instance-attribute ¶
Id of the P2P connection this span of blocks was (or is being) downloaded over.
num_blocks instance-attribute ¶
Number of blocks in this span.
rate instance-attribute ¶
Download rate for this span, in bytes per second.
remote_address instance-attribute ¶
Peer address the node is downloading (or has downloaded) than span from.
size instance-attribute ¶
Total number of bytes in that span's blocks (including txes).
speed instance-attribute ¶
Relative speed of this connection as a percentage (0-100) of the fastest peer currently downloading blocks.
start_height instance-attribute ¶
Block height of the first block in that span.
__init__() ¶
Initialize a Monero connection span.
deserialize(json) staticmethod ¶
Deserialize a MoneroConnectionSpan from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroConnectionSpan in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroConnectionSpan | deserialized instance. |
MoneroPeer ¶
Bases: SerializableStruct
Models a peer to the daemon.
address instance-attribute ¶
The peer's address, actually IPv4 & port.
avg_download instance-attribute ¶
Average bytes of data downloaded by node.
avg_upload instance-attribute ¶
Average bytes of data uploaded by node.
connection_type instance-attribute ¶
Type of peer connection.
current_download instance-attribute ¶
Current bytes downloaded by node.
current_upload instance-attribute ¶
Current bytes uploaded by node.
hash instance-attribute ¶
Peer hash.
height instance-attribute ¶
The peer blockchain height.
host instance-attribute ¶
The peer host.
id instance-attribute ¶
The node's ID on the network.
is_incoming instance-attribute ¶
Indicates if peer is pulling blocks from node.
is_local_host instance-attribute ¶
Indicates if peer is localhost.
is_local_ip instance-attribute ¶
Indicates if peer has a local ip address.
is_online instance-attribute ¶
Indicates if the peer is online.
last_seen_timestamp instance-attribute ¶
Last activity timestamp of this peer.
live_time instance-attribute ¶
Length of time the peer has been online.
num_receives instance-attribute ¶
Total number of messages received from this peer.
num_sends instance-attribute ¶
Total number of messages sent to this peer.
num_support_flags instance-attribute ¶
Support flags number.
port instance-attribute ¶
The port that the node is using to connect to the network.
pruning_seed instance-attribute ¶
Block height at which pruning began.
receive_idle_time instance-attribute ¶
Seconds since last data was received from this peer.
rpc_credits_per_hash instance-attribute ¶
Credits for every hash calculated by client.
rpc_port instance-attribute ¶
Peer RPC port.
send_idle_time instance-attribute ¶
Seconds since the last data sent to this peer.
state instance-attribute ¶
Peer state.
__init__() ¶
Initialize a new Monero peer.
deserialize(json) staticmethod ¶
Deserialize a MoneroPeer from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroPeer in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroPeer | deserialized instance. |
MoneroBan ¶
Bases: SerializableStruct
Model a Monero banhammer.
MoneroDaemonNetworkStats ¶
Bases: MoneroRpcPaymentInfo
Models daemon network (bandwidth) statistics since the daemon started.
start_time instance-attribute ¶
Unix timestamp when the statistics window started.
total_bytes_in instance-attribute ¶
Total number of bytes received.
total_bytes_out instance-attribute ¶
Total number of bytes sent.
total_packets_in instance-attribute ¶
Total number of packets received.
total_packets_out instance-attribute ¶
Total number of packets sent.
__init__() ¶
Initialize a Monero daemon network stats.
deserialize(json) staticmethod ¶
Deserialize a MoneroDaemonNetworkStats from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroDaemonNetworkStats in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroDaemonNetworkStats | deserialized instance. |
MoneroDaemonUpdateCheckResult ¶
Bases: SerializableStruct
Models the result of checking for a daemon update.
auto_uri instance-attribute ¶
URL automatically generated by the daemon to download the update.
hash instance-attribute ¶
Integrity check hash.
is_update_available instance-attribute ¶
Indicates if an update is available to download.
user_uri instance-attribute ¶
Alternative user URI.
version instance-attribute ¶
Version available for download.
__init__() ¶
Initialize a Monero update check result.
deserialize(json) staticmethod ¶
Deserialize a MoneroDaemonUpdateCheckResult from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroDaemonUpdateCheckResult in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroDaemonUpdateCheckResult | deserialized instance. |
MoneroDaemonUpdateDownloadResult ¶
Bases: MoneroDaemonUpdateCheckResult
Models the result of downloading a daemon update.
download_path instance-attribute ¶
Path to download the update.
__init__() ¶
Initialize a Monero update download result.
deserialize(json) staticmethod ¶
Deserialize a MoneroDaemonUpdateDownloadResult from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroDaemonUpdateDownloadResult in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroDaemonUpdateDownloadResult | deserialized instance. |
MoneroRpcPaymentInfo ¶
Bases: SerializableStruct
Models a Monero RPC payment information.
credits instance-attribute ¶
If payment for RPC is enabled, the number of credits available to the requesting client. Otherwise, 0.
top_block_hash instance-attribute ¶
If payment for RPC is enabled, the hash of the highest block in the chain. Otherwise, None.
deserialize(json) staticmethod ¶
Deserialize a MoneroRpcPaymentInfo from a JSON string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json | str | MoneroRpcPaymentInfo in JSON format. | required |
Returns:
| Type | Description |
|---|---|
MoneroRpcPaymentInfo | deserialized instance. |
MoneroDaemonListener ¶
Receives notifications as a daemon is updated.
last_header instance-attribute ¶
Last block header added to the chain.
__init__() ¶
Initialize a Monero daemon listener.
on_block_header(header) ¶
Called when a new block is added to the chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
header | MoneroBlockHeader | is the header of the block added to the chain. | required |