launch

package
v0.0.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 59 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultNetworkBind                  = &net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: 4321} //nolint:gomnd //...
	DefaultNetworkPublish               = &net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: 4321} //nolint:gomnd //...
	DefaultStorageBase                  string
	DefaultStorageDatabaseDirectoryName = "db"
)
View Source
var (
	DefaultNodeInfoHint = hint.MustNewHint("default-node-info-v0.0.1")
	NodeInfoFilename    = "info.json"
)
View Source
var (
	PNameDesign                 = ps.Name("design")
	PNameCheckDesign            = ps.Name("check-design")
	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")
	VaultContextKey             = util.ContextKey("vault")
)
View Source
var (
	PNameDiscoveryFlag      = ps.Name("discovery-flag")
	DiscoveryFlagContextKey = util.ContextKey("discovery-flag")
	DiscoveryContextKey     = util.ContextKey("discovery")
)
View Source
var (
	PNameEncoder       = ps.Name("encoder")
	PNameAddHinters    = ps.Name("add-hinters")
	EncodersContextKey = util.ContextKey("encoders")
	EncoderContextKey  = util.ContextKey("encoder")
)
View Source
var (
	PNameLocal            = ps.Name("local")
	LocalContextKey       = util.ContextKey("local")
	LocalParamsContextKey = util.ContextKey("local-params")
)
View Source
var (
	PNameMemberlist                         = ps.Name("memberlist")
	PNameStartMemberlist                    = ps.Name("start-memberlist")
	PNameLongRunningMemberlistJoin          = ps.Name("long-running-memberlist-join")
	PNameCallbackBroadcaster                = ps.Name("callback-broadcaster")
	PNameSuffrageVoting                     = ps.Name("suffrage-voting")
	PNamePatchMemberlist                    = ps.Name("patch-memberlist")
	MemberlistContextKey                    = util.ContextKey("memberlist")
	LongRunningMemberlistJoinContextKey     = util.ContextKey("long-running-memberlist-join")
	EventWhenEmptyMembersContextKey         = util.ContextKey("event-when-empty-members")
	SuffrageVotingContextKey                = util.ContextKey("suffrage-voting")
	SuffrageVotingVoteFuncContextKey        = util.ContextKey("suffrage-voting-vote-func")
	CallbackBroadcasterContextKey           = util.ContextKey("callback-broadcaster")
	FilterMemberlistNotifyMsgFuncContextKey = util.ContextKey("filter-memberlist-notify-msg-func")
)
View Source
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")
)
View Source
var (
	PNameNetworkHandlers             = ps.Name("network-handlers")
	PNameOperationProcessorsMap      = ps.Name("operation-processors-map")
	OperationProcessorsMapContextKey = util.ContextKey("operation-processors-map")
)
View Source
var (
	PNameNodeInfo      = ps.Name("nodeinfo")
	NodeInfoContextKey = util.ContextKey("nodeinfo")
)
View Source
var (
	PNameProposalMaker      = ps.Name("proposal-maker")
	ProposalMakerContextKey = util.ContextKey("proposal-maker")
)
View Source
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")
	ProposerSelectorContextKey                      = util.ContextKey("proposer-selector")
	ProposalSelectorContextKey                      = util.ContextKey("proposal-selector")
	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")
)
View Source
var (
	PNameStorage                    = ps.Name("storage")
	PNameStartStorage               = ps.Name("start-storage")
	PNameCheckLeveldbStorage        = ps.Name("check-leveldb-storage")
	PNameCheckLoadFromDatabase      = 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")
	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")
)
View Source
var (
	LocalFSDataDirectoryName           = "data"
	LocalFSDatabaseDirectoryName       = "db"
	LeveldbURIScheme                   = "leveldb"
	RedisPermanentDatabasePrefixFormat = "mitum-%s"
)
View Source
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")
)
View Source
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")
)
View Source
var (
	PNameTimeSyncer      = ps.Name("time-syncer")
	TimeSyncerContextKey = util.ContextKey("time-syncer")
)
View Source
var (
	PprofRequestHeaderHint = hint.MustNewHint("pprof-header-v0.0.1")
	HandlerPrefixPprof     = "pprof"
)
View Source
var (
	PNameLogging        = ps.Name("logging")
	PNameLoggingWithCLI = ps.Name("logging-cli")
)
View Source
var (
	VersionContextKey     = util.ContextKey("version")
	FlagsContextKey       = util.ContextKey("flags")
	KongContextContextKey = util.ContextKey("kong-context")
	LoggingContextKey     = util.ContextKey("logging")
)
View Source
var DefaultDesignURI = "./config.yml"
View Source
var DefaultTimeSyncerInterval = time.Minute * 10
View Source
var Hinters = []encoder.DecodeDetail{

	{Hint: DefaultNodeInfoHint, Instance: DefaultNodeInfo{}},
	{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.ACCEPTWithdrawVoteproofHint, Instance: isaac.ACCEPTWithdrawVoteproof{}},
	{Hint: isaac.ACCEPTStuckVoteproofHint, Instance: isaac.ACCEPTStuckVoteproof{}},
	{Hint: isaac.FixedSuffrageCandidateLimiterRuleHint, Instance: isaac.FixedSuffrageCandidateLimiterRule{}},
	{Hint: isaac.INITBallotFactHint, Instance: isaac.INITBallotFact{}},
	{Hint: isaac.INITBallotHint, Instance: isaac.INITBallot{}},
	{Hint: isaac.INITBallotSignFactHint, Instance: isaac.INITBallotSignFact{}},
	{Hint: isaac.INITVoteproofHint, Instance: isaac.INITVoteproof{}},
	{Hint: isaac.INITWithdrawVoteproofHint, Instance: isaac.INITWithdrawVoteproof{}},
	{Hint: isaac.INITStuckVoteproofHint, Instance: isaac.INITStuckVoteproof{}},
	{Hint: isaac.LocalParamsHint, Instance: &isaac.LocalParams{}},
	{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.SuffrageWithdrawOperationHint, Instance: isaac.SuffrageWithdrawOperation{}},
	{Hint: isaacblock.BlockMapHint, Instance: isaacblock.BlockMap{}},
	{Hint: isaacblock.SuffrageProofHint, Instance: isaacblock.SuffrageProof{}},
	{
		Hint:     isaacnetwork.ExistsInStateOperationRequestHeaderHint,
		Instance: isaacnetwork.ExistsInStateOperationRequestHeader{},
	},
	{Hint: isaacnetwork.BlockMapItemRequestHeaderHint, Instance: isaacnetwork.BlockMapItemRequestHeader{}},
	{Hint: isaacnetwork.BlockMapRequestHeaderHint, Instance: isaacnetwork.BlockMapRequestHeader{}},
	{Hint: isaacnetwork.CallbackBroadcastMessageHint, Instance: isaacnetwork.CallbackBroadcastMessage{}},
	{Hint: isaacnetwork.CallbackMessageHeaderHint, Instance: isaacnetwork.CallbackMessageHeader{}},
	{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.ResponseHeaderHint, Instance: isaacnetwork.ResponseHeader{}},
	{Hint: isaacnetwork.SendBallotsHeaderHint, Instance: isaacnetwork.SendBallotsHeader{}},
	{Hint: isaacnetwork.SendOperationRequestHeaderHint, Instance: isaacnetwork.SendOperationRequestHeader{}},
	{Hint: isaacnetwork.StateRequestHeaderHint, Instance: isaacnetwork.StateRequestHeader{}},
	{
		Hint:     isaacnetwork.SuffrageNodeConnInfoRequestHeaderHint,
		Instance: isaacnetwork.SuffrageNodeConnInfoRequestHeader{},
	},
	{Hint: isaacnetwork.SuffrageProofRequestHeaderHint, Instance: isaacnetwork.SuffrageProofRequestHeader{}},
	{Hint: isaacnetwork.SyncSourceConnInfoRequestHeaderHint, Instance: isaacnetwork.SyncSourceConnInfoRequestHeader{}},
	{Hint: isaacoperation.GenesisNetworkPolicyFactHint, Instance: isaacoperation.GenesisNetworkPolicyFact{}},
	{Hint: isaacoperation.GenesisNetworkPolicyHint, Instance: isaacoperation.GenesisNetworkPolicy{}},
	{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: PprofRequestHeaderHint, Instance: PprofRequestHeader{}},
	{Hint: quicmemberlist.NodeHint, Instance: quicmemberlist.BaseNode{}},
}
View Source
var PNameGenerateGenesis = ps.Name("generate-genesis")
View Source
var PNameWatchDesign = ps.Name("watch-design")

