Matrix

Cuprate is an alternative Monero node implementation that independently validates consensus rules, providing a layer of security and redundancy for the network. It is focused on being fast, user-friendly, and backwards compatible with monerod.

This project is currently a work-in-progress; documentation will be changing/unfinished and the cuprated node itself is not yet production ready.

Feel free to join our Matrix channel or read our documentation to learn more.

Getting started

System requirements

Pre-built binaries

Building from source

Verifying

Running

Configuration

cuprated's configuration file is in the TOML format.

TODO

Config file

The following is the default configuration used by cuprated.

# `cuprated` configuration file.
#
# See also:
# - <https://user.cuprate.org/config.html>
# - <https://github.com/Cuprate/cuprate/tree/main/binaries/cuprated/Cuprated.toml>

network = "Mainnet"

[tracing.stdout]
level = "info"

[p2p.clear_net]
outbound_connections = 64
extra_outbound_connections = 8
max_inbound_connections = 128
gray_peers_percent = 0.7
p2p_port = 0
listen_on = "0.0.0.0"

[p2p.clear_net.address_book_config]
max_white_list_length = 1_000
max_gray_list_length = 5_000
peer_save_period = { secs = 90, nanos = 0 }

[p2p.block_downloader]
buffer_size = 50_000_000
in_progress_queue_size = 50_000_000
target_batch_size = 5_000_000
check_client_pool_interval = { secs = 30, nanos = 0 }

[storage]
reader_threads = "OnePerThread"

[storage.txpool]
sync_mode = "Async"
max_txpool_byte_size = 100_000_000

[storage.blockchain]
sync_mode = "Async"

Location

TODO

Command-line overrides

TODO

Config-relative paths

TODO

Config keys

The following section provide more details on configuration options.

Top level

Top-level general config options. These are defined without any sub-section.

KeyTypeDefaultValuesDescription
networkstring"Mainnet""Mainnet", "Testnet", "Stagenet"The network to run on.

[tracing.stdout]

Logging configuration.

KeyTypeDefaultValuesDescription
levelstring"info""error", "warn", "info", "debug", "trace"The minimum level for log events to be displayed.

[p2p.clear_net]

P2P configuration for clear-net.

KeyTypeDefaultValuesDescription
outbound_connectionsunsigned integer640 to MAXThe number of outbound connections to create and maintain.
extra_outbound_connectionsunsigned integer80 to MAXThe number of extra connections to create when under load from the rest of Cuprate, i.e. when syncing.
max_inbound_connectionsunsigned integer1280 to MAXThe maximum number of incoming to allow.
gray_peers_percentdecimal number0.70.0 to 1.0The percent of outbound connections that should be to nodes we have not connected to before.
p2p_portPort (unsigned integer)00 to 65535The port to accept connections on, if left 0 no connections will be accepted.
listen_onIPv4 address (string)"0.0.0.0"The IP address to listen to connections on.

[p2p.clear_net.address_book_config]

P2P configuration for the clear-net address book.

KeyTypeDefaultValuesDescription
max_white_list_lengthunsigned integer1_0000 to MAXThe size of the white peer list, which contains peers we have made a connection to before.
max_gray_list_lengthunsigned integer5_0000 to MAXThe size of the gray peer list, which contains peers we have not made a connection to before.
peer_save_period{ seconds, nanoseconds }{ secs = 90, nanos = 0 }0 to MAXThe amount of time between address book saves.

[p2p.block_downloader]

Block downloader configuration.

KeyTypeDefaultValuesDescription
buffer_sizeunsigned integer50_000_0000 to MAXThe size of the buffer of sequential blocks waiting to be verified and added to the chain in bytes.
in_progress_queue_sizeunsigned integer50_000_0000 to MAXThe size of the queue of blocks which are waiting for a parent block to be downloaded in bytes.
target_batch_sizeunsigned integer5_000_0000 to 100_000_000The target size of a batch of blocks in bytes.
check_client_pool_interval{ seconds, nanoseconds }{ secs = 30, nanos = 0 }0 to MAXThe amount of time between checking the pool of connected peers for free peers to download blocks.

[storage]

Storage configuration.

KeyTypeDefaultValuesDescription
reader_threadsstring"OnePerThread"TODOThe amount of database reader threads to spawn.

[storage.txpool]

Transaction pool configuration.

KeyTypeDefaultValuesDescription
sync_modestring"Async"TODOThe database sync mode for the transaction pool.
max_txpool_byte_sizeunsigned integer100_000_000TODOThe maximum size of all the transaction in the pool in bytes.

[storage.blockchain]

Blockchain configuration.

KeyTypeDefaultValuesDescription
sync_modestring"Async"TODOThe database sync mode for the blockchain.

Environment variables

TODO

File structure

Ports

P2P

ZMQ

RPC

Command line

Runtime input

CLI arguments

Deployment

Docker

systemd

Anonymity networks

SOCKS proxy

Tor

Instrumentation

Console logs

File logs

RPC

monerod & cuprated

JSON objects

Block

BlockHeader

Histogram

Chain

Connection

JSON-RPC 2.0

get_block_count

on_get_block_hash

get_block_template

submit_block

generateblocks

get_last_block_header

get_block_header_by_hash

get_block_header_by_height

get_block_headers_range

get_block

get_connections

get_info

hard_fork_info

set_bans

get_bans

banned

flush_txpool

get_output_histogram

get_version

get_coinbase_tx_sum

get_fee_estimate

get_alternate_chains

relay_tx

sync_info

get_txpool_backlog

get_output_distribution

get_miner_data

prune_blockchain

calc_pow

flush_cache

add_aux_pow

Binary endpoints

/get_blocks.bin

/get_blocks_by_height.bin

/get_hashes.bin

/get_o_indexes.bin

/get_outs.bin

/get_transaction_pool_hashes.bin

JSON endpoints

/get_height

/get_transactions

/get_alt_blocks_hashes

/is_key_image_spent

/send_raw_transaction

/save_bc

/get_peer_list

/set_log_level

/set_log_categories

/set_bootstrap_daemon

/get_transaction_pool

/get_transaction_pool_stats

/stop_daemon

/get_limit

/set_limit

/out_peers

/in_peers

/get_net_stats

/get_outs

/update

/pop_blocks

Unsupported

/start_mining

/stop_mining

/mining_status

/set_log_hash_rate

/get_info

/start_save_graph

/stop_save_graph

Appendix