Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLogin() bool
- func DefaultConfig() *config
- func DefaultDataDir(homePath string) string
- func DefaultIPCEndpoint(homePath string) string
- func FlushConfig() error
- func GenDefaultConfig() error
- func GetDataBufferSize() int
- func GetDiskSizeSoftCap(actualTotal uint64) uint64
- func GetP2pServerPort() string
- func GetRootPath() string
- func IPCEndpoint(dataDir string, ipcPath string) string
- func InitializeSPMap() error
- func LoadConfig(configPath string) error
- func SaveSPMapToFile() error
- func SetConfig(key string, value interface{}) error
- func SetIPCEndpoint(homePath string)
- func SetMyNetworkAddress()
- func SetupRoot(root string)
- func ShowProgress(ctx context.Context, p float32)
- func UpdateSpMap(lst []*protos.SPBaseInfo)
- type BlockchainConfig
- type ConnectivityConfig
- type HomeConfig
- type KeysConfig
- type MonitorConfig
- type NodeConfig
- type SPBaseInfo
- type SPList
- type StreamingConfig
- type TrafficConfig
- type VersionConfig
- type WebServerConfig
Constants ¶
View Source
const ( Version = "v0.12.3" AppVersion = 12 MinAppVersion = 12 HDPath = "m/44'/606'/0'/0/0" HDPathP2p = "m/44'/606'/0/0" Bip39Passphrase = "" P2pServerType = "tcp4" NodeReportIntervalSec = 5 * 60 // Interval of node stat report, in seconds PpLatencyCheckInterval = 60 * 60 * 24 // interval for checking the latency peer PPs, in seconds DEFAULT_DATA_BUFFER_POOL_SIZE = 2000 MaxData = 1024 * 1024 * 3 // max size of a piece in a slice MaxSliceSize = 1024 * 1024 * 32 ImagePath = "./images/" VideoPath = "./videos" DownloadPathMinLen = 88 StreamCacheMaxSlice = 2 DefaultMaxConnections = 1000 DefaultMinUnsuspendDeposit = "1stos" // 1 stos SpamThresholdSpSignLatency = 60 // in second SpamThresholdSliceOperations = 6 * time.Hour SoftRamLimit = int64(15 * units.GiB) SoftRamLimitDev = int64(1500 * units.MiB) SoftRamLimitUnlimited = math.MaxInt64 DefaultHlsSegmentBuffer = 4 DefaultHlsSegmentLength = 10 DefaultSliceBlockSize = 33554432 // http code FAILCode = 500 SUCCESSCode = 0 )
Variables ¶
View Source
var ( Config *config ConfigPath string TrafficLogPath string // ImageMap download image hash map ImageMap = &sync.Map{} // DownloadProgressMap download progress map DownloadProgressMap = &sync.Map{} IsWindows bool )
View Source
var BeneficiaryAddress string
View Source
var IpcEndpoint string
View Source
var IsPP = false
View Source
var IsPPSyncedWithSP = false
View Source
var MonitorInitialToken string
View Source
var NetworkAddress string
View Source
var NetworkIP net.IP
View Source
var OnlineTime int64 = 0
View Source
var RestAddress string
View Source
var SPMap = &sync.Map{}
View Source
var State uint32 = msgtypes.PP_INACTIVE
View Source
var WalletAddress string
View Source
var WalletPrivateKey fwcryptotypes.PrivKey
View Source
var WalletPublicKey fwcryptotypes.PubKey
Functions ¶
func CheckLogin ¶
func CheckLogin() bool
func DefaultConfig ¶ added in v0.12.0
func DefaultConfig() *config
func DefaultDataDir ¶ added in v0.5.0
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func DefaultIPCEndpoint ¶ added in v0.5.0
DefaultIPCEndpoint returns the IPC path used by default.
func FlushConfig ¶ added in v0.10.0
func FlushConfig() error
func GenDefaultConfig ¶
func GenDefaultConfig() error
func GetDataBufferSize ¶ added in v0.10.1
func GetDataBufferSize() int
func GetDiskSizeSoftCap ¶ added in v0.10.0
func GetP2pServerPort ¶ added in v0.12.2
func GetP2pServerPort() string
func GetRootPath ¶ added in v0.5.0
func GetRootPath() string
func IPCEndpoint ¶ added in v0.5.0
IPCEndpoint resolves an IPC endpoint based on a configured value, taking into account the set data folders as well as the designated platform we're currently running on.
func InitializeSPMap ¶ added in v0.10.0
func InitializeSPMap() error
func LoadConfig ¶
func SaveSPMapToFile ¶ added in v0.10.0
func SaveSPMapToFile() error
func SetIPCEndpoint ¶ added in v0.5.0
func SetIPCEndpoint(homePath string)
func SetMyNetworkAddress ¶ added in v0.9.0
func SetMyNetworkAddress()
SetMyNetworkAddress set the PP's NetworkAddress according to the internal/external config in config file and the network config from OS
func UpdateSpMap ¶ added in v0.10.0
func UpdateSpMap(lst []*protos.SPBaseInfo)
Types ¶
type BlockchainConfig ¶ added in v0.10.0
type BlockchainConfig struct { ChainId string `toml:"chain_id" comment:"ID of the chain Eg: \"stratos-1\""` GasAdjustment float64 `toml:"gas_adjustment" comment:"Multiplier for the simulated tx gas cost Eg: 1.5"` Insecure bool `toml:"insecure" comment:"Connect to the chain using an insecure connection (no TLS) Eg: true"` GrpcServer string `toml:"grpc_server" comment:"Network address of the chain grpc Eg: \"127.0.0.1:9090\""` }
type ConnectivityConfig ¶ added in v0.10.0
type ConnectivityConfig struct { SeedMetaNode SPBaseInfo `toml:"seed_meta_node" comment:"The first meta node to connect to when starting the node"` Internal bool `toml:"internal" comment:"Is the node running on an internal network? Eg: false"` NetworkAddress string `toml:"network_address" comment:"Domain name or IP address of the node. Eg: \"127.0.0.1\""` NetworkPort string `toml:"network_port" comment:"Main port for communication on the network. Must be open to the internet. Eg: \"18081\""` LocalPort string `` /* 166-byte string literal not displayed */ MetricsPort string `toml:"metrics_port" comment:"Port for prometheus metrics"` RpcPort string `` /* 131-byte string literal not displayed */ RpcNamespaces string `toml:"rpc_namespaces" comment:"Namespaces enabled in the RPC API. Eg: \"user,owner\""` }
type HomeConfig ¶ added in v0.10.0
type HomeConfig struct { AccountsPath string `toml:"accounts_path" comment:"Key files (wallet and P2P key). Eg: \"./accounts\""` DownloadPath string `toml:"download_path" comment:"Where downloaded files will go. Eg: \"./download\""` PeersPath string `toml:"peers_path" comment:"The list of peers (other sds nodes). Eg: \"./peers\""` StoragePath string `toml:"storage_path" comment:"Where files are stored. Eg: \"./storage\""` }
type KeysConfig ¶ added in v0.10.0
type KeysConfig struct { P2PAddress string `toml:"p2p_address" comment:"Address of the P2P key. Eg: \"stsdsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\""` P2PPassword string `toml:"p2p_password"` WalletAddress string `toml:"wallet_address" comment:"Address of the stratos wallet. Eg: \"stxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\""` WalletPassword string `toml:"wallet_password"` BeneficiaryAddress string `toml:"beneficiary_address" comment:"Address for receiving reward. Eg: \"stxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\""` }
type MonitorConfig ¶ added in v0.10.0
type MonitorConfig struct { TLS bool `toml:"tls" comment:"Should the monitor server use TLS? Eg: false"` CertFilePath string `toml:"cert_file_path" comment:"Path to the TLS certificate file"` KeyFilePath string `toml:"key_file_path" comment:"Path to the TLS private key file"` Port string `` /* 155-byte string literal not displayed */ AllowedOrigins []string `` /* 222-byte string literal not displayed */ }
type NodeConfig ¶ added in v0.10.0
type NodeConfig struct { Debug bool `toml:"debug" comment:"Should debug info be printed out in logs? Eg: false"` MaxDiskUsage uint64 `` /* 156-byte string literal not displayed */ Connectivity ConnectivityConfig `toml:"connectivity"` }
type SPBaseInfo ¶
type SPBaseInfo struct { P2PAddress string `toml:"p2p_address" json:"p2p_address"` P2PPublicKey string `toml:"p2p_public_key" json:"p2p_public_key"` NetworkAddress string `toml:"network_address" json:"network_address"` }
func GetSPList ¶ added in v0.10.0
func GetSPList() []SPBaseInfo
type SPList ¶ added in v0.10.0
type SPList struct {
SPs []SPBaseInfo `json:"sp_list"`
}
type StreamingConfig ¶ added in v0.10.0
type TrafficConfig ¶ added in v0.10.0
type TrafficConfig struct { LogInterval uint64 `toml:"log_interval" comment:"Interval at which traffic is logged (in seconds) Eg: 10"` MaxConnections int `toml:"max_connections" comment:"Max number of concurrent network connections. Eg: 1000"` MaxDownloadRate uint64 `` /* 150-byte string literal not displayed */ MaxUploadRate uint64 `` /* 142-byte string literal not displayed */ }
type VersionConfig ¶ added in v0.10.0
type VersionConfig struct { AppVer uint16 `toml:"app_ver" comment:"App version number. Eg: 11"` MinAppVer uint16 `toml:"min_app_ver" comment:"Network connections from nodes below this version number will be rejected. Eg: 11"` Show string `toml:"show" comment:"Formatted version number. Eg: \"v0.11.0\""` }
type WebServerConfig ¶ added in v0.10.0
Click to show internal directories.
Click to hide internal directories.