Functions

func CleanStorage

func CleanStorage(
	permuri, root string,
	encs *encoder.Encoders,
	enc encoder.Encoder,
) error

func DefaultINITPS

func DefaultINITPS() *ps.PS

func DefaultMainPS

func DefaultMainPS() *ps.PS

func DefaultQuicConfig

func DefaultQuicConfig() *quic.Config

func DefaultRunPS

func DefaultRunPS() *ps.PS

func DefaultWhenNewBlockConfirmedFunc

func DefaultWhenNewBlockConfirmedFunc(log *logging.Logging) func(base.Height)

func DefaultWhenNewBlockSavedInConsensusStateFunc

func DefaultWhenNewBlockSavedInConsensusStateFunc(
	log *logging.Logging,
	params *isaac.LocalParams,
	ballotbox *isaacstates.Ballotbox,
	db isaac.Database,
	nodeinfo *isaacnetwork.NodeInfoUpdater,
) func(base.Height)

func DefaultWhenNewBlockSavedInSyncingStateFunc

func DefaultWhenNewBlockSavedInSyncingStateFunc(
	log *logging.Logging,
	db isaac.Database,
	nodeinfo *isaacnetwork.NodeInfoUpdater,
) func(base.Height)

func FindLastHeightFromLocalFS

func FindLastHeightFromLocalFS(
	dataroot string, enc encoder.Encoder, networkID base.NetworkID,
) (last base.Height, _ error)

