Documentation ¶
Index ¶
- Constants
- Variables
- func ACLNetworkHandler[T quicstreamheader.RequestHeader](aclallow ACLAllowFunc, scope ACLScope, required ACLPerm, ...) quicstreamheader.Handler[T]
- func AttachBlockItemsNetworkHandlers(pctx context.Context) error
- func AttachHandlerOperation(pctx context.Context) error
- func AttachHandlerProposals(pctx context.Context) error
- func AttachHandlerSendOperation(pctx context.Context) error
- func AttachHandlerStreamOperations(pctx context.Context) error
- func AttachMemberlistNetworkHandlers(pctx context.Context) error
- func CleanStorage(permuri, root string, encs *encoder.Encoders, enc encoder.Encoder) error
- func DecodePrivatekey(s string, enc encoder.Encoder) (base.Privatekey, error)
- func DefaultDialQuicConfig() *quic.Config
- func DefaultINITPS() *ps.PS
- func DefaultImportPS() *ps.PS
- func DefaultMainPS() *ps.PS
- func DefaultRunPS() *ps.PS
- func DefaultServerQuicConfig() *quic.Config
- func DefaultWhenNewBlockConfirmedFunc(log *logging.Logging) func(base.Height)
- func DefaultWhenNewBlockSavedInConsensusStateFunc(log *logging.Logging, ballotbox *isaacstates.Ballotbox, db isaac.Database, ...) func(base.BlockMap)
- func DefaultWhenNewBlockSavedInSyncingStateFunc(log *logging.Logging, db isaac.Database, ...) func(base.Height)
- func DialQuicConfig(params *NetworkParams) *quic.Config
- func EnsureHandlerAdd[T quicstreamheader.RequestHeader](pctx context.Context, gerr *error, name quicstream.HandlerName, ...)
- func EventLoggingFromNetworkHandler(ctx context.Context, stream quicstreamheader.StreamFunc, ...) error
- func EventNameKeyPrefix(name EventLoggerName) [32]byte
- func FixedSuffrageCandidateLimiterFunc() func(base.SuffrageCandidateLimiterRule) (base.SuffrageCandidateLimiter, error)
- func GenerateNewTLSConfig(networkID base.NetworkID) *tls.Config
- func GetDiscoveriesFromLocked(l *util.Locked[[]quicstream.ConnInfo]) []quicstream.ConnInfo
- func ImportBlocks(fromreaders *isaac.BlockItemReaders, ...) error
- func IsSupportedProposalOperationFactHintFunc() func(hint.Hint) bool
- func IsValidSyncSourcesDesign(d *SyncSourcesDesign, localPublishString, localPublishResolved string) error
- func LoadDatabase(fsnodeinfo NodeInfo, permuri string, root string, encs *encoder.Encoders, ...) (*leveldbstorage.Storage, *isaacdatabase.Center, isaac.PermanentDatabase, ...)
- func LoadDefaultEventStorage(dir string, readonly bool) (*leveldbstorage.Storage, error)
- func LoadEventInfoFromKey(k []byte) (t time.Time, offset int64, _ error)
- func LoadHinters(encs *encoder.Encoders) error
- func LoadInputFlag(s string, isfile bool) ([]byte, error)
- func LoadPermanentDatabase(uri, id string, encs *encoder.Encoders, enc encoder.Encoder, root string, ...) (*leveldbstorage.Storage, isaac.PermanentDatabase, error)
- func LoadRawEvent(raw []byte) ([]byte, error)
- func LocalFSDataDirectory(root string) string
- func LocalFSDatabaseDirectory(root string) string
- func LocalFSEventDatabaseDirectory(root string) string
- func LocalFromDesign(design NodeDesign) (base.LocalNode, error)
- func MajoritySuffrageCandidateLimiterFunc(db isaac.Database) func(base.SuffrageCandidateLimiterRule) (base.SuffrageCandidateLimiter, error)
- func NewBlockWriterFunc(local base.LocalNode, networkID base.NetworkID, dataroot string, ...) isaac.NewBlockWriterFunc
- func NewConnInfoDialFunc(networkID base.NetworkID, params *NetworkParams) quicstream.ConnInfoDialFunc
- func NewConnectionPool(size uint64, networkID base.NetworkID, params *NetworkParams) (*quicstream.ConnectionPool, error)
- func NewNetworkClient(encs *encoder.Encoders, enc encoder.Encoder, ...) *isaacnetwork.BaseClient
- func NewProposalSelector(pctx context.Context) (*isaac.BaseProposalSelector, error)
- func NewSuffrageCandidateLimiterFunc(pctx context.Context) (...)
- func OperationPreProcess(db isaac.Database, ...) (...)
- func PAddHinters(pctx context.Context) (context.Context, error)
- func PBallotStuckResolver(pctx context.Context) (context.Context, error)
- func PBallotbox(pctx context.Context) (context.Context, error)
- func PBlockItemReaders(pctx context.Context) (context.Context, error)
- func PBlockItemReadersDecompressFunc(pctx context.Context) (context.Context, error)
- func PCheckAndCreateLocalFS(pctx context.Context) (context.Context, error)
- func PCheckBlocksOfStorage(pctx context.Context) (context.Context, error)
- func PCheckDesign(pctx context.Context) (context.Context, error)
- func PCheckLeveldbStorage(pctx context.Context) (context.Context, error)
- func PCheckLocalFS(pctx context.Context) (context.Context, error)
- func PCleanStorage(pctx context.Context) (context.Context, error)
- func PCloseLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)
- func PCloseMemberlist(pctx context.Context) (context.Context, error)
- func PCloseNetwork(pctx context.Context) (context.Context, error)
- func PCloseStates(pctx context.Context) (context.Context, error)
- func PCloseStorage(pctx context.Context) (context.Context, error)
- func PCloseSyncSourceChecker(pctx context.Context) (context.Context, error)
- func PCloseTimeSyncer(pctx context.Context) (context.Context, error)
- func PCreateLocalFS(pctx context.Context) (context.Context, error)
- func PDiscoveryFlag(pctx context.Context) (context.Context, error)
- func PEncoder(pctx context.Context) (context.Context, error)
- func PEventLoggingNetworkHandlers(pctx context.Context) (context.Context, error)
- func PGenerateGenesis(pctx context.Context) (context.Context, error)
- func PGenesisDesign(pctx context.Context) (context.Context, error)
- func PHandoverNetworkHandlers(pctx context.Context) (context.Context, error)
- func PINIT(pctx context.Context) (context.Context, error)
- func PINITObjectCache(pctx context.Context) (context.Context, error)
- func PLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)
- func PLoadACL(pctx context.Context) (context.Context, error)
- func PLoadDatabase(pctx context.Context) (context.Context, error)
- func PLoadDesign(pctx context.Context) (context.Context, error)
- func PLoadFromDatabase(pctx context.Context) (context.Context, error)
- func PLocal(pctx context.Context) (context.Context, error)
- func PLogging(pctx context.Context) (context.Context, error)
- func PLoggingWithCLI(pctx context.Context) (context.Context, error)
- func PLongRunningMemberlistJoin(pctx context.Context) (context.Context, error)
- func PMemberlist(pctx context.Context) (context.Context, error)
- func PNetwork(pctx context.Context) (context.Context, error)
- func PNetworkHandlers(pctx context.Context) (context.Context, error)
- func PNetworkHandlersReadWriteNode(pctx context.Context) (context.Context, error)
- func PNetworkRateLimiter(pctx context.Context) (context.Context, error)
- func PNodeInConsensusNodesFunc(pctx context.Context) (context.Context, error)
- func PNodeInfo(pctx context.Context) (context.Context, error)
- func POperationProcessorsMap(pctx context.Context) (context.Context, error)
- func PPatchBlockItemReaders(pctx context.Context) (context.Context, error)
- func PPatchLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)
- func PPatchMemberlist(pctx context.Context) (ctx context.Context, err error)
- func PProposalMaker(pctx context.Context) (context.Context, error)
- func PProposalProcessors(pctx context.Context) (context.Context, error)
- func PProposerSelector(pctx context.Context) (context.Context, error)
- func PQuicstreamClient(pctx context.Context) (context.Context, error)
- func PRemotesBlockItemReaderFunc(pctx context.Context) (context.Context, error)
- func PStartLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)
- func PStartMemberlist(pctx context.Context) (context.Context, error)
- func PStartNetwork(pctx context.Context) (context.Context, error)
- func PStartStorage(pctx context.Context) (context.Context, error)
- func PStartSyncSourceChecker(pctx context.Context) (context.Context, error)
- func PStartTimeSyncer(pctx context.Context) (context.Context, error)
- func PStates(pctx context.Context) (context.Context, error)
- func PStatesNetworkHandlers(pctx context.Context) (context.Context, error)
- func PStatesSetHandlers(pctx context.Context) (context.Context, error)
- func PStorage(pctx context.Context) (context.Context, error)
- func PSuffrageCandidateLimiterSet(pctx context.Context) (context.Context, error)
- func PSuffrageVoting(pctx context.Context) (context.Context, error)
- func PSyncSourceChecker(pctx context.Context) (context.Context, error)
- func QuicstreamHandlerEventLogging(aclhandler quicstreamheader.Handler[EventLoggingHeader], ...) (quicstreamheader.Handler[EventLoggingHeader], error)
- func QuicstreamHandlerGetNodeInfoFunc(enc encoder.Encoder, nodeinfo *isaacnetwork.NodeInfoUpdater) func() ([]byte, error)
- func QuicstreamHandlerLastBlockMapFunc(db isaac.Database) func(last util.Hash) (string, []byte, []byte, bool, error)
- func QuicstreamHandlerSuffrageNodeConnInfoFunc(db isaac.Database, memberlist *quicmemberlist.Memberlist) func() ([]isaac.NodeConnInfo, error)
- func ReadNodeFromNetworkHandler(ctx context.Context, priv base.Privatekey, networkID base.NetworkID, ...) (t interface{}, found bool, _ error)
- func RemoveLocalFS(root string) error
- func SaveNodeInfo(root string, i NodeInfo) error
- func SendOperationFilterFunc(pctx context.Context) (func(base.Operation) (bool, error), error)
- func ServerQuicConfig(params *NetworkParams) *quic.Config
- func SetupLoggingFromFlags(flag LoggingFlags) (*logging.Logging, io.Writer, error)
- func UpdateNodeInfoWithNewBlock(db isaac.Database, nodeinfo *isaacnetwork.NodeInfoUpdater) error
- func WriteNodeFromNetworkHandler(ctx context.Context, priv base.Privatekey, networkID base.NetworkID, ...) (found bool, _ error)
- type ACL
- type ACLAllowFunc
- type ACLFlags
- type ACLPerm
- type ACLScope
- type ACLUser
- type AddressFlag
- type BaseFlags
- type ClientIDRateLimiterRuleSet
- type ConnInfoFlag
- type DefaultNodeInfo
- func (info DefaultNodeInfo) CreatedAt() time.Time
- func (info DefaultNodeInfo) ID() string
- func (info DefaultNodeInfo) IsValid([]byte) error
- func (info DefaultNodeInfo) LastStartedAt() time.Time
- func (info DefaultNodeInfo) MarshalJSON() ([]byte, error)
- func (info DefaultNodeInfo) NetworkID() base.NetworkID
- func (info *DefaultNodeInfo) UnmarshalJSON(b []byte) error
- func (info DefaultNodeInfo) UpdateLastStartedAt() NodeInfo
- func (info DefaultNodeInfo) Version() util.Version
- type DesignFlag
- type DesignURIFlag
- type DevFlags
- type EventLoggerName
- type EventLogging
- func (el *EventLogging) Close() error
- func (el *EventLogging) Iter(offsets [2]int64, ...) error
- func (el *EventLogging) IterName(name EventLoggerName, offsets [2]int64, ...) error
- func (el *EventLogging) Logger(name EventLoggerName) (zerolog.Logger, bool)
- func (el *EventLogging) Register(name EventLoggerName) (l zerolog.Logger, _ error)
- type EventLoggingHeader
- func (h EventLoggingHeader) ACLUser() base.Publickey
- func (h *EventLoggingHeader) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (h EventLoggingHeader) IsValid([]byte) error
- func (h EventLoggingHeader) Limit() uint64
- func (h EventLoggingHeader) MarshalJSON() ([]byte, error)
- func (h EventLoggingHeader) Name() EventLoggerName
- func (h EventLoggingHeader) Offsets() [2]int64
- func (h EventLoggingHeader) Sort() bool
- type GenesisBlockGenerator
- type GenesisDesign
- type GenesisDesignYAMLUnmarshaler
- type HeightFlag
- type LocalParams
- type LocalParamsYAMLUnmarshaler
- type LogLevelFlag
- type LogOutFlag
- type LoggingFlags
- type LongRunningMemberlistJoin
- type MISCParams
- func (p *MISCParams) BlockItemReadersRemoveEmptyAfter() time.Duration
- func (p *MISCParams) BlockItemReadersRemoveEmptyInterval() time.Duration
- func (p *MISCParams) IsValid([]byte) error
- func (p *MISCParams) MarshalJSON() ([]byte, error)
- func (p *MISCParams) MarshalYAML() (interface{}, error)
- func (p *MISCParams) MaxMessageSize() uint64
- func (p *MISCParams) ObjectCacheSize() uint64
- func (p *MISCParams) SetBlockItemReadersRemoveEmptyAfter(d time.Duration) error
- func (p *MISCParams) SetBlockItemReadersRemoveEmptyInterval(d time.Duration) error
- func (p *MISCParams) SetMaxMessageSize(d uint64) error
- func (p *MISCParams) SetObjectCacheSize(d uint64) error
- func (p *MISCParams) SetSyncSourceCheckerInterval(d time.Duration) error
- func (p *MISCParams) SetValidProposalOperationExpire(d time.Duration) error
- func (p *MISCParams) SetValidProposalSuffrageOperationsExpire(d time.Duration) error
- func (p *MISCParams) SyncSourceCheckerInterval() time.Duration
- func (p *MISCParams) UnmarshalJSON(b []byte) error
- func (p *MISCParams) UnmarshalYAML(y *yaml.Node) error
- func (p *MISCParams) ValidProposalOperationExpire() time.Duration
- func (p *MISCParams) ValidProposalSuffrageOperationsExpire() time.Duration
- type MemberlistParams
- func (p *MemberlistParams) ExtraSameMemberLimit() uint64
- func (*MemberlistParams) IsValid([]byte) error
- func (p *MemberlistParams) MarshalJSON() ([]byte, error)
- func (p *MemberlistParams) MarshalYAML() (interface{}, error)
- func (p *MemberlistParams) ProbeInterval() time.Duration
- func (p *MemberlistParams) ProbeTimeout() time.Duration
- func (p *MemberlistParams) RetransmitMult() int
- func (p *MemberlistParams) SetExtraSameMemberLimit(d uint64) error
- func (p *MemberlistParams) SetProbeInterval(d time.Duration) error
- func (p *MemberlistParams) SetProbeTimeout(d time.Duration) error
- func (p *MemberlistParams) SetRetransmitMult(d int) error
- func (p *MemberlistParams) SetSuspicionMaxTimeoutMult(d int) error
- func (p *MemberlistParams) SetSuspicionMult(d int) error
- func (p *MemberlistParams) SetTCPTimeout(d time.Duration) error
- func (p *MemberlistParams) SetUDPBufferSize(d int) error
- func (p *MemberlistParams) SuspicionMaxTimeoutMult() int
- func (p *MemberlistParams) SuspicionMult() int
- func (p *MemberlistParams) TCPTimeout() time.Duration
- func (p *MemberlistParams) UDPBufferSize() int
- func (p *MemberlistParams) UnmarshalJSON(b []byte) error
- func (p *MemberlistParams) UnmarshalYAML(y *yaml.Node) error
- type NetRateLimiterRuleSet
- func (rs *NetRateLimiterRuleSet) Add(ipnet *net.IPNet, rule RateLimiterRuleMap) *NetRateLimiterRuleSet
- func (rs NetRateLimiterRuleSet) IsValid([]byte) error
- func (rs NetRateLimiterRuleSet) MarshalJSON() ([]byte, error)
- func (rs NetRateLimiterRuleSet) Rule(addr net.Addr, handler string, _ RateLimitRuleHint) (_ string, _ RateLimiterRule, _ string, _ bool)
- func (rs *NetRateLimiterRuleSet) UnmarshalJSON(b []byte) error
- func (rs NetRateLimiterRuleSet) UpdatedAt() int64
- type NetworkParams
- func (p *NetworkParams) ConnectionPoolSize() uint64
- func (p *NetworkParams) DefaultHandlerTimeout() time.Duration
- func (p *NetworkParams) HandlerTimeout(i quicstream.HandlerName) (time.Duration, error)
- func (p *NetworkParams) HandlerTimeoutFunc(i quicstream.HandlerName) (func() time.Duration, error)
- func (p *NetworkParams) HandshakeIdleTimeout() time.Duration
- func (p *NetworkParams) IsValid([]byte) error
- func (p *NetworkParams) KeepAlivePeriod() time.Duration
- func (p *NetworkParams) MarshalJSON() ([]byte, error)
- func (p *NetworkParams) MarshalYAML() (interface{}, error)
- func (p *NetworkParams) MaxIdleTimeout() time.Duration
- func (p *NetworkParams) MaxIncomingStreams() uint64
- func (p *NetworkParams) MaxStreamTimeout() time.Duration
- func (p *NetworkParams) RateLimit() *NetworkRateLimitParams
- func (p *NetworkParams) SetConnectionPoolSize(d uint64) error
- func (p *NetworkParams) SetDefaultHandlerTimeout(d time.Duration) error
- func (p *NetworkParams) SetHandlerTimeout(i quicstream.HandlerName, d time.Duration) error
- func (p *NetworkParams) SetHandshakeIdleTimeout(d time.Duration) error
- func (p *NetworkParams) SetKeepAlivePeriod(d time.Duration) error
- func (p *NetworkParams) SetMaxIdleTimeout(d time.Duration) error
- func (p *NetworkParams) SetMaxIncomingStreams(d uint64) error
- func (p *NetworkParams) SetMaxStreamTimeout(d time.Duration) error
- func (p *NetworkParams) SetRateLimit(r *RateLimiterRules) error
- func (p *NetworkParams) SetTimeoutRequest(d time.Duration) error
- func (p *NetworkParams) TimeoutRequest() time.Duration
- func (p *NetworkParams) UnmarshalJSON(b []byte) error
- func (p *NetworkParams) UnmarshalYAML(y *yaml.Node) error
- type NetworkRateLimitParams
- func (p *NetworkRateLimitParams) IsValid([]byte) error
- func (p *NetworkRateLimitParams) MarshalJSON() ([]byte, error)
- func (p *NetworkRateLimitParams) MarshalYAML() (interface{}, error)
- func (p *NetworkRateLimitParams) UnmarshalJSON(b []byte) error
- func (p *NetworkRateLimitParams) UnmarshalYAML(y *yaml.Node) error
- type NetworkRateLimitParamsUnmarshaler
- type NodeDesign
- func NodeDesignFromConsul(addr, key string, jsonencoder encoder.Encoder) (design NodeDesign, _ []byte, _ error)
- func NodeDesignFromFile(f string, jsonencoder encoder.Encoder) (d NodeDesign, _ []byte, _ error)
- func NodeDesignFromHTTP(u string, tlsinsecure bool, jsonencoder encoder.Encoder) (design NodeDesign, _ []byte, _ error)
- type NodeDesignMarshaler
- type NodeDesignYAMLUnmarshaler
- type NodeInfo
- type NodeNetworkDesign
- func (d *NodeNetworkDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
- func (d *NodeNetworkDesign) IsValid([]byte) error
- func (d NodeNetworkDesign) MarshalJSON() ([]byte, error)
- func (d NodeNetworkDesign) MarshalYAML() (interface{}, error)
- func (d NodeNetworkDesign) Publish() *net.UDPAddr
- func (d NodeNetworkDesign) PublishConnInfo() quicstream.ConnInfo
- type NodeNetworkDesignMarshaler
- type NodeRateLimiterRuleSet
- type NodeStorageDesign
- func (d *NodeStorageDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
- func (d *NodeStorageDesign) IsValid([]byte) error
- func (d NodeStorageDesign) MarshalJSON() ([]byte, error)
- func (d NodeStorageDesign) MarshalYAML() (interface{}, error)
- func (d *NodeStorageDesign) Patch(node base.Address) error
- type NodeStorageDesignLMarshaler
- type PrivatekeyArgument
- type PrivatekeyFlags
- type RangeFlag
- type RateLimitHandler
- type RateLimitHandlerArgs
- type RateLimitRuleHint
- type RateLimiter
- func (r *RateLimiter) Allow() bool
- func (r *RateLimiter) Burst() int
- func (r *RateLimiter) Checksum() string
- func (r *RateLimiter) Desc() string
- func (r *RateLimiter) Limit() rate.Limit
- func (r *RateLimiter) MarshalJSON() ([]byte, error)
- func (r *RateLimiter) Tokens() float64
- func (r *RateLimiter) Type() string
- func (r *RateLimiter) Update(limit rate.Limit, burst int, checksum, t, desc string) *RateLimiter
- func (r *RateLimiter) UpdatedAt() int64
- type RateLimiterResult
- type RateLimiterRule
- type RateLimiterRuleMap
- type RateLimiterRuleSet
- type RateLimiterRules
- func (r *RateLimiterRules) ClientIDRuleSet() RateLimiterRuleSet
- func (r *RateLimiterRules) DefaultMapUpdatedAt() int64
- func (r *RateLimiterRules) DefaultRuleMap() RateLimiterRuleMap
- func (r *RateLimiterRules) IsValid([]byte) error
- func (r *RateLimiterRules) NetRuleSet() RateLimiterRuleSet
- func (r *RateLimiterRules) NodeRuleSet() RateLimiterRuleSet
- func (r *RateLimiterRules) Rule(addr net.Addr, handler string, hint RateLimitRuleHint, l *RateLimiter) (_ *RateLimiter, isnew bool)
- func (r *RateLimiterRules) SetClientIDRuleSet(l RateLimiterRuleSet) error
- func (r *RateLimiterRules) SetDefaultRuleMap(rule RateLimiterRuleMap) error
- func (r *RateLimiterRules) SetIsInConsensusNodesFunc(...)
- func (r *RateLimiterRules) SetNetRuleSet(l RateLimiterRuleSet) error
- func (r *RateLimiterRules) SetNodeRuleSet(l RateLimiterRuleSet) error
- func (r *RateLimiterRules) SetSuffrageRuleSet(l RateLimiterRuleSet) error
- func (r *RateLimiterRules) SuffrageRuleSet() RateLimiterRuleSet
- type ReadNodeHeader
- type SecretFlag
- type StringKeyRateLimiterRuleSet
- type SuffragePool
- type SuffrageRateLimiterRuleSet
- func (*SuffrageRateLimiterRuleSet) IsValid([]byte) error
- func (rs *SuffrageRateLimiterRuleSet) MarshalJSON() ([]byte, error)
- func (rs *SuffrageRateLimiterRuleSet) Rule(_ net.Addr, handler string, hint RateLimitRuleHint) (statehash string, rule RateLimiterRule, _ string, _ bool)
- func (rs *SuffrageRateLimiterRuleSet) UnmarshalJSON(b []byte) error
- func (rs *SuffrageRateLimiterRuleSet) UpdatedAt() int64
- type SyncSourcesDesign
- func (d *SyncSourcesDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
- func (d *SyncSourcesDesign) IsValid([]byte) error
- func (d *SyncSourcesDesign) MarshalJSON() ([]byte, error)
- func (d *SyncSourcesDesign) MarshalYAML() (interface{}, error)
- func (d *SyncSourcesDesign) Sources() []isaacnetwork.SyncSource
- func (d *SyncSourcesDesign) Update(sources []isaacnetwork.SyncSource)
- type URLProperties
- type WriteNodeHeader
- type YAMLACL
Constants ¶
const ( ReadAllowACLPerm = ACLPerm(2) WriteAllowACLPerm = ACLPerm(3) )
Variables ¶
var ( DefaultNetworkBind = &net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: 4321} //nolint:mnd //... DefaultNetworkPublish = &net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: 4321} //nolint:mnd //... DefaultStorageBase string DefaultStorageDatabaseDirectoryName = "db" )
var ( DefaultNodeInfoHint = hint.MustNewHint("default-node-info-v0.0.1") NodeInfoFilename = "info.json" )
var ( PNameLoadACL = ps.Name("load-acl") ACLContextKey = util.ContextKey("acl") )
var ( PNameDesign = ps.Name("design") PNameCheckDesign = ps.Name("check-design") PNameINITObjectCache = ps.Name("init-object-cache") PNameGenesisDesign = ps.Name("genesis-design") DesignFlagContextKey = util.ContextKey("design-flag") DevFlagsContextKey = util.ContextKey("dev-flags") GenesisDesignFileContextKey = util.ContextKey("genesis-design-file") DesignContextKey = util.ContextKey("design") DesignStringContextKey = util.ContextKey("design-string") GenesisDesignContextKey = util.ContextKey("genesis-design") PrivatekeyContextKey = util.ContextKey("privatekey-from") ACLFlagsContextKey = util.ContextKey("acl-from") )
var ( PNameDiscoveryFlag = ps.Name("discovery-flag") DiscoveryFlagContextKey = util.ContextKey("discovery-flag") DiscoveryContextKey = util.ContextKey("discovery") )
var ( PNameEncoder = ps.Name("encoder") PNameAddHinters = ps.Name("add-hinters") EncodersContextKey = util.ContextKey("encoders") )
var ( PNameLocal = ps.Name("local") LocalContextKey = util.ContextKey("local") LocalParamsContextKey = util.ContextKey("local-params") ISAACParamsContextKey = util.ContextKey("isaac-params") )
var ( PNameMemberlist = ps.Name("memberlist") PNameStartMemberlist = ps.Name("start-memberlist") PNameLongRunningMemberlistJoin = ps.Name("long-running-memberlist-join") PNameSuffrageVoting = ps.Name("suffrage-voting") PNamePatchMemberlist = ps.Name("patch-memberlist") MemberlistContextKey = util.ContextKey("memberlist") LongRunningMemberlistJoinContextKey = util.ContextKey("long-running-memberlist-join") EventWhenMemberLeftContextKey = util.ContextKey("event-when-member-left") SuffrageVotingContextKey = util.ContextKey("suffrage-voting") SuffrageVotingVoteFuncContextKey = util.ContextKey("suffrage-voting-vote-func") FilterMemberlistNotifyMsgFuncContextKey = util.ContextKey("filter-memberlist-notify-msg-func") )
var ( PNameNetwork = ps.Name("network") PNameStartNetwork = ps.Name("start-network") PNameQuicstreamClient = ps.Name("network-client") QuicstreamClientContextKey = util.ContextKey("network-client") QuicstreamServerContextKey = util.ContextKey("quicstream-server") QuicstreamHandlersContextKey = util.ContextKey("quicstream-handlers") ConnectionPoolContextKey = util.ContextKey("network-connection-pool") )
var ( PNameNetworkHandlers = ps.Name("network-handlers") PNameOperationProcessorsMap = ps.Name("operation-processors-map") OperationProcessorsMapContextKey = util.ContextKey("operation-processors-map") )
var ( //revive:disable:line-length-limit HandlerNameMemberlistCallbackBroadcastMessage quicstream.HandlerName = "memberlist_callback_broadcast_message" HandlerNameMemberlistEnsureBroadcastMessage quicstream.HandlerName = "memberlist_ensure_broadcast_message" )
var ( ReadNodeHeaderHint = hint.MustNewHint("read-node-header-v0.0.1") WriteNodeHeaderHint = hint.MustNewHint("write-node-header-v0.0.1") )
var ( HandlerNameNodeRead quicstream.HandlerName = "node_read" HandlerNameNodeWrite quicstream.HandlerName = "node_write" )
var ( DesignACLScope = ACLScope("design") StatesAllowConsensusACLScope = ACLScope("states.allow_consensus") DiscoveryACLScope = ACLScope("discovery") ACLACLScope = ACLScope("acl") BlockItemFilesACLScope = ACLScope("block_item_files") )
var ( PNameNodeInfo = ps.Name("nodeinfo") NodeInfoContextKey = util.ContextKey("nodeinfo") )
var ( PNameProposalMaker = ps.Name("proposal-maker") ProposalMakerContextKey = util.ContextKey("proposal-maker") )
var ( PNameRateLimiterContextKey = ps.Name("network-ratelimiter") RateLimiterContextKey = util.ContextKey("network-ratelimiter") )
var ( PNameBlockItemReadersDecompressFunc = ps.Name("block-item-readers-decompress-func") PNameBlockItemReaders = ps.Name("block-item-readers") PNameRemotesBlockItemReaderFunc = ps.Name("remotes-block-item-reader-func") BlockItemReadersDecompressFuncContextKey = util.ContextKey("block-item-readers-decompress-func") NewBlockItemReadersFuncContextKey = util.ContextKey("new-block-item-readers-func") BlockItemReadersContextKey = util.ContextKey("block-item-readers") RemotesBlockItemReaderFuncContextKey = util.ContextKey("remotes-block-item-reader-func") )
var ( PNameStatesReady = ps.Name("states-ready") PNameStates = ps.Name("states") PNameBallotbox = ps.Name("ballotbox") PNameProposalProcessors = ps.Name("proposal-processors") PNameStatesSetHandlers = ps.Name("states-set-handlers") PNameProposerSelector = ps.Name("proposer-selector") PNameBallotStuckResolver = ps.Name("ballot-stuck-resolver") BallotboxContextKey = util.ContextKey("ballotbox") StatesContextKey = util.ContextKey("states") ProposalProcessorsContextKey = util.ContextKey("proposal-processors") ProposerSelectFuncContextKey = util.ContextKey("proposer-select-func") ProposalSelectFuncContextKey = util.ContextKey("proposal-select-func") WhenNewBlockSavedInSyncingStateFuncContextKey = util.ContextKey("when-new-block-saved-in-syncing-state-func") WhenNewBlockSavedInConsensusStateFuncContextKey = util.ContextKey("when-new-block-saved-in-consensus-state-func") WhenNewBlockConfirmedFuncContextKey = util.ContextKey("when-new-block-confirmed-func") BallotStuckResolverContextKey = util.ContextKey("ballot-stuck-resolver") )
var ( PNameStorage = ps.Name("storage") PNameStartStorage = ps.Name("start-storage") PNameCheckLeveldbStorage = ps.Name("check-leveldb-storage") PNameLoadFromDatabase = ps.Name("load-from-database") PNameCleanStorage = ps.Name("clean-storage") PNameCreateLocalFS = ps.Name("create-localfs") PNameCheckLocalFS = ps.Name("check-localfs") PNameLoadDatabase = ps.Name("load-database") PNameCheckBlocksOfStorage = ps.Name("check-blocks-of-storage") PNamePatchBlockItemReaders = ps.Name("patch-block-item-readers") FSNodeInfoContextKey = util.ContextKey("fs-node-info") LeveldbStorageContextKey = util.ContextKey("leveldb-storage") CenterDatabaseContextKey = util.ContextKey("center-database") PermanentDatabaseContextKey = util.ContextKey("permanent-database") PoolDatabaseContextKey = util.ContextKey("pool-database") LastVoteproofsHandlerContextKey = util.ContextKey("last-voteproofs-handler") EventLoggingContextKey = util.ContextKey("event-log") )
var ( LocalFSDataDirectoryName = "data" LocalFSDatabaseDirectoryName = "db" LocalFSEventDatabaseDirectoryName = "event" LeveldbURIScheme = "leveldb" RedisPermanentDatabasePrefixFormat = "mitum-%s" )
var ( PNameSuffrageCandidateLimiterSet = ps.Name("suffrage-candidate-limiter-set") PNamePatchLastConsensusNodesWatcher = ps.Name("patch-last-consensus-nodes-watcher") PNameLastConsensusNodesWatcher = ps.Name("last-consensus-nodes-watcher") PNameStartLastConsensusNodesWatcher = ps.Name("start-last-consensus-nodes-watcher") PNameNodeInConsensusNodesFunc = ps.Name("node-in-consensus-nodes-func") SuffrageCandidateLimiterSetContextKey = util.ContextKey("suffrage-candidate-limiter-set") LastConsensusNodesWatcherContextKey = util.ContextKey("last-consensus-nodes-watcher") NodeInConsensusNodesFuncContextKey = util.ContextKey("node-in-consensus-nodes-func") SuffragePoolContextKey = util.ContextKey("suffrage-pool") )
var ( PNameSyncSourceChecker = ps.Name("sync-source-checker") PNameStartSyncSourceChecker = ps.Name("start-sync-source-checker") SyncSourceCheckerContextKey = util.ContextKey("sync-source-checker") SyncSourcePoolContextKey = util.ContextKey("sync-source-pool") )
var ( PNameTimeSyncer = ps.Name("time-syncer") TimeSyncerContextKey = util.ContextKey("time-syncer") )
var ( PNameLogging = ps.Name("logging") PNameLoggingWithCLI = ps.Name("logging-cli") )
var ( VersionContextKey = util.ContextKey("version") FlagsContextKey = util.ContextKey("flags") KongContextContextKey = util.ContextKey("kong-context") LoggingContextKey = util.ContextKey("logging") LogOutContextKey = util.ContextKey("log-out") )
var ( RateLimiterLimiterNameContextKey = util.ContextKey("ratelimit-limiter-name") RateLimiterClientIDContextKey = util.ContextKey("ratelimit-limiter-clientid") RateLimiterResultContextKey = util.ContextKey("ratelimit-limiter-result") RateLimiterResultAllowedContextKey = util.ContextKey("ratelimit-limiter-result-allowed") )
var AllACLScopes = []ACLScope{ DesignACLScope, StatesAllowConsensusACLScope, DiscoveryACLScope, ACLACLScope, HandoverACLScope, EventLoggingACLScope, }
var AllEventLoggerNames = []EventLoggerName{ AllEventLogger, UnknownEventLogger, NodeEventLogger, NodeReadWriteEventLogger, HandoverEventLogger, ACLEventLogger, EventLoggingEventLogger, BlockItemFilesEventLogger, }
var AllNodeReadKeys = []string{
"states.allow_consensus",
"design._source",
"design._generated",
"discovery",
"acl",
"block_item_files",
}
var AllNodeWriteKeys = []string{
"states.allow_consensus",
"design.parameters.isaac.threshold",
"design.parameters.isaac.interval_broadcast_ballot",
"design.parameters.isaac.wait_preparing_init_ballot",
"design.parameters.isaac.max_try_handover_y_broker_sync_data",
"design.parameters.misc.sync_source_checker_interval",
"design.parameters.misc.valid_proposal_operation_expire",
"design.parameters.misc.valid_proposal_suffrage_operations_expire",
"design.parameters.misc.max_message_size",
"design.parameters.memberlist.extra_same_member_limit",
"design.parameters.network.timeout_request",
"design.parameters.network.ratelimit",
"design.sync_sources",
"discovery",
"acl",
}
var DefaultDesignURI = "./config.yml"
var ErrACLAccessDenied = util.NewIDError("access denied")
var (
ErrRateLimited = util.NewIDError("over ratelimit")
)
var EventLoggingACLScope = ACLScope("event-log")
var EventLoggingHeaderHint = hint.MustNewHint("event-header-v0.0.1")
var (
HandlerNameEventLogging quicstream.HandlerName = "event"
)
var HandlerNameMemberlist quicstream.HandlerName = "memberlist"
var HandoverACLScope = ACLScope("handover")
var Hinters = []encoder.DecodeDetail{ {Hint: DefaultNodeInfoHint, Instance: DefaultNodeInfo{}}, {Hint: EventLoggingHeaderHint, Instance: EventLoggingHeader{}}, {Hint: base.BaseOperationProcessReasonErrorHint, Instance: base.BaseOperationProcessReasonError{}}, {Hint: base.BaseStateHint, Instance: base.BaseState{}}, {Hint: base.MPrivatekeyHint, Instance: &base.MPrivatekey{}}, {Hint: base.MPublickeyHint, Instance: &base.MPublickey{}}, {Hint: base.OperationFixedtreeHint, Instance: base.OperationFixedtreeNode{}}, {Hint: base.StateFixedtreeHint, Instance: fixedtree.BaseNode{}}, {Hint: base.StringAddressHint, Instance: base.StringAddress{}}, {Hint: isaac.ACCEPTBallotFactHint, Instance: isaac.ACCEPTBallotFact{}}, {Hint: isaac.ACCEPTBallotHint, Instance: isaac.ACCEPTBallot{}}, {Hint: isaac.ACCEPTBallotSignFactHint, Instance: isaac.ACCEPTBallotSignFact{}}, {Hint: isaac.ACCEPTVoteproofHint, Instance: isaac.ACCEPTVoteproof{}}, {Hint: isaac.ACCEPTExpelVoteproofHint, Instance: isaac.ACCEPTExpelVoteproof{}}, {Hint: isaac.ACCEPTStuckVoteproofHint, Instance: isaac.ACCEPTStuckVoteproof{}}, {Hint: isaac.FixedSuffrageCandidateLimiterRuleHint, Instance: isaac.FixedSuffrageCandidateLimiterRule{}}, {Hint: isaac.INITBallotFactHint, Instance: isaac.INITBallotFact{}}, {Hint: isaac.EmptyProposalINITBallotFactHint, Instance: isaac.EmptyProposalINITBallotFact{}}, {Hint: isaac.EmptyOperationsACCEPTBallotFactHint, Instance: isaac.EmptyOperationsACCEPTBallotFact{}}, {Hint: isaac.NotProcessedACCEPTBallotFactHint, Instance: isaac.NotProcessedACCEPTBallotFact{}}, {Hint: isaac.INITBallotHint, Instance: isaac.INITBallot{}}, {Hint: isaac.INITBallotSignFactHint, Instance: isaac.INITBallotSignFact{}}, {Hint: isaac.INITVoteproofHint, Instance: isaac.INITVoteproof{}}, {Hint: isaac.INITExpelVoteproofHint, Instance: isaac.INITExpelVoteproof{}}, {Hint: isaac.INITStuckVoteproofHint, Instance: isaac.INITStuckVoteproof{}}, {Hint: isaac.ParamsHint, Instance: &isaac.Params{}}, {Hint: isaac.ManifestHint, Instance: isaac.Manifest{}}, {Hint: isaac.NetworkPolicyHint, Instance: isaac.NetworkPolicy{}}, {Hint: isaac.NetworkPolicyStateValueHint, Instance: isaac.NetworkPolicyStateValue{}}, {Hint: isaac.NodeHint, Instance: base.BaseNode{}}, {Hint: isaac.ProposalFactHint, Instance: isaac.ProposalFact{}}, {Hint: isaac.ProposalSignFactHint, Instance: isaac.ProposalSignFact{}}, {Hint: isaac.SuffrageConfirmBallotFactHint, Instance: isaac.SuffrageConfirmBallotFact{}}, {Hint: isaac.SuffrageCandidateStateValueHint, Instance: isaac.SuffrageCandidateStateValue{}}, {Hint: isaac.SuffrageCandidatesStateValueHint, Instance: isaac.SuffrageCandidatesStateValue{}}, {Hint: isaac.SuffrageNodeStateValueHint, Instance: isaac.SuffrageNodeStateValue{}}, {Hint: isaac.SuffrageNodesStateValueHint, Instance: isaac.SuffrageNodesStateValue{}}, {Hint: isaac.SuffrageExpelOperationHint, Instance: isaac.SuffrageExpelOperation{}}, {Hint: isaacblock.BlockMapHint, Instance: isaacblock.BlockMap{}}, {Hint: isaac.BlockItemFileHint, Instance: isaac.BlockItemFile{}}, {Hint: isaac.BlockItemFilesHint, Instance: isaac.BlockItemFiles{}}, {Hint: isaacblock.SuffrageProofHint, Instance: isaacblock.SuffrageProof{}}, { Hint: isaacnetwork.ExistsInStateOperationRequestHeaderHint, Instance: isaacnetwork.ExistsInStateOperationRequestHeader{}, }, {Hint: isaacnetwork.SetAllowConsensusHeaderHint, Instance: isaacnetwork.SetAllowConsensusHeader{}}, {Hint: isaacnetwork.BlockItemRequestHeaderHint, Instance: isaacnetwork.BlockItemRequestHeader{}}, {Hint: isaacnetwork.BlockItemFilesRequestHeaderHint, Instance: isaacnetwork.BlockItemFilesRequestHeader{}}, {Hint: isaacnetwork.BlockMapRequestHeaderHint, Instance: isaacnetwork.BlockMapRequestHeader{}}, {Hint: isaacnetwork.LastBlockMapRequestHeaderHint, Instance: isaacnetwork.LastBlockMapRequestHeader{}}, {Hint: isaacnetwork.LastSuffrageProofRequestHeaderHint, Instance: isaacnetwork.LastSuffrageProofRequestHeader{}}, {Hint: isaacnetwork.NodeChallengeRequestHeaderHint, Instance: isaacnetwork.NodeChallengeRequestHeader{}}, {Hint: isaacnetwork.NodeInfoHint, Instance: isaacnetwork.NodeInfo{}}, {Hint: isaacnetwork.NodeInfoRequestHeaderHint, Instance: isaacnetwork.NodeInfoRequestHeader{}}, {Hint: isaacnetwork.OperationRequestHeaderHint, Instance: isaacnetwork.OperationRequestHeader{}}, {Hint: isaacnetwork.ProposalRequestHeaderHint, Instance: isaacnetwork.ProposalRequestHeader{}}, {Hint: isaacnetwork.RequestProposalRequestHeaderHint, Instance: isaacnetwork.RequestProposalRequestHeader{}}, {Hint: isaacnetwork.SendBallotsHeaderHint, Instance: isaacnetwork.SendBallotsHeader{}}, {Hint: isaacnetwork.SendOperationRequestHeaderHint, Instance: isaacnetwork.SendOperationRequestHeader{}}, {Hint: isaacnetwork.StateRequestHeaderHint, Instance: isaacnetwork.StateRequestHeader{}}, {Hint: isaacnetwork.StreamOperationsHeaderHint, Instance: isaacnetwork.StreamOperationsHeader{}}, { Hint: isaacnetwork.SuffrageNodeConnInfoRequestHeaderHint, Instance: isaacnetwork.SuffrageNodeConnInfoRequestHeader{}, }, {Hint: isaacnetwork.SuffrageProofRequestHeaderHint, Instance: isaacnetwork.SuffrageProofRequestHeader{}}, {Hint: isaacnetwork.AskHandoverHeaderHint, Instance: isaacnetwork.AskHandoverHeader{}}, {Hint: isaacnetwork.AskHandoverResponseHeaderHint, Instance: isaacnetwork.AskHandoverResponseHeader{}}, {Hint: isaacnetwork.BlockItemResponseHeaderHint, Instance: isaacnetwork.BlockItemResponseHeader{}}, {Hint: isaacnetwork.CancelHandoverHeaderHint, Instance: isaacnetwork.CancelHandoverHeader{}}, {Hint: isaacnetwork.CheckHandoverHeaderHint, Instance: isaacnetwork.CheckHandoverHeader{}}, {Hint: isaacnetwork.CheckHandoverXHeaderHint, Instance: isaacnetwork.CheckHandoverXHeader{}}, {Hint: isaacnetwork.HandoverMessageHeaderHint, Instance: isaacnetwork.HandoverMessageHeader{}}, {Hint: isaacnetwork.StartHandoverHeaderHint, Instance: isaacnetwork.StartHandoverHeader{}}, {Hint: isaacnetwork.SyncSourceConnInfoRequestHeaderHint, Instance: isaacnetwork.SyncSourceConnInfoRequestHeader{}}, {Hint: isaacoperation.GenesisNetworkPolicyFactHint, Instance: isaacoperation.GenesisNetworkPolicyFact{}}, {Hint: isaacoperation.GenesisNetworkPolicyHint, Instance: isaacoperation.GenesisNetworkPolicy{}}, {Hint: isaacoperation.NetworkPolicyHint, Instance: isaacoperation.NetworkPolicy{}}, {Hint: isaacoperation.SuffrageCandidateHint, Instance: isaacoperation.SuffrageCandidate{}}, {Hint: isaacoperation.SuffrageGenesisJoinHint, Instance: isaacoperation.SuffrageGenesisJoin{}}, {Hint: isaacoperation.SuffrageDisjoinHint, Instance: isaacoperation.SuffrageDisjoin{}}, {Hint: isaacoperation.SuffrageJoinHint, Instance: isaacoperation.SuffrageJoin{}}, { Hint: isaacoperation.SuffrageGenesisJoinFactHint, Instance: isaacoperation.SuffrageGenesisJoinFact{}, }, {Hint: isaacstates.MissingBallotsRequestsMessageHint, Instance: isaacstates.MissingBallotsRequestMessage{}}, {Hint: isaacstates.HandoverMessageCancelHint, Instance: isaacstates.HandoverMessageCancel{}}, {Hint: isaacstates.HandoverMessageChallengeBlockMapHint, Instance: isaacstates.HandoverMessageChallengeBlockMap{}}, {Hint: isaacstates.HandoverMessageChallengeResponseHint, Instance: isaacstates.HandoverMessageChallengeResponse{}}, { Hint: isaacstates.HandoverMessageChallengeStagePointHint, Instance: isaacstates.HandoverMessageChallengeStagePoint{}, }, {Hint: isaacstates.HandoverMessageDataHint, Instance: isaacstates.HandoverMessageData{}}, {Hint: isaacstates.HandoverMessageFinishHint, Instance: isaacstates.HandoverMessageFinish{}}, {Hint: quicmemberlist.ConnInfoBroadcastMessageHint, Instance: quicmemberlist.ConnInfoBroadcastMessage{}}, { Hint: quicmemberlist.CallbackBroadcastMessageHeaderHint, Instance: quicmemberlist.CallbackBroadcastMessageHeader{}, }, { Hint: quicmemberlist.EnsureBroadcastMessageHeaderHint, Instance: quicmemberlist.EnsureBroadcastMessageHeader{}, }, {Hint: quicmemberlist.MemberHint, Instance: quicmemberlist.BaseMember{}}, {Hint: quicstreamheader.DefaultResponseHeaderHint, Instance: quicstreamheader.DefaultResponseHeader{}}, {Hint: ReadNodeHeaderHint, Instance: ReadNodeHeader{}}, {Hint: WriteNodeHeaderHint, Instance: WriteNodeHeader{}}, }
var LeveldbLabelEventDatabase = leveldbstorage.KeyPrefix{0x02, 0x00}
var (
NetworkHandlerPrefixMapRev = map[quicstream.HandlerPrefix]quicstream.HandlerName{}
)
var PNameEventLoggingNetworkHandlers = ps.Name("event-log-network-handlers")
var PNameGenerateGenesis = ps.Name("generate-genesis")
var PNameHandoverNetworkHandlers = ps.Name("handover-network-handlers")
var PNameNetworkHandlersReadWriteNode = ps.Name("node-network-handler")
var PNameStatesNetworkHandlers = ps.Name("states-network-handlers")
var SupportedProposalOperationFactHinters = []encoder.DecodeDetail{ {Hint: isaac.SuffrageExpelFactHint, Instance: isaac.SuffrageExpelFact{}}, {Hint: isaacoperation.SuffrageCandidateFactHint, Instance: isaacoperation.SuffrageCandidateFact{}}, {Hint: isaacoperation.SuffrageDisjoinFactHint, Instance: isaacoperation.SuffrageDisjoinFact{}}, {Hint: isaacoperation.SuffrageJoinFactHint, Instance: isaacoperation.SuffrageJoinFact{}}, {Hint: isaacoperation.NetworkPolicyFactHint, Instance: isaacoperation.NetworkPolicyFact{}}, }
Functions ¶
func ACLNetworkHandler ¶
func ACLNetworkHandler[T quicstreamheader.RequestHeader]( aclallow ACLAllowFunc, scope ACLScope, required ACLPerm, networkID base.NetworkID, ) quicstreamheader.Handler[T]
func AttachHandlerOperation ¶
func AttachHandlerProposals ¶
func CleanStorage ¶
func DecodePrivatekey ¶
func DefaultDialQuicConfig ¶
func DefaultDialQuicConfig() *quic.Config
func DefaultINITPS ¶
func DefaultImportPS ¶
func DefaultMainPS ¶
func DefaultRunPS ¶
func DefaultServerQuicConfig ¶
func DefaultServerQuicConfig() *quic.Config
func DefaultWhenNewBlockSavedInConsensusStateFunc ¶
func DefaultWhenNewBlockSavedInConsensusStateFunc( log *logging.Logging, ballotbox *isaacstates.Ballotbox, db isaac.Database, nodeinfo *isaacnetwork.NodeInfoUpdater, ) func(base.BlockMap)
func DefaultWhenNewBlockSavedInSyncingStateFunc ¶
func DefaultWhenNewBlockSavedInSyncingStateFunc( log *logging.Logging, db isaac.Database, nodeinfo *isaacnetwork.NodeInfoUpdater, ) func(base.Height)
func DialQuicConfig ¶
func DialQuicConfig(params *NetworkParams) *quic.Config
func EnsureHandlerAdd ¶
func EnsureHandlerAdd[T quicstreamheader.RequestHeader]( pctx context.Context, gerr *error, name quicstream.HandlerName, handler quicstreamheader.Handler[T], errhandler quicstreamheader.ErrorHandler, )
func EventLoggingFromNetworkHandler ¶
func EventLoggingFromNetworkHandler( ctx context.Context, stream quicstreamheader.StreamFunc, header EventLoggingHeader, priv base.Privatekey, networkID base.NetworkID, f func(addedAt time.Time, offset int64, raw []byte) (bool, error), ) error
func EventNameKeyPrefix ¶
func EventNameKeyPrefix(name EventLoggerName) [32]byte
func FixedSuffrageCandidateLimiterFunc ¶
func FixedSuffrageCandidateLimiterFunc() func( base.SuffrageCandidateLimiterRule, ) (base.SuffrageCandidateLimiter, error)
func GetDiscoveriesFromLocked ¶
func GetDiscoveriesFromLocked(l *util.Locked[[]quicstream.ConnInfo]) []quicstream.ConnInfo
func ImportBlocks ¶
func ImportBlocks( fromreaders *isaac.BlockItemReaders, fromremotes isaac.RemotesBlockItemReadFunc, toreaders *isaac.BlockItemReaders, fromHeight, toHeight base.Height, encs *encoder.Encoders, db isaac.Database, params *isaac.Params, ) error
func IsValidSyncSourcesDesign ¶
func IsValidSyncSourcesDesign( d *SyncSourcesDesign, localPublishString, localPublishResolved string, ) error
func LoadDatabase ¶
func LoadDatabase( fsnodeinfo NodeInfo, permuri string, root string, encs *encoder.Encoders, enc encoder.Encoder, stcachesize, oppoolcachesize int, ) ( *leveldbstorage.Storage, *isaacdatabase.Center, isaac.PermanentDatabase, *isaacdatabase.TempPool, error, )
func LoadDefaultEventStorage ¶
func LoadDefaultEventStorage( dir string, readonly bool, ) (*leveldbstorage.Storage, error)
func LoadEventInfoFromKey ¶
func LoadHinters ¶
func LoadPermanentDatabase ¶
func LoadRawEvent ¶
func LocalFSDataDirectory ¶
func LocalFromDesign ¶
func LocalFromDesign(design NodeDesign) (base.LocalNode, error)
func MajoritySuffrageCandidateLimiterFunc ¶
func MajoritySuffrageCandidateLimiterFunc( db isaac.Database, ) func(base.SuffrageCandidateLimiterRule) (base.SuffrageCandidateLimiter, error)
func NewBlockWriterFunc ¶
func NewConnInfoDialFunc ¶
func NewConnInfoDialFunc(networkID base.NetworkID, params *NetworkParams) quicstream.ConnInfoDialFunc
func NewConnectionPool ¶
func NewConnectionPool( size uint64, networkID base.NetworkID, params *NetworkParams, ) (*quicstream.ConnectionPool, error)
func NewNetworkClient ¶
func NewNetworkClient( encs *encoder.Encoders, enc encoder.Encoder, connectionPool *quicstream.ConnectionPool, ) *isaacnetwork.BaseClient
func NewProposalSelector ¶
func NewProposalSelector(pctx context.Context) (*isaac.BaseProposalSelector, error)
func NewSuffrageCandidateLimiterFunc ¶
func NewSuffrageCandidateLimiterFunc(pctx context.Context) ( func(base.Height, base.GetStateFunc) (base.OperationProcessorProcessFunc, error), error, )
func OperationPreProcess ¶
func PBallotStuckResolver ¶
func PCheckAndCreateLocalFS ¶
func PCheckBlocksOfStorage ¶
func PCheckLeveldbStorage ¶
func PCloseSyncSourceChecker ¶
func POperationProcessorsMap ¶
func PPatchBlockItemReaders ¶
func PPatchMemberlist ¶
func PStartSyncSourceChecker ¶
func PStatesNetworkHandlers ¶
func QuicstreamHandlerEventLogging ¶
func QuicstreamHandlerEventLogging( aclhandler quicstreamheader.Handler[EventLoggingHeader], eventLogging *EventLogging, maxItem uint64, ) (quicstreamheader.Handler[EventLoggingHeader], error)
func QuicstreamHandlerGetNodeInfoFunc ¶
func QuicstreamHandlerGetNodeInfoFunc( enc encoder.Encoder, nodeinfo *isaacnetwork.NodeInfoUpdater, ) func() ([]byte, error)
func QuicstreamHandlerSuffrageNodeConnInfoFunc ¶
func QuicstreamHandlerSuffrageNodeConnInfoFunc( db isaac.Database, memberlist *quicmemberlist.Memberlist, ) func() ([]isaac.NodeConnInfo, error)
func ReadNodeFromNetworkHandler ¶
func ReadNodeFromNetworkHandler( ctx context.Context, priv base.Privatekey, networkID base.NetworkID, key string, stream quicstreamheader.StreamFunc, ) (t interface{}, found bool, _ error)
func RemoveLocalFS ¶
func SaveNodeInfo ¶
func SendOperationFilterFunc ¶
func ServerQuicConfig ¶
func ServerQuicConfig(params *NetworkParams) *quic.Config
func SetupLoggingFromFlags ¶
func UpdateNodeInfoWithNewBlock ¶
func UpdateNodeInfoWithNewBlock( db isaac.Database, nodeinfo *isaacnetwork.NodeInfoUpdater, ) error
func WriteNodeFromNetworkHandler ¶
func WriteNodeFromNetworkHandler( ctx context.Context, priv base.Privatekey, networkID base.NetworkID, key string, value string, stream quicstreamheader.StreamFunc, ) (found bool, _ error)
Types ¶
type ACLAllowFunc ¶
type ACLAllowFunc func( _ context.Context, user string, scope ACLScope, required ACLPerm, extra *zerolog.Event, ) bool
func NewACLAllowFunc ¶
func NewACLAllowFunc(acl *ACL, el *zerolog.Logger) ACLAllowFunc
type ACLFlags ¶
type ACLFlags struct { //revive:disable:line-length-limit Flag SecretFlag `name:"acl" help:"acl uri; './acl.yml', 'file:///acl.yml', 'vault://a.b.c.d/acl'" placeholder:"URL"` }
type ACLPerm ¶
type ACLPerm uint8
func NewAllowACLPerm ¶
func (ACLPerm) MarshalText ¶
func (*ACLPerm) UnmarshalText ¶
type AddressFlag ¶
type AddressFlag struct {
// contains filtered or unexported fields
}
func (AddressFlag) Address ¶
func (f AddressFlag) Address() base.Address
func (*AddressFlag) UnmarshalText ¶
func (f *AddressFlag) UnmarshalText(b []byte) error
type BaseFlags ¶
type BaseFlags struct {
LoggingFlags `embed:"" prefix:"log."`
}
type ClientIDRateLimiterRuleSet ¶
type ClientIDRateLimiterRuleSet struct {
StringKeyRateLimiterRuleSet
}
func NewClientIDRateLimiterRuleSet ¶
func NewClientIDRateLimiterRuleSet( rules map[string]RateLimiterRuleMap, ) ClientIDRateLimiterRuleSet
func (ClientIDRateLimiterRuleSet) Rule ¶
func (rs ClientIDRateLimiterRuleSet) Rule( _ net.Addr, handler string, hint RateLimitRuleHint, ) (_ string, rule RateLimiterRule, _ string, _ bool)
type ConnInfoFlag ¶
type ConnInfoFlag struct {
// contains filtered or unexported fields
}
func (*ConnInfoFlag) ConnInfo ¶
func (f *ConnInfoFlag) ConnInfo() quicstream.ConnInfo
func (ConnInfoFlag) MarshalText ¶
func (f ConnInfoFlag) MarshalText() ([]byte, error)
func (ConnInfoFlag) String ¶
func (f ConnInfoFlag) String() string
func (*ConnInfoFlag) UnmarshalText ¶
func (f *ConnInfoFlag) UnmarshalText(b []byte) error
type DefaultNodeInfo ¶
type DefaultNodeInfo struct { hint.BaseHinter // contains filtered or unexported fields }
func CreateDefaultNodeInfo ¶
func CreateDefaultNodeInfo(networkID base.NetworkID, version util.Version) DefaultNodeInfo
func NewDefaultNodeInfo ¶
func (DefaultNodeInfo) CreatedAt ¶
func (info DefaultNodeInfo) CreatedAt() time.Time
func (DefaultNodeInfo) ID ¶
func (info DefaultNodeInfo) ID() string
func (DefaultNodeInfo) IsValid ¶
func (info DefaultNodeInfo) IsValid([]byte) error
func (DefaultNodeInfo) LastStartedAt ¶
func (info DefaultNodeInfo) LastStartedAt() time.Time
func (DefaultNodeInfo) MarshalJSON ¶
func (info DefaultNodeInfo) MarshalJSON() ([]byte, error)
func (DefaultNodeInfo) NetworkID ¶
func (info DefaultNodeInfo) NetworkID() base.NetworkID
func (*DefaultNodeInfo) UnmarshalJSON ¶
func (info *DefaultNodeInfo) UnmarshalJSON(b []byte) error
func (DefaultNodeInfo) UpdateLastStartedAt ¶
func (info DefaultNodeInfo) UpdateLastStartedAt() NodeInfo
func (DefaultNodeInfo) Version ¶
func (info DefaultNodeInfo) Version() util.Version
type DesignFlag ¶
type DesignFlag struct { //revive:disable:line-length-limit URI DesignURIFlag `name:"design" help:"design uri; 'file:///config.yml', 'https://a.b.c.d/config.yml'" group:"design" default:"${design_uri}"` URLProperties `embed:"" prefix:"design." group:"design"` }
DesignFlag is the flag for loading design from various locations. Only one location is allowed. For example, - "--design=./no0sas.yml", or - "--design=https://a.b.c.d/no0sas.yml", or - "--design=consul://a.b.c.d:8500/no0sas/design", or - "--design=consul:///no0sas/design": If address not set, the environment variables of consul will be used.
func (DesignFlag) Properties ¶
func (f DesignFlag) Properties() URLProperties
func (DesignFlag) Scheme ¶
func (f DesignFlag) Scheme() string
func (DesignFlag) URL ¶
func (f DesignFlag) URL() *url.URL
type DesignURIFlag ¶
type DesignURIFlag struct {
// contains filtered or unexported fields
}
func (*DesignURIFlag) UnmarshalText ¶
func (f *DesignURIFlag) UnmarshalText(b []byte) error
type DevFlags ¶
type DevFlags struct { //revive:disable:line-length-limit //revive:disable:struct-tag AllowRiskyThreshold bool `name:"allow-risky-threshold" help:"allow risky threshold under threshold, ${safe_threshold}" group:"dev"` DelaySyncer time.Duration `name:"delay-syncer" help:"initial delay when sync one block" group:"dev"` AllowConsensus bool `name:"allow-consensus" help:"allow to enter consensus" group:"dev"` ExitBroken bool `name:"exit-broken" help:"exit broken state" group:"dev"` }
type EventLoggerName ¶
type EventLoggerName string
var ( UnknownEventLogger EventLoggerName = "unknown" AllEventLogger EventLoggerName = "all" )
var ACLEventLogger EventLoggerName = "acl"
var BlockItemFilesEventLogger EventLoggerName = "block-item-files"
var EventLoggingEventLogger EventLoggerName = "event_logging"
var HandoverEventLogger EventLoggerName = "handover"
var NodeEventLogger EventLoggerName = "node"
var NodeReadWriteEventLogger EventLoggerName = "node_readwrite"
type EventLogging ¶
type EventLogging struct {
// contains filtered or unexported fields
}
func NewEventLogging ¶
func NewEventLogging(root string, defaultwriter io.Writer) (*EventLogging, error)
func (*EventLogging) Close ¶
func (el *EventLogging) Close() error
func (*EventLogging) Logger ¶
func (el *EventLogging) Logger(name EventLoggerName) (zerolog.Logger, bool)
func (*EventLogging) Register ¶
func (el *EventLogging) Register(name EventLoggerName) (l zerolog.Logger, _ error)
type EventLoggingHeader ¶
type EventLoggingHeader struct { isaacnetwork.BaseHeader // contains filtered or unexported fields }
func NewEventLoggingHeader ¶
func NewEventLoggingHeader( name EventLoggerName, offsets [2]int64, limit uint64, sort bool, acluser base.Publickey, ) EventLoggingHeader
func (EventLoggingHeader) ACLUser ¶
func (h EventLoggingHeader) ACLUser() base.Publickey
func (*EventLoggingHeader) DecodeJSON ¶
func (h *EventLoggingHeader) DecodeJSON(b []byte, enc encoder.Encoder) error
func (EventLoggingHeader) IsValid ¶
func (h EventLoggingHeader) IsValid([]byte) error
func (EventLoggingHeader) Limit ¶
func (h EventLoggingHeader) Limit() uint64
func (EventLoggingHeader) MarshalJSON ¶
func (h EventLoggingHeader) MarshalJSON() ([]byte, error)
func (EventLoggingHeader) Name ¶
func (h EventLoggingHeader) Name() EventLoggerName
func (EventLoggingHeader) Offsets ¶
func (h EventLoggingHeader) Offsets() [2]int64
func (EventLoggingHeader) Sort ¶
func (h EventLoggingHeader) Sort() bool
type GenesisBlockGenerator ¶
type GenesisDesign ¶
func GenesisDesignFromFile ¶
func (*GenesisDesign) DecodeYAML ¶
func (d *GenesisDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
func (*GenesisDesign) IsValid ¶
func (*GenesisDesign) IsValid([]byte) error
type GenesisDesignYAMLUnmarshaler ¶
type GenesisDesignYAMLUnmarshaler struct {
Facts []interface{} `json:"facts" yaml:"facts"`
}
type HeightFlag ¶
type HeightFlag struct {
// contains filtered or unexported fields
}
func (*HeightFlag) Height ¶
func (f *HeightFlag) Height() base.Height
func (*HeightFlag) IsSet ¶
func (f *HeightFlag) IsSet() bool
func (*HeightFlag) UnmarshalText ¶
func (f *HeightFlag) UnmarshalText(b []byte) error
type LocalParams ¶
type LocalParams struct { // ISAAC sets the consensus related parameters. ISAAC *isaac.Params `yaml:"isaac,omitempty" json:"isaac,omitempty"` // Memberlist sets the memberlist parameters. memberlist handles the // connections of suffrage nodes. For details, see // https://pkg.go.dev/github.com/hashicorp/memberlist#Config . Memberlist *MemberlistParams `yaml:"memberlist,omitempty" json:"memberlist,omitempty"` // Network sets the network related parameters. For details, see // https://pkg.go.dev/github.com/quic-go/quic-go#Config . Network *NetworkParams `yaml:"network,omitempty" json:"network,omitempty"` // MISC sets misc parameters. MISC *MISCParams `yaml:"misc,omitempty" json:"misc,omitempty"` }
func (*LocalParams) DecodeYAML ¶
func (p *LocalParams) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
func (*LocalParams) MarshalYAML ¶
func (p *LocalParams) MarshalYAML() (interface{}, error)
type LocalParamsYAMLUnmarshaler ¶
type LocalParamsYAMLUnmarshaler struct { ISAAC map[string]interface{} `yaml:"isaac"` Memberlist *MemberlistParams `yaml:"memberlist,omitempty"` MISC *MISCParams `yaml:"misc,omitempty"` Network *NetworkParams `yaml:"network,omitempty"` }
type LogLevelFlag ¶
type LogLevelFlag struct {
// contains filtered or unexported fields
}
func (LogLevelFlag) Level ¶
func (f LogLevelFlag) Level() zerolog.Level
func (LogLevelFlag) String ¶
func (f LogLevelFlag) String() string
func (*LogLevelFlag) UnmarshalText ¶
func (f *LogLevelFlag) UnmarshalText(b []byte) error
type LogOutFlag ¶
type LogOutFlag string
type LoggingFlags ¶
type LoggingFlags struct { //revive:disable:line-length-limit //revive:disable:struct-tag Format string `enum:"json, terminal" default:"${log_format}" help:"log format: {${enum}}" group:"logging"` Out []LogOutFlag `name:"out" default:"${log_out}" help:"log output file: {stdout, stderr, <file>}" group:"logging"` Level LogLevelFlag `name:"level" default:"${log_level}" help:"log level: {trace, debug, info, warn, error}" group:"logging"` ForceColor bool `name:"force-color" default:"${log_force_color}" negatable:"" help:"log force color" group:"logging"` }
type LongRunningMemberlistJoin ¶
type LongRunningMemberlistJoin struct {
// contains filtered or unexported fields
}
func NewLongRunningMemberlistJoin ¶
func NewLongRunningMemberlistJoin( ensureJoin func([]quicstream.ConnInfo) (bool, error), isJoined func() bool, ) *LongRunningMemberlistJoin
func (*LongRunningMemberlistJoin) Cancel ¶
func (l *LongRunningMemberlistJoin) Cancel() error
func (*LongRunningMemberlistJoin) Join ¶
func (l *LongRunningMemberlistJoin) Join(cis ...quicstream.ConnInfo) <-chan struct{}
type MISCParams ¶
type MISCParams struct { *util.BaseParams // contains filtered or unexported fields }
func (*MISCParams) BlockItemReadersRemoveEmptyAfter ¶
func (p *MISCParams) BlockItemReadersRemoveEmptyAfter() time.Duration
BlockItemReadersRemoveEmptyAfter removes empty block item directory after the duration. Zero duration not allowed.
func (*MISCParams) BlockItemReadersRemoveEmptyInterval ¶
func (p *MISCParams) BlockItemReadersRemoveEmptyInterval() time.Duration
BlockItemReadersRemoveEmptyInterval is the interval to remove empty block item directory after BlockItemReadersRemoveEmptyAfter. Zero duration not allowed.
func (*MISCParams) IsValid ¶
func (p *MISCParams) IsValid([]byte) error
func (*MISCParams) MarshalJSON ¶
func (p *MISCParams) MarshalJSON() ([]byte, error)
func (*MISCParams) MarshalYAML ¶
func (p *MISCParams) MarshalYAML() (interface{}, error)
func (*MISCParams) MaxMessageSize ¶
func (p *MISCParams) MaxMessageSize() uint64
MaxMessageSize is the maximum size of incoming messages like ballot or operation. If message size is over, it will be ignored.
func (*MISCParams) ObjectCacheSize ¶
func (p *MISCParams) ObjectCacheSize() uint64
ObjectCacheSize is the cache size for various internal objects like address or keypair.
func (*MISCParams) SetBlockItemReadersRemoveEmptyAfter ¶
func (p *MISCParams) SetBlockItemReadersRemoveEmptyAfter(d time.Duration) error
func (*MISCParams) SetBlockItemReadersRemoveEmptyInterval ¶
func (p *MISCParams) SetBlockItemReadersRemoveEmptyInterval(d time.Duration) error
func (*MISCParams) SetMaxMessageSize ¶
func (p *MISCParams) SetMaxMessageSize(d uint64) error
func (*MISCParams) SetObjectCacheSize ¶
func (p *MISCParams) SetObjectCacheSize(d uint64) error
func (*MISCParams) SetSyncSourceCheckerInterval ¶
func (p *MISCParams) SetSyncSourceCheckerInterval(d time.Duration) error
func (*MISCParams) SetValidProposalOperationExpire ¶
func (p *MISCParams) SetValidProposalOperationExpire(d time.Duration) error
func (*MISCParams) SetValidProposalSuffrageOperationsExpire ¶
func (p *MISCParams) SetValidProposalSuffrageOperationsExpire(d time.Duration) error
func (*MISCParams) SyncSourceCheckerInterval ¶
func (p *MISCParams) SyncSourceCheckerInterval() time.Duration
SyncSourceCheckerInterval is the interval to check the liveness of sync sources.
func (*MISCParams) UnmarshalJSON ¶
func (p *MISCParams) UnmarshalJSON(b []byte) error
func (*MISCParams) UnmarshalYAML ¶
func (p *MISCParams) UnmarshalYAML(y *yaml.Node) error
func (*MISCParams) ValidProposalOperationExpire ¶
func (p *MISCParams) ValidProposalOperationExpire() time.Duration
ValidProposalOperationExpire is the maximum creation time for valid operation. If the creation time of operation is older than ValidProposalOperationExpire, it will be ignored.
func (*MISCParams) ValidProposalSuffrageOperationsExpire ¶
func (p *MISCParams) ValidProposalSuffrageOperationsExpire() time.Duration
ValidProposalSuffrageOperationsExpire is the maximum creation time for valid suffrage operations like isaacoperation.SuffrageCandidate operation. If the creation time of suffrage operation is older than ValidProposalSuffrageOperationsExpire, it will be ignored.
type MemberlistParams ¶
type MemberlistParams struct { *util.BaseParams // contains filtered or unexported fields }
func (*MemberlistParams) ExtraSameMemberLimit ¶
func (p *MemberlistParams) ExtraSameMemberLimit() uint64
func (*MemberlistParams) IsValid ¶
func (*MemberlistParams) IsValid([]byte) error
func (*MemberlistParams) MarshalJSON ¶
func (p *MemberlistParams) MarshalJSON() ([]byte, error)
func (*MemberlistParams) MarshalYAML ¶
func (p *MemberlistParams) MarshalYAML() (interface{}, error)
func (*MemberlistParams) ProbeInterval ¶
func (p *MemberlistParams) ProbeInterval() time.Duration
func (*MemberlistParams) ProbeTimeout ¶
func (p *MemberlistParams) ProbeTimeout() time.Duration
func (*MemberlistParams) RetransmitMult ¶
func (p *MemberlistParams) RetransmitMult() int
func (*MemberlistParams) SetExtraSameMemberLimit ¶
func (p *MemberlistParams) SetExtraSameMemberLimit(d uint64) error
func (*MemberlistParams) SetProbeInterval ¶
func (p *MemberlistParams) SetProbeInterval(d time.Duration) error
func (*MemberlistParams) SetProbeTimeout ¶
func (p *MemberlistParams) SetProbeTimeout(d time.Duration) error
func (*MemberlistParams) SetRetransmitMult ¶
func (p *MemberlistParams) SetRetransmitMult(d int) error
func (*MemberlistParams) SetSuspicionMaxTimeoutMult ¶
func (p *MemberlistParams) SetSuspicionMaxTimeoutMult(d int) error
func (*MemberlistParams) SetSuspicionMult ¶
func (p *MemberlistParams) SetSuspicionMult(d int) error
func (*MemberlistParams) SetTCPTimeout ¶
func (p *MemberlistParams) SetTCPTimeout(d time.Duration) error
func (*MemberlistParams) SetUDPBufferSize ¶
func (p *MemberlistParams) SetUDPBufferSize(d int) error
func (*MemberlistParams) SuspicionMaxTimeoutMult ¶
func (p *MemberlistParams) SuspicionMaxTimeoutMult() int
func (*MemberlistParams) SuspicionMult ¶
func (p *MemberlistParams) SuspicionMult() int
func (*MemberlistParams) TCPTimeout ¶
func (p *MemberlistParams) TCPTimeout() time.Duration
func (*MemberlistParams) UDPBufferSize ¶
func (p *MemberlistParams) UDPBufferSize() int
func (*MemberlistParams) UnmarshalJSON ¶
func (p *MemberlistParams) UnmarshalJSON(b []byte) error
func (*MemberlistParams) UnmarshalYAML ¶
func (p *MemberlistParams) UnmarshalYAML(y *yaml.Node) error
type NetRateLimiterRuleSet ¶
type NetRateLimiterRuleSet struct {
// contains filtered or unexported fields
}
func NewNetRateLimiterRuleSet ¶
func NewNetRateLimiterRuleSet() NetRateLimiterRuleSet
func (*NetRateLimiterRuleSet) Add ¶
func (rs *NetRateLimiterRuleSet) Add(ipnet *net.IPNet, rule RateLimiterRuleMap) *NetRateLimiterRuleSet
func (NetRateLimiterRuleSet) IsValid ¶
func (rs NetRateLimiterRuleSet) IsValid([]byte) error
func (NetRateLimiterRuleSet) MarshalJSON ¶
func (rs NetRateLimiterRuleSet) MarshalJSON() ([]byte, error)
func (NetRateLimiterRuleSet) Rule ¶
func (rs NetRateLimiterRuleSet) Rule( addr net.Addr, handler string, _ RateLimitRuleHint, ) (_ string, _ RateLimiterRule, _ string, _ bool)
func (*NetRateLimiterRuleSet) UnmarshalJSON ¶
func (rs *NetRateLimiterRuleSet) UnmarshalJSON(b []byte) error
func (NetRateLimiterRuleSet) UpdatedAt ¶
func (rs NetRateLimiterRuleSet) UpdatedAt() int64
type NetworkParams ¶
type NetworkParams struct { *util.BaseParams // contains filtered or unexported fields }
func (*NetworkParams) ConnectionPoolSize ¶
func (p *NetworkParams) ConnectionPoolSize() uint64
ConnectionPoolSize is the sharded map size for connection pool.
func (*NetworkParams) DefaultHandlerTimeout ¶
func (p *NetworkParams) DefaultHandlerTimeout() time.Duration
DefaultHandlerTimeout is the default timeout for network handlers. If handling request is over timeout, the request will be canceled by server.
func (*NetworkParams) HandlerTimeout ¶
func (p *NetworkParams) HandlerTimeout(i quicstream.HandlerName) (time.Duration, error)
HandlerTimeout is the map of timeouts for each handler. If not set in HandlerTimeout, DefaultHandlerTimeout will be used.
func (*NetworkParams) HandlerTimeoutFunc ¶
func (p *NetworkParams) HandlerTimeoutFunc(i quicstream.HandlerName) (func() time.Duration, error)
func (*NetworkParams) HandshakeIdleTimeout ¶
func (p *NetworkParams) HandshakeIdleTimeout() time.Duration
HandshakeIdleTimeout; see https://pkg.go.dev/github.com/quic-go/quic-go#Config .
func (*NetworkParams) IsValid ¶
func (p *NetworkParams) IsValid([]byte) error
func (*NetworkParams) KeepAlivePeriod ¶
func (p *NetworkParams) KeepAlivePeriod() time.Duration
KeepAlivePeriod; see https://pkg.go.dev/github.com/quic-go/quic-go#Config .
func (*NetworkParams) MarshalJSON ¶
func (p *NetworkParams) MarshalJSON() ([]byte, error)
func (*NetworkParams) MarshalYAML ¶
func (p *NetworkParams) MarshalYAML() (interface{}, error)
func (*NetworkParams) MaxIdleTimeout ¶
func (p *NetworkParams) MaxIdleTimeout() time.Duration
MaxIdleTimeout; see https://pkg.go.dev/github.com/quic-go/quic-go#Config .
func (*NetworkParams) MaxIncomingStreams ¶
func (p *NetworkParams) MaxIncomingStreams() uint64
MaxIncomingStreams; see https://pkg.go.dev/github.com/quic-go/quic-go#Config .
func (*NetworkParams) MaxStreamTimeout ¶
func (p *NetworkParams) MaxStreamTimeout() time.Duration
MaxStreamTimeout; see https://pkg.go.dev/github.com/quic-go/quic-go#Config .
func (*NetworkParams) RateLimit ¶
func (p *NetworkParams) RateLimit() *NetworkRateLimitParams
func (*NetworkParams) SetConnectionPoolSize ¶
func (p *NetworkParams) SetConnectionPoolSize(d uint64) error
func (*NetworkParams) SetDefaultHandlerTimeout ¶
func (p *NetworkParams) SetDefaultHandlerTimeout(d time.Duration) error
func (*NetworkParams) SetHandlerTimeout ¶
func (p *NetworkParams) SetHandlerTimeout(i quicstream.HandlerName, d time.Duration) error
func (*NetworkParams) SetHandshakeIdleTimeout ¶
func (p *NetworkParams) SetHandshakeIdleTimeout(d time.Duration) error
func (*NetworkParams) SetKeepAlivePeriod ¶
func (p *NetworkParams) SetKeepAlivePeriod(d time.Duration) error
func (*NetworkParams) SetMaxIdleTimeout ¶
func (p *NetworkParams) SetMaxIdleTimeout(d time.Duration) error
func (*NetworkParams) SetMaxIncomingStreams ¶
func (p *NetworkParams) SetMaxIncomingStreams(d uint64) error
func (*NetworkParams) SetMaxStreamTimeout ¶
func (p *NetworkParams) SetMaxStreamTimeout(d time.Duration) error
func (*NetworkParams) SetRateLimit ¶
func (p *NetworkParams) SetRateLimit(r *RateLimiterRules) error
func (*NetworkParams) SetTimeoutRequest ¶
func (p *NetworkParams) SetTimeoutRequest(d time.Duration) error
func (*NetworkParams) TimeoutRequest ¶
func (p *NetworkParams) TimeoutRequest() time.Duration
TimeoutRequest is the default timeout to request the other nodes; see https://pkg.go.dev/github.com/quic-go/quic-go#Config .
func (*NetworkParams) UnmarshalJSON ¶
func (p *NetworkParams) UnmarshalJSON(b []byte) error
func (*NetworkParams) UnmarshalYAML ¶
func (p *NetworkParams) UnmarshalYAML(y *yaml.Node) error
type NetworkRateLimitParams ¶
type NetworkRateLimitParams struct {
*RateLimiterRules
}
func NewNetworkRateLimitParams ¶
func NewNetworkRateLimitParams() *NetworkRateLimitParams
func (*NetworkRateLimitParams) IsValid ¶
func (p *NetworkRateLimitParams) IsValid([]byte) error
func (*NetworkRateLimitParams) MarshalJSON ¶
func (p *NetworkRateLimitParams) MarshalJSON() ([]byte, error)
func (*NetworkRateLimitParams) MarshalYAML ¶
func (p *NetworkRateLimitParams) MarshalYAML() (interface{}, error)
func (*NetworkRateLimitParams) UnmarshalJSON ¶
func (p *NetworkRateLimitParams) UnmarshalJSON(b []byte) error
func (*NetworkRateLimitParams) UnmarshalYAML ¶
func (p *NetworkRateLimitParams) UnmarshalYAML(y *yaml.Node) error
type NetworkRateLimitParamsUnmarshaler ¶
type NetworkRateLimitParamsUnmarshaler struct { Suffrage *SuffrageRateLimiterRuleSet `json:"suffrage,omitempty" yaml:"suffrage,omitempty"` Node *NodeRateLimiterRuleSet `json:"node,omitempty" yaml:"node,omitempty"` Net *NetRateLimiterRuleSet `json:"net,omitempty" yaml:"net,omitempty"` Default *RateLimiterRuleMap `json:"default,omitempty" yaml:"default,omitempty"` }
type NodeDesign ¶
type NodeDesign struct { Address base.Address Privatekey base.Privatekey Storage NodeStorageDesign Network NodeNetworkDesign NetworkID base.NetworkID LocalParams *LocalParams SyncSources *SyncSourcesDesign TimeServerPort int TimeServer string }
func NodeDesignFromConsul ¶
func NodeDesignFromFile ¶
func NodeDesignFromHTTP ¶
func (*NodeDesign) Check ¶
func (d *NodeDesign) Check(devflags DevFlags) error
func (*NodeDesign) DecodeYAML ¶
func (d *NodeDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
func (*NodeDesign) IsValid ¶
func (d *NodeDesign) IsValid([]byte) error
func (NodeDesign) MarshalJSON ¶
func (d NodeDesign) MarshalJSON() ([]byte, error)
func (NodeDesign) MarshalYAML ¶
func (d NodeDesign) MarshalYAML() (interface{}, error)
type NodeDesignMarshaler ¶
type NodeDesignMarshaler struct { LocalParams *LocalParams `json:"parameters" yaml:"parameters"` //nolint:tagliatelle //... SyncSources *SyncSourcesDesign `json:"sync_sources" yaml:"sync_sources"` Address base.Address `json:"address" yaml:"address"` Privatekey base.Privatekey `json:"privatekey" yaml:"privatekey"` Storage NodeStorageDesign `json:"storage" yaml:"storage"` NetworkID string `json:"network_id" yaml:"network_id"` TimeServer string `json:"time_server,omitempty" yaml:"time_server,omitempty"` Network NodeNetworkDesign `json:"network" yaml:"network"` }
type NodeDesignYAMLUnmarshaler ¶
type NodeDesignYAMLUnmarshaler struct { SyncSources interface{} `json:"sync_sources" yaml:"sync_sources"` Storage NodeStorageDesignLMarshaler `json:"storage" yaml:"storage"` Address string `json:"address" yaml:"address"` Privatekey string `json:"privatekey" yaml:"privatekey"` NetworkID string `json:"network_id" yaml:"network_id"` TimeServer string `json:"time_server,omitempty" yaml:"time_server,omitempty"` LocalParams interface{} `json:"parameters" yaml:"parameters"` //nolint:tagliatelle //... Network NodeNetworkDesignMarshaler `json:"network" yaml:"network"` }
type NodeInfo ¶
type NodeInfo interface { util.IsValider ID() string NetworkID() base.NetworkID CreatedAt() time.Time LastStartedAt() time.Time UpdateLastStartedAt() NodeInfo Version() util.Version // NOTE mitum build version }
func CheckLocalFS ¶
func CreateLocalFS ¶
type NodeNetworkDesign ¶
type NodeNetworkDesign struct { Bind *net.UDPAddr `yaml:"bind"` PublishString string `yaml:"publish"` //nolint:tagliatelle //... TLSInsecure bool `yaml:"tls_insecure"` // contains filtered or unexported fields }
func (*NodeNetworkDesign) DecodeYAML ¶
func (d *NodeNetworkDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
func (*NodeNetworkDesign) IsValid ¶
func (d *NodeNetworkDesign) IsValid([]byte) error
func (NodeNetworkDesign) MarshalJSON ¶
func (d NodeNetworkDesign) MarshalJSON() ([]byte, error)
func (NodeNetworkDesign) MarshalYAML ¶
func (d NodeNetworkDesign) MarshalYAML() (interface{}, error)
func (NodeNetworkDesign) Publish ¶
func (d NodeNetworkDesign) Publish() *net.UDPAddr
func (NodeNetworkDesign) PublishConnInfo ¶
func (d NodeNetworkDesign) PublishConnInfo() quicstream.ConnInfo
type NodeNetworkDesignMarshaler ¶
type NodeNetworkDesignMarshaler struct { Bind string `json:"bind,omitempty" yaml:"bind,omitempty"` Publish string `json:"publish" yaml:"publish"` TLSInsecure bool `json:"tls_insecure" yaml:"tls_insecure"` }
func (*NodeNetworkDesignMarshaler) Decode ¶
func (y *NodeNetworkDesignMarshaler) Decode(encoder.Encoder) (d NodeNetworkDesign, _ error)
type NodeRateLimiterRuleSet ¶
type NodeRateLimiterRuleSet struct {
StringKeyRateLimiterRuleSet
}
func NewNodeRateLimiterRuleSet ¶
func NewNodeRateLimiterRuleSet( rules map[string]RateLimiterRuleMap, ) NodeRateLimiterRuleSet
func (NodeRateLimiterRuleSet) Rule ¶
func (rs NodeRateLimiterRuleSet) Rule( _ net.Addr, handler string, hint RateLimitRuleHint, ) (_ string, _ RateLimiterRule, _ string, _ bool)
type NodeStorageDesign ¶
func (*NodeStorageDesign) DecodeYAML ¶
func (d *NodeStorageDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
func (*NodeStorageDesign) IsValid ¶
func (d *NodeStorageDesign) IsValid([]byte) error
func (NodeStorageDesign) MarshalJSON ¶
func (d NodeStorageDesign) MarshalJSON() ([]byte, error)
func (NodeStorageDesign) MarshalYAML ¶
func (d NodeStorageDesign) MarshalYAML() (interface{}, error)
type NodeStorageDesignLMarshaler ¶
type NodeStorageDesignLMarshaler struct { Base string `json:"base" yaml:"base"` Database string `json:"database" yaml:"database"` }
func (*NodeStorageDesignLMarshaler) Decode ¶
func (y *NodeStorageDesignLMarshaler) Decode(encoder.Encoder) (d NodeStorageDesign, _ error)
type PrivatekeyArgument ¶
type PrivatekeyArgument struct { //revive:disable:line-length-limit Flag SecretFlag `` /* 140-byte string literal not displayed */ }
type PrivatekeyFlags ¶
type PrivatekeyFlags struct { //revive:disable:line-length-limit Flag SecretFlag `` /* 133-byte string literal not displayed */ }
type RangeFlag ¶
type RangeFlag struct {
// contains filtered or unexported fields
}
func (*RangeFlag) UnmarshalText ¶
type RateLimitHandler ¶
type RateLimitHandler struct { *util.ContextDaemon // contains filtered or unexported fields }
func NewRateLimitHandler ¶
func NewRateLimitHandler(args *RateLimitHandlerArgs) (*RateLimitHandler, error)
type RateLimitHandlerArgs ¶
type RateLimitHandlerArgs struct { Rules *RateLimiterRules PoolSizes []uint64 // ExpireAddr sets the expire duration for idle addr. if addr is over // ExpireAddr, it will be removed. ExpireAddr time.Duration ShrinkInterval time.Duration // MaxAddrs limits the number of network addresses; if new address over // MaxAddrs, the oldes addr will be removed. MaxAddrs uint64 }
func NewRateLimitHandlerArgs ¶
func NewRateLimitHandlerArgs() *RateLimitHandlerArgs
type RateLimitRuleHint ¶
type RateLimiter ¶
func NewRateLimiter ¶
func NewRateLimiter(limit rate.Limit, burst int, checksum, t, desc string) *RateLimiter
NewRateLimiter make new *RateLimiter; - if limit is zero or burst is zero, all events will be rejected - if limit is rate.Inf, no limit
func (*RateLimiter) Allow ¶
func (r *RateLimiter) Allow() bool
func (*RateLimiter) Burst ¶
func (r *RateLimiter) Burst() int
func (*RateLimiter) Checksum ¶
func (r *RateLimiter) Checksum() string
func (*RateLimiter) Desc ¶
func (r *RateLimiter) Desc() string
func (*RateLimiter) Limit ¶
func (r *RateLimiter) Limit() rate.Limit
func (*RateLimiter) MarshalJSON ¶
func (r *RateLimiter) MarshalJSON() ([]byte, error)
func (*RateLimiter) Tokens ¶
func (r *RateLimiter) Tokens() float64
func (*RateLimiter) Type ¶
func (r *RateLimiter) Type() string
func (*RateLimiter) Update ¶
func (r *RateLimiter) Update(limit rate.Limit, burst int, checksum, t, desc string) *RateLimiter
func (*RateLimiter) UpdatedAt ¶
func (r *RateLimiter) UpdatedAt() int64
type RateLimiterResult ¶
type RateLimiterResult struct { Addr net.Addr `json:"addr,omitempty"` Hint RateLimitRuleHint `json:"hint,omitempty"` Limiter string `json:"limiter,omitempty"` RulesetType string `json:"ruleset_type,omitempty"` RulesetDesc string `json:"ruleset_desc,omitempty"` Prefix string `json:"prefix,omitempty"` Tokens float64 `json:"tokens,omitempty"` Allowed bool `json:"allowed,omitempty"` }
type RateLimiterRule ¶
type RateLimiterRule struct { Limit rate.Limit Burst int // contains filtered or unexported fields }
func LimitRateLimiterRule ¶
func LimitRateLimiterRule() RateLimiterRule
func NewRateLimiterRule ¶
func NewRateLimiterRule(d time.Duration, burst int) RateLimiterRule
func NoLimitRateLimiterRule ¶
func NoLimitRateLimiterRule() RateLimiterRule
func (RateLimiterRule) MarshalText ¶
func (r RateLimiterRule) MarshalText() ([]byte, error)
func (RateLimiterRule) String ¶
func (r RateLimiterRule) String() string
func (*RateLimiterRule) UnmarshalText ¶
func (r *RateLimiterRule) UnmarshalText(b []byte) error
type RateLimiterRuleMap ¶
type RateLimiterRuleMap struct {
// contains filtered or unexported fields
}
func NewRateLimiterRuleMap ¶
func NewRateLimiterRuleMap( d *RateLimiterRule, m map[string]RateLimiterRule, ) RateLimiterRuleMap
func (RateLimiterRuleMap) IsEmpty ¶
func (m RateLimiterRuleMap) IsEmpty() bool
func (RateLimiterRuleMap) Len ¶
func (m RateLimiterRuleMap) Len() int
func (RateLimiterRuleMap) MarshalJSON ¶
func (m RateLimiterRuleMap) MarshalJSON() ([]byte, error)
func (RateLimiterRuleMap) Rule ¶
func (m RateLimiterRuleMap) Rule(handler string) (rule RateLimiterRule, found bool)
func (*RateLimiterRuleMap) UnmarshalJSON ¶
func (m *RateLimiterRuleMap) UnmarshalJSON(b []byte) error
type RateLimiterRuleSet ¶
type RateLimiterRules ¶
type RateLimiterRules struct { IsInConsensusNodesFunc func() ( statehash util.Hash, exists func(base.Address) (found bool), _ error, ) // contains filtered or unexported fields }
func NewRateLimiterRules ¶
func NewRateLimiterRules() *RateLimiterRules
func (*RateLimiterRules) ClientIDRuleSet ¶
func (r *RateLimiterRules) ClientIDRuleSet() RateLimiterRuleSet
func (*RateLimiterRules) DefaultMapUpdatedAt ¶
func (r *RateLimiterRules) DefaultMapUpdatedAt() int64
func (*RateLimiterRules) DefaultRuleMap ¶
func (r *RateLimiterRules) DefaultRuleMap() RateLimiterRuleMap
func (*RateLimiterRules) IsValid ¶
func (r *RateLimiterRules) IsValid([]byte) error
func (*RateLimiterRules) NetRuleSet ¶
func (r *RateLimiterRules) NetRuleSet() RateLimiterRuleSet
func (*RateLimiterRules) NodeRuleSet ¶
func (r *RateLimiterRules) NodeRuleSet() RateLimiterRuleSet
func (*RateLimiterRules) Rule ¶
func (r *RateLimiterRules) Rule( addr net.Addr, handler string, hint RateLimitRuleHint, l *RateLimiter, ) (_ *RateLimiter, isnew bool)
func (*RateLimiterRules) SetClientIDRuleSet ¶
func (r *RateLimiterRules) SetClientIDRuleSet(l RateLimiterRuleSet) error
func (*RateLimiterRules) SetDefaultRuleMap ¶
func (r *RateLimiterRules) SetDefaultRuleMap(rule RateLimiterRuleMap) error
func (*RateLimiterRules) SetIsInConsensusNodesFunc ¶
func (*RateLimiterRules) SetNetRuleSet ¶
func (r *RateLimiterRules) SetNetRuleSet(l RateLimiterRuleSet) error
func (*RateLimiterRules) SetNodeRuleSet ¶
func (r *RateLimiterRules) SetNodeRuleSet(l RateLimiterRuleSet) error
func (*RateLimiterRules) SetSuffrageRuleSet ¶
func (r *RateLimiterRules) SetSuffrageRuleSet(l RateLimiterRuleSet) error
func (*RateLimiterRules) SuffrageRuleSet ¶
func (r *RateLimiterRules) SuffrageRuleSet() RateLimiterRuleSet
type ReadNodeHeader ¶
type ReadNodeHeader struct {
// contains filtered or unexported fields
}
func NewReadNodeHeader ¶
func NewReadNodeHeader(key string, acluser base.Publickey) ReadNodeHeader
func (*ReadNodeHeader) DecodeJSON ¶
func (ReadNodeHeader) IsValid ¶
func (h ReadNodeHeader) IsValid([]byte) error
func (ReadNodeHeader) MarshalJSON ¶
type SecretFlag ¶
type SecretFlag struct {
// contains filtered or unexported fields
}
func (SecretFlag) Body ¶
func (f SecretFlag) Body() []byte
func (SecretFlag) String ¶
func (f SecretFlag) String() string
func (*SecretFlag) UnmarshalText ¶
func (f *SecretFlag) UnmarshalText(b []byte) error
type StringKeyRateLimiterRuleSet ¶
type StringKeyRateLimiterRuleSet struct {
// contains filtered or unexported fields
}
func (StringKeyRateLimiterRuleSet) IsValid ¶
func (StringKeyRateLimiterRuleSet) IsValid([]byte) error
func (StringKeyRateLimiterRuleSet) MarshalJSON ¶
func (rs StringKeyRateLimiterRuleSet) MarshalJSON() ([]byte, error)
func (*StringKeyRateLimiterRuleSet) UnmarshalJSON ¶
func (rs *StringKeyRateLimiterRuleSet) UnmarshalJSON(b []byte) error
func (StringKeyRateLimiterRuleSet) UpdatedAt ¶
func (rs StringKeyRateLimiterRuleSet) UpdatedAt() int64
type SuffragePool ¶
type SuffragePool struct {
// contains filtered or unexported fields
}
func NewSuffragePool ¶
func (*SuffragePool) Purge ¶
func (s *SuffragePool) Purge()
type SuffrageRateLimiterRuleSet ¶
type SuffrageRateLimiterRuleSet struct { IsInConsensusNodesFunc func() (util.Hash, func(base.Address) (found bool), error) // contains filtered or unexported fields }
func NewSuffrageRateLimiterRuleSet ¶
func NewSuffrageRateLimiterRuleSet(rule RateLimiterRuleMap) *SuffrageRateLimiterRuleSet
func (*SuffrageRateLimiterRuleSet) IsValid ¶
func (*SuffrageRateLimiterRuleSet) IsValid([]byte) error
func (*SuffrageRateLimiterRuleSet) MarshalJSON ¶
func (rs *SuffrageRateLimiterRuleSet) MarshalJSON() ([]byte, error)
func (*SuffrageRateLimiterRuleSet) Rule ¶
func (rs *SuffrageRateLimiterRuleSet) Rule( _ net.Addr, handler string, hint RateLimitRuleHint, ) (statehash string, rule RateLimiterRule, _ string, _ bool)
func (*SuffrageRateLimiterRuleSet) UnmarshalJSON ¶
func (rs *SuffrageRateLimiterRuleSet) UnmarshalJSON(b []byte) error
func (*SuffrageRateLimiterRuleSet) UpdatedAt ¶
func (rs *SuffrageRateLimiterRuleSet) UpdatedAt() int64
type SyncSourcesDesign ¶
type SyncSourcesDesign struct {
// contains filtered or unexported fields
}
func NewSyncSourcesDesign ¶
func NewSyncSourcesDesign(sources []isaacnetwork.SyncSource) *SyncSourcesDesign
func (*SyncSourcesDesign) DecodeYAML ¶
func (d *SyncSourcesDesign) DecodeYAML(b []byte, jsonencoder encoder.Encoder) error
func (*SyncSourcesDesign) IsValid ¶
func (d *SyncSourcesDesign) IsValid([]byte) error
func (*SyncSourcesDesign) MarshalJSON ¶
func (d *SyncSourcesDesign) MarshalJSON() ([]byte, error)
func (*SyncSourcesDesign) MarshalYAML ¶
func (d *SyncSourcesDesign) MarshalYAML() (interface{}, error)
func (*SyncSourcesDesign) Sources ¶
func (d *SyncSourcesDesign) Sources() []isaacnetwork.SyncSource
func (*SyncSourcesDesign) Update ¶
func (d *SyncSourcesDesign) Update(sources []isaacnetwork.SyncSource)
type URLProperties ¶
type URLProperties struct {
HTTPSTLSInsecure bool `name:"https.tls_insecure" negatable:"" help:"https tls insecure"`
}
type WriteNodeHeader ¶
type WriteNodeHeader struct {
// contains filtered or unexported fields
}
func NewWriteNodeHeader ¶
func NewWriteNodeHeader(key string, acluser base.Publickey) WriteNodeHeader
func (*WriteNodeHeader) DecodeJSON ¶
func (WriteNodeHeader) IsValid ¶
func (h WriteNodeHeader) IsValid([]byte) error
func (WriteNodeHeader) MarshalJSON ¶
type YAMLACL ¶
type YAMLACL struct { *ACL // contains filtered or unexported fields }
func NewYAMLACL ¶
Source Files ¶
- acl.go
- block.go
- design.go
- event.go
- flags.go
- genesis.go
- handover.go
- hinters.go
- info.go
- local_params.go
- local_params_marshal.go
- logging.go
- p_acl.go
- p_design.go
- p_discovery.go
- p_encoder.go
- p_genesis.go
- p_local.go
- p_memberlist.go
- p_network.go
- p_network_handlers.go
- p_node_rw.go
- p_nodeinfo.go
- p_proposal.go
- p_proposal_maker.go
- p_ratelimit.go
- p_readers.go
- p_states.go
- p_states_network_handlers.go
- p_storage.go
- p_suffrage.go
- p_sync.go
- p_time_sync.go
- ps_import.go
- ps_init.go
- ps_main.go
- ps_run.go
- ratelimit.go
- ratelimit_json.go
- suffrage.go