[#CNode-2constructor-0f] = xref:CNode.adoc[CNode]::CNode :relfileprefix: ../ :mrdocs: Construct a peer connection with the given identity, socket, addresses and options. == Synopsis Declared in `<net.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- CNode( xref:NodeId-08.adoc[NodeId] id, std::shared_ptr<Sock> sock, xref:CAddress.adoc[CAddress] const& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, xref:CService.adoc[CService] const& addrBindIn, std::string const& addrNameIn, xref:ConnectionType.adoc[ConnectionType] conn_type_in, bool inbound_onion, uint64_t network_key, xref:CNodeOptions.adoc[CNodeOptions]&& node_opts = {}); ---- == Parameters [cols="1,4"] |=== | Name| Description | *id* | the unique identifier for this peer. | *sock* | the connected socket used to communicate with the peer. | *addrIn* | the address of the peer. | *nKeyedNetGroupIn* | the network group key used to bucket this peer. | *nLocalHostNonceIn* | the local nonce used to detect connections to ourselves. | *addrBindIn* | the bind address of our side of the connection. | *addrNameIn* | the human‐readable address or hostname of the peer. | *conn_type_in* | the type of this connection. | *inbound_onion* | whether this is an inbound onion (Tor) connection. | *network_key* | the network key used to prevent cross‐network fingerprinting. | *node_opts* | additional per‐connection options. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#