func GenerateNewTLSConfig

func GenerateNewTLSConfig(networkID base.NetworkID) *tls.Config

func GetDiscoveriesFromLocked

func GetDiscoveriesFromLocked(l *util.Locked[[]quicstream.UDPConnInfo]) []quicstream.UDPConnInfo

func GetSuffrageProofFromRemoteFunc

func GetSuffrageProofFromRemoteFunc(pctx context.Context) (
	isaac.GetSuffrageProofFromRemoteFunc, error,
)

func ImportBlocks

func ImportBlocks(
	from, root string,
	fromHeight, toHeight base.Height,
	encs *encoder.Encoders,
	enc encoder.Encoder,
	db isaac.Database,
	params base.LocalParams,
) error

func IsSupportedProposalOperationFactHintFunc

func IsSupportedProposalOperationFactHintFunc() func(hint.Hint) bool

func IsValidSyncSourcesDesign

func IsValidSyncSourcesDesign(
	d SyncSourcesDesign,
	localAddress base.Address,
	localPublishString, localPublishResolved string,
) error

func LastHeightOfLocalFS

func LastHeightOfLocalFS(pctx context.Context, from string) (last base.Height, _ error)

func LoadHinters

func LoadHinters(enc encoder.Encoder) error

func LoadPermanentDatabase

func LoadPermanentDatabase(
	uri, id string, encs *encoder.Encoders, enc encoder.Encoder, root string,
) (*leveldbstorage.Storage, isaac.PermanentDatabase, error)

func LocalFSDataDirectory

func LocalFSDataDirectory(root string) string

func LocalFSDatabaseDirectory

func LocalFSDatabaseDirectory(root string) string

func LocalFromDesign

func LocalFromDesign(design NodeDesign) (base.LocalNode, error)

func MergeBlockWriteToPermanentDatabase

func MergeBlockWriteToPermanentDatabase(
	ctx context.Context, bwdb isaac.BlockWriteDatabase, perm isaac.PermanentDatabase,
) error

func NetworkHandlerPprofFunc

func NetworkHandlerPprofFunc(encs *encoder.Encoders) quicstream.Handler

func NewBlockWriterFunc

func NewBlockWriterFunc(
	local base.LocalNode,
	networkID base.NetworkID,
	dataroot string,
	enc encoder.Encoder,
	db isaac.Database,
) isaac.NewBlockWriterFunc

func NewNetworkClient

func NewNetworkClient(
	encs *encoder.Encoders,
	enc encoder.Encoder,
	idleTimeout time.Duration,
	networkID base.NetworkID,
) *isaacnetwork.QuicstreamClient

