Skip to contents

Manages the node's peer connections. Can add a node to the connection queue, remove an existing connection, or attempt a one‑time connection.

Usage

mc_add_node(conn, node, command = c("add", "remove", "onetry"))

Arguments

conn

A connection object created by mc_connect.

node

Character string. The IP address and port of the peer node, e.g., "127.0.0.1:8571".

command

Character string. The action to perform:

  • "add" – add the node to the connection queue (will attempt to connect and stay connected).

  • "remove" – disconnect from the node if currently connected.

  • "onetry" – attempt a single connection; do not keep retrying.

Value

Invisibly returns the RPC result (typically NULL) on success; throws an error if the command fails.

Examples

if (FALSE) { # \dontrun{
# Add a peer
mc_add_node(conn, "192.168.1.10:8571", command = "add")

# Remove a peer
mc_add_node(conn, "192.168.1.10:8571", command = "remove")
} # }