Documentation ¶
Index ¶
- Variables
- func DefaultDataDir() string
- func EnsureRoot(rootDir string, network string)
- func ExportFederationFile(fedFile string, config *Config) error
- func FederationPMultiSigScript(c *Config) []byte
- func FederationWScript(c *Config) []byte
- func GenesisBlock() *types.Block
- func GenesisTx() *types.Tx
- func LoadFederationFile(fedFile string, config *Config) error
- type BaseConfig
- type Config
- type CrossChainConfig
- type FederationConfig
- type P2PConfig
- type RPCAuthConfig
- type WalletConfig
- type WebConfig
- type WebsocketConfig
Constants ¶
This section is empty.
Variables ¶
var FedAddressPath = [][]byte{ []byte{0x2C, 0x00, 0x00, 0x00}, []byte{0x99, 0x00, 0x00, 0x00}, []byte{0x01, 0x00, 0x00, 0x00}, []byte{0x00, 0x00, 0x00, 0x00}, []byte{0x01, 0x00, 0x00, 0x00}, }
FedAddressPath is used to derive federation root xpubs for signing cross-chain txs
Functions ¶
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func EnsureRoot ¶
***** these are for production settings **********
func ExportFederationFile ¶
func FederationPMultiSigScript ¶ added in v0.3.0
func FederationWScript ¶ added in v0.3.0
func LoadFederationFile ¶
Types ¶
type BaseConfig ¶
type BaseConfig struct { // The root directory for all data. // This should be set in viper so it can unmarshal into this struct RootDir string `mapstructure:"home"` //The ID of the network to json ChainID string `mapstructure:"chain_id"` //log level to set LogLevel string `mapstructure:"log_level"` // A custom human readable name for this node Moniker string `mapstructure:"moniker"` // TCP or UNIX socket address for the profiling server to listen on ProfListenAddress string `mapstructure:"prof_laddr"` Mining bool `mapstructure:"mining"` // Database backend: leveldb | memdb DBBackend string `mapstructure:"db_backend"` // Database directory DBPath string `mapstructure:"db_dir"` // Keystore directory KeysPath string `mapstructure:"keys_dir"` ApiAddress string `mapstructure:"api_addr"` VaultMode bool `mapstructure:"vault_mode"` // log file name LogFile string `mapstructure:"log_file"` PrivateKeyFile string `mapstructure:"private_key_file"` XPrv *chainkd.XPrv XPub *chainkd.XPub // Federation file name FederationFileName string `mapstructure:"federation_file"` }
----------------------------------------------------------------------------- BaseConfig
func (BaseConfig) DBDir ¶
func (b BaseConfig) DBDir() string
func (BaseConfig) FederationFile ¶
func (b BaseConfig) FederationFile() string
func (BaseConfig) KeysDir ¶
func (b BaseConfig) KeysDir() string
func (BaseConfig) LogDir ¶ added in v1.0.1
func (b BaseConfig) LogDir() string
type Config ¶
type Config struct { // Top level options use an anonymous struct BaseConfig `mapstructure:",squash"` // Options for services P2P *P2PConfig `mapstructure:"p2p"` Wallet *WalletConfig `mapstructure:"wallet"` Auth *RPCAuthConfig `mapstructure:"auth"` Web *WebConfig `mapstructure:"web"` Websocket *WebsocketConfig `mapstructure:"ws"` Federation *FederationConfig `mapstructure:"federation"` CrossChain *CrossChainConfig `mapstructure:"cross_chain"` }
var ( // CommonConfig means config object CommonConfig *Config )
func (*Config) PrivateKey ¶
NodeKey retrieves the currently configured private key of the node, checking first any manually set key, falling back to the one found in the configured data folder. If no key can be found, a new one is generated.
type CrossChainConfig ¶ added in v1.1.0
type CrossChainConfig struct {
AssetWhitelist string `mapstructure:"asset_whitelist"`
}
func DefaultCrossChainConfig ¶ added in v1.1.0
func DefaultCrossChainConfig() *CrossChainConfig
Default configurable crosschain parameters.
type FederationConfig ¶
func DefaultFederationConfig ¶
func DefaultFederationConfig() *FederationConfig
Default configurable federation parameters.
type P2PConfig ¶
type P2PConfig struct { ListenAddress string `mapstructure:"laddr"` Seeds string `mapstructure:"seeds"` SkipUPNP bool `mapstructure:"skip_upnp"` LANDiscover bool `mapstructure:"lan_discoverable"` MaxNumPeers int `mapstructure:"max_num_peers"` HandshakeTimeout int `mapstructure:"handshake_timeout"` DialTimeout int `mapstructure:"dial_timeout"` ProxyAddress string `mapstructure:"proxy_address"` ProxyUsername string `mapstructure:"proxy_username"` ProxyPassword string `mapstructure:"proxy_password"` KeepDial string `mapstructure:"keep_dial"` Compression string `mapstructure:"compression_backend"` }
P2PConfig
type RPCAuthConfig ¶
type RPCAuthConfig struct {
Disable bool `mapstructure:"disable"`
}
func DefaultRPCAuthConfig ¶
func DefaultRPCAuthConfig() *RPCAuthConfig
Default configurable rpc's auth parameters.
type WalletConfig ¶
type WalletConfig struct { Disable bool `mapstructure:"disable"` Rescan bool `mapstructure:"rescan"` TxIndex bool `mapstructure:"txindex"` MaxTxFee uint64 `mapstructure:"max_tx_fee"` }
-----------------------------------------------------------------------------
func DefaultWalletConfig ¶
func DefaultWalletConfig() *WalletConfig
Default configurable wallet parameters.
type WebsocketConfig ¶
type WebsocketConfig struct { MaxNumWebsockets int `mapstructure:"max_num_websockets"` MaxNumConcurrentReqs int `mapstructure:"max_num_concurrent_reqs"` }
func DefaultWebsocketConfig ¶
func DefaultWebsocketConfig() *WebsocketConfig
Default configurable websocket parameters.