func NewProposalSelector

func NewProposalSelector(pctx context.Context) (*isaac.BaseProposalSelector, error)

func OperationPreProcess

func OperationPreProcess(
	oprs *hint.CompatibleSet,
	op base.Operation,
	height base.Height,
) (
	preprocess func(context.Context, base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error),
	cancelf func() error,
	_ error,
)

func PAddHinters

func PAddHinters(pctx context.Context) (context.Context, error)

func PBallotStuckResolver

func PBallotStuckResolver(pctx context.Context) (context.Context, error)

func PBallotbox

func PBallotbox(pctx context.Context) (context.Context, error)

func PCallbackBroadcaster

func PCallbackBroadcaster(pctx context.Context) (context.Context, error)

func PCheckDesign

func PCheckDesign(pctx context.Context) (context.Context, error)

func PCheckLeveldbStorage

func PCheckLeveldbStorage(pctx context.Context) (context.Context, error)

func PCheckLocalFS

func PCheckLocalFS(pctx context.Context) (context.Context, error)

func PCleanStorage

func PCleanStorage(pctx context.Context) (context.Context, error)

func PCloseLastConsensusNodesWatcher

func PCloseLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)

func PCloseMemberlist

func PCloseMemberlist(pctx context.Context) (context.Context, error)

func PCloseNetwork

func PCloseNetwork(pctx context.Context) (context.Context, error)

func PCloseStates

func PCloseStates(pctx context.Context) (context.Context, error)

func PCloseStorage

func PCloseStorage(pctx context.Context) (context.Context, error)

func PCloseSyncSourceChecker

func PCloseSyncSourceChecker(pctx context.Context) (context.Context, error)

func PCloseTimeSyncer

func PCloseTimeSyncer(pctx context.Context) (context.Context, error)

func PCreateLocalFS

func PCreateLocalFS(pctx context.Context) (context.Context, error)

func PDiscoveryFlag

func PDiscoveryFlag(pctx context.Context) (context.Context, error)

func PEncoder

func PEncoder(pctx context.Context) (context.Context, error)

func PGenerateGenesis

func PGenerateGenesis(pctx context.Context) (context.Context, error)

func PGenesisDesign

func PGenesisDesign(pctx context.Context) (context.Context, error)

func PINIT

func PINIT(ctx context.Context) (context.Context, error)

func PLastConsensusNodesWatcher

func PLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)

func PLoadDatabase

func PLoadDatabase(pctx context.Context) (context.Context, error)

func PLoadDesign

func PLoadDesign(pctx context.Context) (context.Context, error)

func PLoadFromDatabase

func PLoadFromDatabase(pctx context.Context) (context.Context, error)

func PLocal

func PLocal(pctx context.Context) (context.Context, error)

func PLogging

func PLogging(ctx context.Context) (context.Context, error)

func PLoggingWithCLI

func PLoggingWithCLI(ctx context.Context) (context.Context, error)

func PLongRunningMemberlistJoin

func PLongRunningMemberlistJoin(pctx context.Context) (context.Context, error)

func PMemberlist

func PMemberlist(pctx context.Context) (context.Context, error)

func PNetwork

func PNetwork(pctx context.Context) (context.Context, error)

func PNetworkHandlers

func PNetworkHandlers(pctx context.Context) (context.Context, error)

func PNodeInConsensusNodesFunc

func PNodeInConsensusNodesFunc(pctx context.Context) (context.Context, error)

func PNodeInfo

func PNodeInfo(pctx context.Context) (context.Context, error)

func POperationProcessorsMap

func POperationProcessorsMap(pctx context.Context) (context.Context, error)

func PPatchLastConsensusNodesWatcher

func PPatchLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)

func PPatchMemberlist

func PPatchMemberlist(pctx context.Context) (context.Context, error)

func PProposalMaker

func PProposalMaker(pctx context.Context) (context.Context, error)

func PProposalProcessors

func PProposalProcessors(pctx context.Context) (context.Context, error)

func PProposerSelector

func PProposerSelector(pctx context.Context) (context.Context, error)

func PQuicstreamClient

func PQuicstreamClient(pctx context.Context) (context.Context, error)

func PStartLastConsensusNodesWatcher

func PStartLastConsensusNodesWatcher(pctx context.Context) (context.Context, error)

