Skip to main content

Module config

Module config 

Source
Expand description

Configuration types for the TxGate signing service.

This module provides the configuration structures for defining the behavior of the TxGate daemon, including server settings, key storage configuration, and policy rules.

§Configuration File

Configuration is stored in TOML format at ~/.txgate/config.toml.

§Examples

use txgate_core::config::{Config, ServerConfig, KeysConfig};

// Create a default configuration
let config = Config::default();
assert_eq!(config.server.socket_path, "~/.txgate/txgate.sock");
assert_eq!(config.server.timeout_secs, 30);

// Generate default TOML
let toml_str = Config::default_toml();
println!("{}", toml_str);

§Default TOML Output

[server]
socket_path = "~/.txgate/txgate.sock"
timeout_secs = 30

[keys]
directory = "~/.txgate/keys"
default_key = "default"

[policy]
whitelist_enabled = false
whitelist = []
blacklist = []

[policy.transaction_limits]
# ETH = "1000000000000000000"  # 1 ETH

Structs§

Config
Top-level configuration for the TxGate signing service.
ConfigBuilder
Builder for creating customized Config instances.
KeysConfig
Key storage configuration for the TxGate signing service.
PolicyConfig
Policy configuration for transaction approval rules.
ServerConfig
Server configuration for the TxGate daemon.