Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertDuration(base int, unit time.Duration) time.Duration
- func EnsureHomeDir(path string) error
- func ExpandBlobsPath(homePath string) string
- func ExpandDBPath(homePath string) string
- func ExpandHomePath(path string) string
- func GenerateDefaultConfigFile() []byte
- func HomeDirExists(path string) (bool, error)
- func InitBlobsDir(homePath string) error
- func InitDBDir(homePath string) error
- func InitHomeDir(homePath string) error
- func WriteDefaultConfigFile(homeDir string) error
- func WriteIdentity(homePath string, id *Identity) error
- type Config
- type HNSResolverConfig
- type HeartbeatConfig
- type HeartbeaterConfig
- type Identity
- type NameImporterConfig
- type NameSyncerConfig
- type P2PConfig
- type PeerExchangerConfig
- type RPCConfig
- type SectorServerConfig
- type SyncerConfig
- type TimebankConfig
- type TuningConfig
- type UpdateQueueConfig
- type UpdaterConfig
Constants ¶
View Source
const ( BlobsPath = "blobs" DBPath = "db" )
View Source
const (
IdentityFilename = "identity"
)
Variables ¶
View Source
var DefaultConfig = Config{ BanLists: []string{}, LogLevel: log.LevelInfo.String(), EnableProfiler: false, Heartbeat: HeartbeatConfig{ Moniker: "", URL: "https://www.ddrpscan.com/heartbeat", }, P2P: P2PConfig{ Host: "0.0.0.0", DNSSeeds: []string{ "seeds.ddrp.network", }, FixedSeeds: []string{}, MaxInboundPeers: 117, MaxOutboundPeers: 8, ConnectionTimeoutMS: 5000, }, RPC: RPCConfig{ Host: "127.0.0.1", Port: 9098, }, HNSResolver: HNSResolverConfig{ Host: "http://127.0.0.1", Port: 12037, BasePath: "", APIKey: "", }, Tuning: TuningConfig{ Timebank: TimebankConfig{ PeriodMS: 86400 * 2, MinUpdateIntervalMS: 120, FullUpdatesPerPeriod: 2, }, UpdateQueue: UpdateQueueConfig{ MaxLen: 1000, ReapIntervalMS: 5000, }, Updater: UpdaterConfig{ PollIntervalMS: 100, Workers: 2, }, Syncer: SyncerConfig{ TreeBaseResponseTimeoutMS: 10000, SectorResponseTimeoutMS: 15000, }, SectorServer: SectorServerConfig{ CacheExpiryMS: 5000, }, PeerExchanger: PeerExchangerConfig{ SampleSize: 12, RequestIntervalMS: 60 * 60 * 1000, MaxSentPeers: 255, MaxReceivedPeers: 255, MaxConcurrentDials: 2, }, NameImporter: NameImporterConfig{ ConfirmationDepth: 24, CheckIntervalMS: 60000, Workers: 5, VerificationThreshold: 0.90, }, Heartbeat: HeartbeaterConfig{ IntervalMS: 30000, TimeoutMS: 10000, }, NameSyncer: NameSyncerConfig{ Workers: 2, SampleSize: 7, UpdateResponseTimeoutMS: 5000, IntervalMS: 60 * 60 * 1000, SyncResponseTimeoutMS: 60000, }, }, }
Functions ¶
func EnsureHomeDir ¶
func ExpandBlobsPath ¶
func ExpandDBPath ¶
func ExpandHomePath ¶
func GenerateDefaultConfigFile ¶
func GenerateDefaultConfigFile() []byte
func HomeDirExists ¶
func InitBlobsDir ¶
func InitHomeDir ¶
func WriteDefaultConfigFile ¶
func WriteIdentity ¶
Types ¶
type Config ¶
type Config struct { LogLevel string `mapstructure:"log_level"` EnableProfiler bool `mapstructure:"enable_profiler"` Heartbeat HeartbeatConfig `mapstructure:"heartbeat"` P2P P2PConfig `mapstructure:"p2p"` RPC RPCConfig `mapstructure:"rpc"` HNSResolver HNSResolverConfig `mapstructure:"hns_resolver"` BanLists []string `mapstructure:"ban_lists"` Tuning TuningConfig `mapstructure:"tuning"` }
func ReadConfigFile ¶
type HNSResolverConfig ¶
type HeartbeatConfig ¶
type HeartbeaterConfig ¶
type Identity ¶
type Identity struct {
PrivateKey *btcec.PrivateKey
}
func NewIdentity ¶
func NewIdentity() *Identity
func ReadNodeIdentity ¶
func (*Identity) MarshalBinary ¶
func (*Identity) UnmarshalBinary ¶
type NameImporterConfig ¶
type NameSyncerConfig ¶
type P2PConfig ¶
type P2PConfig struct { Host string `mapstructure:"host"` DNSSeeds []string `mapstructure:"dns_seeds"` FixedSeeds []string `mapstructure:"seed_peers"` MaxInboundPeers int `mapstructure:"max_inbound_peers"` MaxOutboundPeers int `mapstructure:"max_outbound_peers"` ConnectionTimeoutMS int `mapstructure:"connection_timeout_ms"` }
type PeerExchangerConfig ¶
type PeerExchangerConfig struct { SampleSize int `mapstructure:"sample_size"` ResponseTimeoutMS int `mapstructure:"response_timeout_ms"` RequestIntervalMS int `mapstructure:"request_interval_ms"` MaxSentPeers int `mapstructure:"max_sent_peers"` MaxReceivedPeers int `mapstructure:"max_received_peers"` MaxConcurrentDials int `mapstructure:"max_concurrent_dials"` }
type SectorServerConfig ¶
type SectorServerConfig struct {
CacheExpiryMS int `mapstructure:"cache_expiry_ms"`
}
type SyncerConfig ¶
type TimebankConfig ¶
type TuningConfig ¶
type TuningConfig struct { Timebank TimebankConfig `mapstructure:"timebank"` UpdateQueue UpdateQueueConfig `mapstructure:"update_queue"` Updater UpdaterConfig `mapstructure:"updater"` Syncer SyncerConfig `mapstructure:"syncer"` SectorServer SectorServerConfig `mapstructure:"sector_server"` PeerExchanger PeerExchangerConfig `mapstructure:"peer_exchanger"` NameImporter NameImporterConfig `mapstructure:"name_importer"` Heartbeat HeartbeaterConfig `mapstructure:"heartbeat"` NameSyncer NameSyncerConfig `mapstructure:"name_syncer"` }
type UpdateQueueConfig ¶
type UpdaterConfig ¶
Click to show internal directories.
Click to hide internal directories.