func PStartMemberlist

func PStartMemberlist(pctx context.Context) (context.Context, error)

func PStartNetwork

func PStartNetwork(pctx context.Context) (context.Context, error)

func PStartStorage

func PStartStorage(pctx context.Context) (context.Context, error)

func PStartSyncSourceChecker

func PStartSyncSourceChecker(pctx context.Context) (context.Context, error)

func PStartTimeSyncer

func PStartTimeSyncer(pctx context.Context) (context.Context, error)

func PStates

func PStates(pctx context.Context) (context.Context, error)

func PStatesSetHandlers

func PStatesSetHandlers(pctx context.Context) (context.Context, error)

func PStorage

func PStorage(pctx context.Context) (context.Context, error)

func PSuffrageCandidateLimiterSet

func PSuffrageCandidateLimiterSet(pctx context.Context) (context.Context, error)

func PSuffrageVoting

func PSuffrageVoting(pctx context.Context) (context.Context, error)

func PSyncSourceChecker

func PSyncSourceChecker(pctx context.Context) (context.Context, error)

func PWatchDesign

func PWatchDesign(pctx context.Context) (context.Context, error)

func QuicstreamHandlerGetNodeInfoFunc

func QuicstreamHandlerGetNodeInfoFunc(
	enc encoder.Encoder,
	nodeinfo *isaacnetwork.NodeInfoUpdater,
) func() ([]byte, error)

func QuicstreamHandlerLastBlockMapFunc

func QuicstreamHandlerLastBlockMapFunc(
	db isaac.Database,
) func(last util.Hash) (hint.Hint, []byte, []byte, bool, error)

func QuicstreamHandlerSuffrageNodeConnInfoFunc

func QuicstreamHandlerSuffrageNodeConnInfoFunc(
	db isaac.Database,
	memberlist *quicmemberlist.Memberlist,
) func() ([]isaac.NodeConnInfo, error)

func RemoveLocalFS

func RemoveLocalFS(root string) error

func SaveNodeInfo

func SaveNodeInfo(root string, i NodeInfo) error

func SetupLoggingFromFlags

func SetupLoggingFromFlags(flag LoggingFlags) (*logging.Logging, error)

func UpdateNodeInfoWithNewBlock

func UpdateNodeInfoWithNewBlock(
	db isaac.Database,
	nodeinfo *isaacnetwork.NodeInfoUpdater,
) error

func ValidateBlockFromLocalFS

func ValidateBlockFromLocalFS(
	height base.Height,
	dataroot string,
	enc encoder.Encoder,
	networkID base.NetworkID,
	db isaac.Database,
) error

func ValidateLocalFS

func ValidateLocalFS(
	dataroot string,
	enc encoder.Encoder,
	last base.Height,
) error

func ValidateOperationsOfBlock

func ValidateOperationsOfBlock(
	opstree fixedtree.Tree,
	ops []base.Operation,
	manifest base.Manifest,
	db isaac.Database,
) error

func ValidateStatesOfBlock

func ValidateStatesOfBlock(
	ststree fixedtree.Tree,
	sts []base.State,
	manifest base.Manifest,
	db isaac.Database,
) error

Types

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 ConnInfoFlag

type ConnInfoFlag struct {
	// contains filtered or unexported fields
}

func (*ConnInfoFlag) ConnInfo

func (f *ConnInfoFlag) ConnInfo() (quicstream.UDPConnInfo, error)

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 NewDefaultNodeInfo(id string, networkID base.NetworkID, version util.Version) DefaultNodeInfo

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}"`
	DesignURIProperties `embed:"" prefix:"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() DesignURIProperties

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 DesignURIProperties

type DesignURIProperties struct {
	HTTPSTLSInsecure bool `name:"https.tls_insecure" negatable:"" help:"https tls insecure" group:"design"`
}

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"`
}

type FilterMemberlistNotifyMsgFunc

type FilterMemberlistNotifyMsgFunc func(interface{}) (bool, error)

type GenesisBlockGenerator

type GenesisBlockGenerator struct {
	*logging.Logging
	// contains filtered or unexported fields
}

func NewGenesisBlockGenerator

