Documentation ¶
Index ¶
Constants ¶
View Source
const ( MinMonikerLength = 5 MaxMonikerLength = 30 MinIntervalSetSessions = 2 * time.Minute MaxIntervalSetSessions = 10 * time.Minute MinIntervalUpdateSessions = (2 * time.Hour) / 2 MaxIntervalUpdateSessions = (2 * time.Hour) - (5 * time.Minute) MinIntervalUpdateStatus = (1 * time.Hour) / 2 MaxIntervalUpdateStatus = (1 * time.Hour) - (5 * time.Minute) )
View Source
const ( ConfigFileName = "config.toml" DatabaseFileName = "data.db" FlagForce = "force" KeyringName = "sentinel" DefaultIPv4CIDR = "10.8.0.2/24" DefaultIPv6CIDR = "fd86:ea04:1115::2/120" )
Variables ¶
View Source
var ( DefaultHomeDirectory = func() string { home, err := os.UserHomeDir() if err != nil { panic(err) } return filepath.Join(home, ".sentinelnode") }() )
Functions ¶
This section is empty.
Types ¶
type ChainConfig ¶
type ChainConfig struct { GasAdjustment float64 `json:"gas_adjustment" mapstructure:"gas_adjustment"` GasPrices string `json:"gas_prices" mapstructure:"gas_prices"` Gas uint64 `json:"gas" mapstructure:"gas"` ID string `json:"id" mapstructure:"id"` RPCAddress string `json:"rpc_address" mapstructure:"rpc_address"` SimulateAndExecute bool `json:"simulate_and_execute" mapstructure:"simulate_and_execute"` }
func NewChainConfig ¶
func NewChainConfig() *ChainConfig
func (*ChainConfig) Validate ¶
func (c *ChainConfig) Validate() error
func (*ChainConfig) WithDefaultValues ¶
func (c *ChainConfig) WithDefaultValues() *ChainConfig
type Config ¶
type Config struct { Chain *ChainConfig `json:"chain" mapstructure:"chain"` Handshake *HandshakeConfig `json:"handshake" mapstructure:"handshake"` Keyring *KeyringConfig `json:"keyring" mapstructure:"keyring"` Node *NodeConfig `json:"node" mapstructure:"node"` }
func (*Config) SaveToPath ¶
func (*Config) WithDefaultValues ¶
type Error ¶
type GeoIPLocation ¶
type HandshakeConfig ¶
type HandshakeConfig struct { Enable bool `json:"enable" mapstructure:"enable"` Peers uint64 `json:"peers" mapstructure:"peers"` }
func NewHandshakeConfig ¶
func NewHandshakeConfig() *HandshakeConfig
func (*HandshakeConfig) Validate ¶
func (c *HandshakeConfig) Validate() error
func (*HandshakeConfig) WithDefaultValues ¶
func (c *HandshakeConfig) WithDefaultValues() *HandshakeConfig
type KeyringConfig ¶
type KeyringConfig struct { Backend string `json:"backend" mapstructure:"backend"` From string `json:"from" mapstructure:"from"` }
func NewKeyringConfig ¶
func NewKeyringConfig() *KeyringConfig
func (*KeyringConfig) Validate ¶
func (c *KeyringConfig) Validate() error
func (*KeyringConfig) WithDefaultValues ¶
func (c *KeyringConfig) WithDefaultValues() *KeyringConfig
type NodeConfig ¶
type NodeConfig struct { IntervalSetSessions time.Duration `json:"interval_set_sessions" mapstructure:"interval_set_sessions"` IntervalUpdateSessions time.Duration `json:"interval_update_sessions" mapstructure:"interval_update_sessions"` IntervalUpdateStatus time.Duration `json:"interval_update_status" mapstructure:"interval_update_status"` ListenOn string `json:"listen_on" mapstructure:"listen_on"` Moniker string `json:"moniker" mapstructure:"moniker"` Price string `json:"price" mapstructure:"price"` Provider string `json:"provider" mapstructure:"provider"` RemoteURL string `json:"remote_url" mapstructure:"remote_url"` }
func NewNodeConfig ¶
func NewNodeConfig() *NodeConfig
func (*NodeConfig) Validate ¶
func (c *NodeConfig) Validate() error
func (*NodeConfig) WithDefaultValues ¶
func (c *NodeConfig) WithDefaultValues() *NodeConfig
type Session ¶
type Session struct { *gorm.Model ID uint64 `gorm:"primaryKey;uniqueIndex:idx_sessions_id"` Subscription uint64 `gorm:"index:idx_sessions_subscription_for_address"` Key string `gorm:"uniqueIndex:idx_sessions_key"` Address string `gorm:"index:idx_sessions_address;index:idx_sessions_subscription_for_address"` Available int64 Download int64 Upload int64 }
func (*Session) GetAddress ¶ added in v0.2.0
func (s *Session) GetAddress() sdk.AccAddress
Click to show internal directories.
Click to hide internal directories.