Documentation ¶
Overview ¶
Package config provides functions to load and save ZetaClient config
Index ¶
- Constants
- func ContainRestrictedAddress(addrs ...string) bool
- func GetPath(inputPath string) string
- func LoadComplianceConfig(cfg Config)
- func Save(config *Config, path string) error
- type BTCConfig
- type ClientConfiguration
- type ComplianceConfig
- type Config
- func (c Config) GetAllEVMConfigs() map[int64]EVMConfig
- func (c Config) GetBTCConfig(chainID int64) (BTCConfig, bool)
- func (c Config) GetEVMConfig(chainID int64) (EVMConfig, bool)
- func (c Config) GetKeyringBackend() KeyringBackend
- func (c Config) GetRelayerKeyPath() string
- func (c Config) GetRestrictedAddressBook() map[string]bool
- func (c Config) GetSolanaConfig() (SolanaConfig, bool)
- func (c Config) GetTONConfig() (TONConfig, bool)
- func (c Config) StringMasked() string
- type EVMConfig
- type KeyringBackend
- type SolanaConfig
- type TONConfig
Constants ¶
const (
MaxBlocksPerPeriod = 100
)
Variables ¶
This section is empty.
Functions ¶
func ContainRestrictedAddress ¶
ContainRestrictedAddress returns true if any one of the addresses is restricted Note: the addrs can contains both ETH and BTC addresses
func LoadComplianceConfig ¶
func LoadComplianceConfig(cfg Config)
LoadComplianceConfig loads compliance data (restricted addresses) from config
Types ¶
type BTCConfig ¶
type BTCConfig struct { // the following are rpcclient ConnConfig fields RPCUsername string `mask:"filled"` RPCPassword string `mask:"filled"` RPCHost string `mask:"filled"` RPCParams string // "regtest", "mainnet", "testnet3" , "signet", "testnet4" RPCAlertLatency int64 }
BTCConfig is the config for Bitcoin chain
type ClientConfiguration ¶
type ClientConfiguration struct { ChainHost string `json:"chain_host" mapstructure:"chain_host"` ChainRPC string `json:"chain_rpc" mapstructure:"chain_rpc"` ChainHomeFolder string `json:"chain_home_folder" mapstructure:"chain_home_folder"` SignerName string `json:"signer_name" mapstructure:"signer_name"` SignerPasswd string `json:"signer_passwd"` }
ClientConfiguration is a subset of zetaclient config that is used by zetacore client
type ComplianceConfig ¶
type ComplianceConfig struct { LogPath string `json:"LogPath"` RestrictedAddresses []string `json:"RestrictedAddresses"` }
ComplianceConfig is the config for compliance
type Config ¶
type Config struct { Peer string `json:"Peer"` PublicIP string `json:"PublicIP"` LogFormat string `json:"LogFormat"` LogLevel int8 `json:"LogLevel"` LogSampler bool `json:"LogSampler"` PreParamsPath string `json:"PreParamsPath"` ZetaCoreHome string `json:"ZetaCoreHome"` ChainID string `json:"ChainID"` ZetaCoreURL string `json:"ZetaCoreURL"` AuthzGranter string `json:"AuthzGranter"` AuthzHotkey string `json:"AuthzHotkey"` P2PDiagnostic bool `json:"P2PDiagnostic"` ConfigUpdateTicker uint64 `json:"ConfigUpdateTicker"` P2PDiagnosticTicker uint64 `json:"P2PDiagnosticTicker"` TssPath string `json:"TssPath"` TestTssKeysign bool `json:"TestTssKeysign"` KeyringBackend KeyringBackend `json:"KeyringBackend"` RelayerKeyPath string `json:"RelayerKeyPath"` // chain configs EVMChainConfigs map[int64]EVMConfig `json:"EVMChainConfigs"` BTCChainConfigs map[int64]BTCConfig `json:"BTCChainConfigs"` // Deprecated: the 'BitcoinConfig' will be removed once the 'BTCChainConfigs' is fully adopted BitcoinConfig BTCConfig `json:"BitcoinConfig"` SolanaConfig SolanaConfig `json:"SolanaConfig"` TONConfig TONConfig `json:"TONConfig"` // compliance config ComplianceConfig ComplianceConfig `json:"ComplianceConfig"` // contains filtered or unexported fields }
Config is the config for ZetaClient TODO: use snake case for json fields https://github.com/zeta-chain/node/issues/1020
func (Config) GetAllEVMConfigs ¶
GetAllEVMConfigs returns a map of all EVM configs
func (Config) GetBTCConfig ¶
GetBTCConfig returns the BTC config for the given chain ID
func (Config) GetEVMConfig ¶
GetEVMConfig returns the EVM config for the given chain ID
func (Config) GetKeyringBackend ¶
func (c Config) GetKeyringBackend() KeyringBackend
GetKeyringBackend returns the keyring backend
func (Config) GetRelayerKeyPath ¶
GetRelayerKeyPath returns the relayer key path
func (Config) GetRestrictedAddressBook ¶
GetRestrictedAddressBook returns a map of restricted addresses Note: the restricted address book contains both ETH and BTC addresses
func (Config) GetSolanaConfig ¶
func (c Config) GetSolanaConfig() (SolanaConfig, bool)
GetSolanaConfig returns the Solana config
func (Config) GetTONConfig ¶
GetTONConfig returns the TONConfig and a bool indicating if it's present.
func (Config) StringMasked ¶
StringMasked returns the string representation of the config with sensitive fields masked. Currently only the endpoints and bitcoin credentials are masked.
type KeyringBackend ¶
type KeyringBackend string
KeyringBackend is the type of keyring backend to use for the hotkey
const ( // KeyringBackendUndefined is undefined keyring backend KeyringBackendUndefined KeyringBackend = "" // KeyringBackendTest is the test Cosmos keyring backend KeyringBackendTest KeyringBackend = "test" // KeyringBackendFile is the file Cosmos keyring backend KeyringBackendFile KeyringBackend = "file" DefaultRelayerDir = "relayer-keys" // DefaultRelayerKeyPath is the default path that relayer keys are stored DefaultRelayerKeyPath = "~/.zetacored/" + DefaultRelayerDir )
type SolanaConfig ¶
SolanaConfig is the config for Solana chain