func NewGenesisBlockGenerator(
	local base.LocalNode,
	networkID base.NetworkID,
	enc encoder.Encoder,
	db isaac.Database,
	dataroot string,
	facts []base.Fact,
) *GenesisBlockGenerator

func (*GenesisBlockGenerator) Generate

func (g *GenesisBlockGenerator) Generate() (base.BlockMap, error)

type GenesisDesign

type GenesisDesign struct {
	Facts []base.Fact `yaml:"facts" json:"facts"`
}

func GenesisDesignFromFile

func GenesisDesignFromFile(f string, enc *jsonenc.Encoder) (d GenesisDesign, _ []byte, _ error)

func (*GenesisDesign) DecodeYAML

func (d *GenesisDesign) DecodeYAML(b []byte, enc *jsonenc.Encoder) error

func (*GenesisDesign) IsValid

func (*GenesisDesign) IsValid([]byte) error

type GenesisDesignYAMLUnmarshaler

type GenesisDesignYAMLUnmarshaler struct {
	Facts []interface{} `yaml:"facts" json:"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 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

func (LogOutFlag) File

func (f LogOutFlag) File() (io.Writer, error)

type LoggingFlags

type LoggingFlags struct {
	// revive:disable:line-length-limit
	//revive:disable:struct-tag
	Out        LogOutFlag   `name:"out" default:"${log_out}" help:"log output file: {stdout, stderr, <file>}" group:"logging"`
	Format     string       `enum:"json, terminal" default:"${log_format}" help:"log format: {${enum}}" 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() (bool, error),
	isJoined func() bool,
) *LongRunningMemberlistJoin

func (*LongRunningMemberlistJoin) Cancel

func (l *LongRunningMemberlistJoin) Cancel() bool

func (*LongRunningMemberlistJoin) Join

func (l *LongRunningMemberlistJoin) Join() <-chan struct{}

type NodeDesign

type NodeDesign struct {
	Address        base.Address
	Privatekey     base.Privatekey
	Storage        NodeStorageDesign
	Network        NodeNetworkDesign
	NetworkID      base.NetworkID
	LocalParams    *isaac.LocalParams
	SyncSources    SyncSourcesDesign
	TimeServerPort int
	TimeServer     string
}

func NodeDesignFromConsul

func NodeDesignFromConsul(addr, key string, enc *jsonenc.Encoder) (design NodeDesign, _ []byte, _ error)

func NodeDesignFromFile

func NodeDesignFromFile(f string, enc *jsonenc.Encoder) (d NodeDesign, _ []byte, _ error)

func NodeDesignFromHTTP

func NodeDesignFromHTTP(u string, tlsInsecure bool, enc *jsonenc.Encoder) (design NodeDesign, _ []byte, _ error)

func (*NodeDesign) Check

func (d *NodeDesign) Check(devflags DevFlags) error

func (*NodeDesign) DecodeYAML

func (d *NodeDesign) DecodeYAML(b []byte, enc *jsonenc.Encoder) error

func (*NodeDesign) IsValid

func (d *NodeDesign) IsValid([]byte) error

func (NodeDesign) MarshalYAML

func (d NodeDesign) MarshalYAML() (interface{}, error)

func (NodeDesign) MarshalZerologObject

func (d NodeDesign) MarshalZerologObject(e *zerolog.Event)

type NodeDesignYAMLMarshaler

type NodeDesignYAMLMarshaler struct {
	Address     base.Address       `yaml:"address"`
	Privatekey  base.Privatekey    `yaml:"privatekey"`
	Storage     NodeStorageDesign  `yaml:"storage"`
	NetworkID   string             `yaml:"network_id"`
	TimeServer  string             `yaml:"time_server,omitempty"`
	Network     NodeNetworkDesign  `yaml:"network"`
	LocalParams *isaac.LocalParams `yaml:"parameters"` //nolint:tagliatelle //...
	SyncSources SyncSourcesDesign  `yaml:"sync_sources"`
}

type NodeDesignYAMLUnmarshaler

