Documentation ¶
Overview ¶
Package config provides functions to load and save ZetaClient config
Index ¶
- Constants
- func ContainRestrictedAddress(addrs ...string) bool
- func GetConnectorABI() string
- func GetERC20CustodyABI() string
- 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() (BTCConfig, bool)
- func (c Config) GetEVMConfig(chainID int64) (EVMConfig, bool)
- func (c Config) GetKeyringBackend() KeyringBackend
- func (c Config) GetRestrictedAddressBook() map[string]bool
- func (c Config) String() string
- type EVMConfig
- type KeyringBackend
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 GetConnectorABI ¶
func GetConnectorABI() string
GetConnectorABI returns the ABI of the connector contract
func GetERC20CustodyABI ¶
func GetERC20CustodyABI() string
GetERC20CustodyABI returns the ABI of the erc20 custody contract
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 RPCPassword string RPCHost string RPCParams string // "regtest", "mainnet", "testnet3" }
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"` HsmMode bool `json:"hsm_mode"` }
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"` HsmMode bool `json:"HsmMode"` HsmHotKey string `json:"HsmHotKey"` EVMChainConfigs map[int64]EVMConfig `json:"EVMChainConfigs"` BitcoinConfig BTCConfig `json:"BitcoinConfig"` // 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
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) GetRestrictedAddressBook ¶
GetRestrictedAddressBook returns a map of restricted addresses Note: the restricted address book contains both ETH and BTC addresses
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" )