Zebra/zebra-rpc/src/config.rs

31 lines
894 B
Rust

//! User-configurable RPC settings.
use std::net::SocketAddr;
use serde::{Deserialize, Serialize};
/// RPC configuration section.
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields, default)]
pub struct Config {
/// IP address and port for the RPC server.
///
/// Note: The RPC server is disabled by default.
/// To enable the RPC server, set a listen address in the config:
/// ```toml
/// [rpc]
/// listen_addr = '127.0.0.1:8232'
/// ```
///
/// The recommended ports for the RPC server are:
/// - Mainnet: 127.0.0.1:8232
/// - Testnet: 127.0.0.1:18232
///
/// # Security
///
/// If you bind Zebra's RPC port to a public IP address,
/// anyone on the internet can send transactions via your node.
/// They can also query your node's state.
pub listen_addr: Option<SocketAddr>,
}