type NodeDesignYAMLUnmarshaler struct {
	SyncSources interface{}                    `yaml:"sync_sources"`
	Storage     NodeStorageDesignYAMLMarshal   `yaml:"storage"`
	Address     string                         `yaml:"address"`
	Privatekey  string                         `yaml:"privatekey"`
	NetworkID   string                         `yaml:"network_id"`
	TimeServer  string                         `yaml:"time_server,omitempty"`
	LocalParams map[string]interface{}         `yaml:"parameters"` //nolint:tagliatelle //...
	Network     NodeNetworkDesignYAMLMarshaler `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 CheckLocalFS(networkID base.NetworkID, root string, enc encoder.Encoder) (NodeInfo, error)

func CreateLocalFS

func CreateLocalFS(newinfo NodeInfo, root string, enc encoder.Encoder) (NodeInfo, error)

func LoadNodeInfo

func LoadNodeInfo(root string, enc encoder.Encoder) (_ NodeInfo, found bool, _ error)

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, enc *jsonenc.Encoder) error

func (*NodeNetworkDesign) IsValid

func (d *NodeNetworkDesign) IsValid([]byte) error

func (NodeNetworkDesign) MarshalYAML

func (d NodeNetworkDesign) MarshalYAML() (interface{}, error)

func (NodeNetworkDesign) Publish

func (d NodeNetworkDesign) Publish() *net.UDPAddr

type NodeNetworkDesignYAMLMarshaler

type NodeNetworkDesignYAMLMarshaler struct {
	Bind        string `yaml:"bind,omitempty"`
	Publish     string `yaml:"publish"`
	TLSInsecure bool   `yaml:"tls_insecure"`
}

func (*NodeNetworkDesignYAMLMarshaler) Decode

type NodeStorageDesign

type NodeStorageDesign struct {
	Database *url.URL `yaml:"database"`
	Base     string   `yaml:"base"`
}

func (*NodeStorageDesign) DecodeYAML

func (d *NodeStorageDesign) DecodeYAML(b []byte, enc *jsonenc.Encoder) error

func (*NodeStorageDesign) IsValid

func (d *NodeStorageDesign) IsValid([]byte) error

func (NodeStorageDesign) MarshalYAML

func (d NodeStorageDesign) MarshalYAML() (interface{}, error)

func (*NodeStorageDesign) Patch

func (d *NodeStorageDesign) Patch(node base.Address) error

type NodeStorageDesignYAMLMarshal

type NodeStorageDesignYAMLMarshal struct {
	Base     string `yaml:"base"`
	Database string `yaml:"database"`
}

func (*NodeStorageDesignYAMLMarshal) Decode

type PprofRequestHeader

type PprofRequestHeader struct {
	isaacnetwork.BaseHeader
	// contains filtered or unexported fields
}

func NewPprofRequestHeader

func NewPprofRequestHeader(label string, seconds uint64, gc bool) PprofRequestHeader

func (PprofRequestHeader) GC

func (h PprofRequestHeader) GC() bool

func (PprofRequestHeader) HandlerPrefix

func (PprofRequestHeader) HandlerPrefix() string

func (PprofRequestHeader) IsValid

func (h PprofRequestHeader) IsValid([]byte) error

func (PprofRequestHeader) Label

func (h PprofRequestHeader) Label() string

func (PprofRequestHeader) MarshalJSON

func (h PprofRequestHeader) MarshalJSON() ([]byte, error)

func (PprofRequestHeader) Seconds

func (h PprofRequestHeader) Seconds() uint64

func (*PprofRequestHeader) UnmarshalJSON

func (h *PprofRequestHeader) UnmarshalJSON(b []byte) error

type SuffragePool

type SuffragePool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSuffragePool

func NewSuffragePool(
	fromDB func(base.Height) (base.Suffrage, bool, error),
	lastf func() (base.Height, base.Suffrage, bool, error),
) *SuffragePool

func (*SuffragePool) Height

func (s *SuffragePool) Height(height base.Height) (base.Suffrage, bool, error)

func (*SuffragePool) Last

func (s *SuffragePool) Last() (base.Suffrage, bool, error)

func (*SuffragePool) Purge

func (s *SuffragePool) Purge()

type SyncSourcesDesign

type SyncSourcesDesign []isaacnetwork.SyncSource

func (*SyncSourcesDesign) DecodeYAML

func (d *SyncSourcesDesign) DecodeYAML(b []byte, enc *jsonenc.Encoder) error

func (*SyncSourcesDesign) IsValid

func (d *SyncSourcesDesign) IsValid([]byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL