Documentation ¶
Index ¶
- Constants
- Variables
- type ChainConfig
- type Config
- type Error
- type GeoIPLocation
- type HandshakeConfig
- type KeyringConfig
- type NodeConfig
- type Peer
- type Response
- type Service
- type Session
- type Sessions
- func (s *Sessions) DeleteByAddress(k sdk.AccAddress)
- func (s *Sessions) DeleteByKey(k string)
- func (s *Sessions) GetByAddress(k sdk.AccAddress) Session
- func (s *Sessions) GetByKey(k string) Session
- func (s *Sessions) Iterate(fn func(v Session) bool)
- func (s *Sessions) Len() int
- func (s *Sessions) Set(v Session)
- func (s *Sessions) Update(v Session)
Constants ¶
View Source
const ( ConfigFileName = "config.toml" 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 { ID uint64 `json:"id,omitempty"` Key string `json:"key,omitempty"` Address sdk.AccAddress `json:"address,omitempty"` Available sdk.Int `json:"available,omitempty"` Download int64 `json:"download,omitempty"` Upload int64 `json:"upload,omitempty"` ConnectedAt time.Time `json:"connected_at,omitempty"` }
type Sessions ¶
func NewSessions ¶
func NewSessions() *Sessions
func (*Sessions) DeleteByAddress ¶ added in v0.1.2
func (s *Sessions) DeleteByAddress(k sdk.AccAddress)
func (*Sessions) DeleteByKey ¶ added in v0.1.2
func (*Sessions) GetByAddress ¶ added in v0.1.2
func (s *Sessions) GetByAddress(k sdk.AccAddress) Session
Click to show internal directories.
Click to hide internal directories.