Overview
TheSettings struct contains all configuration parameters needed to initialize and run a TAPLE node. Settings are divided into network-related and node-specific categories.
Settings Struct
The main configuration structure that groups all settings.Fields
P2P network configuration parameters. See NetworkSettings below.
General node configuration parameters. See NodeSettings below.
Default Implementation
Settings instance with default values for all fields.
NetworkSettings
P2P network configuration parameters of a TAPLE node.Fields
List of Multiaddr to listen on. See ListenAddr for address format.
List of bootstrap nodes to connect to. Each entry should be in the format
/ip4/127.0.0.1/tcp/40040/p2p/12D3KooW...List of external addresses to advertise to other nodes. Useful when behind NAT or firewalls.
Default Values
Usage Example
NodeSettings
General settings of a TAPLE node.Fields
The cryptographic algorithm to use for key derivation. Available options:
KeyDerivator::Ed25519- Edwards-curve Digital Signature AlgorithmKeyDerivator::Secp256k1- ECDSA using secp256k1 curve
The secret key to be used by the node in hexadecimal format. Must match the specified
key_derivator algorithm.The hash algorithm to use for generating event and subject identifiers. Available options:
DigestDerivator::Blake3_256- BLAKE3 with 256-bit outputDigestDerivator::Blake3_512- BLAKE3 with 512-bit outputDigestDerivator::SHA2_256- SHA-2 with 256-bit outputDigestDerivator::SHA2_512- SHA-2 with 512-bit outputDigestDerivator::SHA3_256- SHA-3 with 256-bit outputDigestDerivator::SHA3_512- SHA-3 with 512-bit output
Percentage of network nodes receiving protocol messages in one iteration. Value must be between 0.0 and 1.0.
0.25means 25% of known nodes will receive messages1.0means all nodes will receive messages (full broadcast)
Timeout in milliseconds to be used between protocol iterations.
Automatic voting behavior:
0- Normal voting (manual approval required)1- Always accept votes automatically2- Always reject votes automatically
Directory path where smart contracts are stored. Only available when the
evaluation feature is enabled.Default Values
Usage Example
ListenAddr
Represents a valid listening address for TAPLE. Internally constituted as a MultiAddr.Variants
Represents in-memory addressing for testing purposes.
Represents an IPv4 address.
Represents an IPv6 address.
Default
Methods
get_port
Returns the port number of the listening address.increment_port
Increments the port by the specified offset.The value to add to the current port.
to_string
Converts the listening address to MultiAddr format string.The address in MultiAddr format (e.g.,
/ip4/0.0.0.0/tcp/40040).Usage Examples
String Conversion
You can create aListenAddr from a string in MultiAddr format:
VotationType
Enum representing automatic voting behavior.Variants
Manual voting required for each request.
Automatically accept all voting requests.
Automatically reject all voting requests.
Conversion from u8
Complete Configuration Example
Here’s a complete example of configuring a TAPLE node:Configuration from File
Settings can be loaded from configuration files using theconfig crate:
config.toml:
Source Reference
For more details, see the source code atcore/src/commons/settings/mod.rs:10-297.