Constructor

P2pandaNodenew

Declaration [src]

P2pandaNode*
p2panda_node_new (
  P2pandaPrivateKey* private_key,
  const char* database_url,
  gboolean default_migrations,
  P2pandaNetworkId* network_id,
  GUri* relay_url,
  P2pandaNodeId* bootstrap_node_id,
  P2pandaMdnsDiscoveryMode mdns_mode
)

Description [src]

Creates a new node with the given options.

Parameters

private_key

Type: P2pandaPrivateKey

No description available.

The data is owned by the caller of the function.
database_url

Type: const char*

A sqlite address.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
default_migrations

Type: gboolean

Whether to apply default migrations.

network_id

Type: P2pandaNetworkId

The network id of the network to join.

The argument can be NULL.
The data is owned by the caller of the function.
relay_url

Type: GUri

The url of a iroh Relay Server.

The argument can be NULL.
The data is owned by the caller of the function.
bootstrap_node_id

Type: P2pandaNodeId

The address of the bootstrap node.

The argument can be NULL.
The data is owned by the caller of the function.
mdns_mode

Type: P2pandaMdnsDiscoveryMode

The MDNS decovery mode.

Return value

Type: P2pandaNode

A new P2pandaNode.

The caller of the function takes ownership of the data, and is responsible for freeing it.