Documentation ¶
Overview ¶
Package process defines the processes.
Index ¶
- Constants
- Variables
- func Config(ps *pm.Processes) error
- func ErrorProposalProcessorConfigHandler(_ context.Context, m map[string]interface{}) (config.ProposalProcessor, error)
- func HookAddHinters(types []hint.Type, hinters []hint.Hinter) pm.ProcessFunc
- func HookCheckBlockdataPath(ctx context.Context) (context.Context, error)
- func HookCheckEmptyBlock(ctx context.Context) (context.Context, error)
- func HookCheckGenesisBlock(ctx context.Context) (context.Context, error)
- func HookCheckVersion(ctx context.Context) (context.Context, error)
- func HookCleanTempMongodbDatabase(ctx context.Context) (context.Context, error)
- func HookConfigVerbose(ctx context.Context) (context.Context, error)
- func HookGenesisOperationFunc(handlers map[string]HookHandlerGenesisOperations) pm.ProcessFunc
- func HookNetworkRateLimit(ctx context.Context) (context.Context, error)
- func HookNodepool(ctx context.Context) (context.Context, error)
- func HookProposalProcessorConfigFunc(handlers map[string]HookHandlerProposalProcessorConfig) pm.ProcessFunc
- func HookSetNetworkHandlers(ctx context.Context) (context.Context, error)
- func HookSetPolicy(ctx context.Context) (context.Context, error)
- func HookSuffrageConfigFunc(handlers map[string]HookHandlerSuffrageConfig) pm.ProcessFunc
- func HookValidateConfig(ctx context.Context) (context.Context, error)
- func LoadBlockdataContextValue(ctx context.Context, l *blockdata.Blockdata) error
- func LoadConfigSourceContextValue(ctx context.Context, l *[]byte) error
- func LoadConfigSourceTypeContextValue(ctx context.Context, l *string) error
- func LoadConsensusStatesContextValue(ctx context.Context, l *states.States) error
- func LoadDatabaseContextValue(ctx context.Context, l *storage.Database) error
- func LoadDiscoveryConnInfosContextValue(ctx context.Context, l *[]network.ConnInfo) error
- func LoadDiscoveryContextValue(ctx context.Context, l *discovery.Discovery) error
- func LoadGenesisBlockContextValue(ctx context.Context, l *block.Block) error
- func LoadGenesisBlockForceCreateContextValue(ctx context.Context, l *bool) error
- func LoadLocalNodeContextValue(ctx context.Context, l *node.Local) error
- func LoadNetworkContextValue(ctx context.Context, l *network.Server) error
- func LoadNodeChannel(connInfo network.ConnInfo, encs *encoder.Encoders, ...) (network.Channel, error)
- func LoadNodepoolContextValue(ctx context.Context, l **network.Nodepool) error
- func LoadOperationProcessorsContextValue(ctx context.Context, l **hint.Hintmap) error
- func LoadPolicyContextValue(ctx context.Context, l **isaac.LocalPolicy) error
- func LoadProposalProcessorContextValue(ctx context.Context, l **prprocessor.Processors) error
- func LoadRateLimitHandlerMapContextValue(ctx context.Context, l *map[string][]RateLimitRule) error
- func LoadRateLimitStoreContextValue(ctx context.Context, l *limiter.Store) error
- func LoadSuffrageContextValue(ctx context.Context, l *base.Suffrage) error
- func LoadVersionContextValue(ctx context.Context, l *util.Version) error
- func NewErrorProcessorNewFunc(db storage.Database, bd blockdata.Blockdata, nodepool *network.Nodepool, ...) prprocessor.ProcessorNewFunc
- func NewNetworkServer(bind string, certs []tls.Certificate, encs *encoder.Encoders, ca cache.Cache, ...) (network.Server, error)
- func ProcessBlockdata(ctx context.Context) (context.Context, error)
- func ProcessConfig(ctx context.Context) (context.Context, error)
- func ProcessConsensusStates(ctx context.Context) (context.Context, error)
- func ProcessDatabase(ctx context.Context) (context.Context, error)
- func ProcessDiscovery(ctx context.Context) (context.Context, error)
- func ProcessEncoders(ctx context.Context) (context.Context, error)
- func ProcessGenerateGenesisBlock(ctx context.Context) (context.Context, error)
- func ProcessLocalNode(ctx context.Context) (context.Context, error)
- func ProcessProposalProcessor(ctx context.Context) (context.Context, error)
- func ProcessQuicNetwork(ctx context.Context) (context.Context, error)
- func ProcessSuffrage(ctx context.Context) (context.Context, error)
- func ProcessTimeSyncer(ctx context.Context) (context.Context, error)
- func ProposalProcessorConfigHandlerDefault(context.Context, map[string]interface{}) (config.ProposalProcessor, error)
- func SuffrageConfigHandlerFixedProposer(ctx context.Context, m map[string]interface{}, nodes []base.Address) (config.Suffrage, error)
- func SuffrageConfigHandlerRoundrobin(_ context.Context, m map[string]interface{}, nodes []base.Address) (config.Suffrage, error)
- type ActinfSuffrageElectFunc
- type BaseSuffrage
- func (sf *BaseSuffrage) Acting(height base.Height, round base.Round) (base.ActingSuffrage, error)
- func (sf *BaseSuffrage) CacheSize() int
- func (*BaseSuffrage) Initialize() error
- func (sf *BaseSuffrage) IsActing(height base.Height, round base.Round, n base.Address) (bool, error)
- func (sf *BaseSuffrage) IsInside(a base.Address) bool
- func (sf *BaseSuffrage) IsProposer(height base.Height, round base.Round, n base.Address) (bool, error)
- func (sf *BaseSuffrage) Name() string
- func (sf *BaseSuffrage) Nodes() []base.Address
- func (sf *BaseSuffrage) NumberOfActing() uint
- func (*BaseSuffrage) Verbose() string
- type EmptySuffrage
- func (EmptySuffrage) Acting(height base.Height, round base.Round) (base.ActingSuffrage, error)
- func (EmptySuffrage) Initialize() error
- func (EmptySuffrage) IsActing(base.Height, base.Round, base.Address) (bool, error)
- func (EmptySuffrage) IsInside(base.Address) bool
- func (EmptySuffrage) IsProposer(base.Height, base.Round, base.Address) (bool, error)
- func (EmptySuffrage) Name() string
- func (EmptySuffrage) Nodes() []base.Address
- func (EmptySuffrage) NumberOfActing() uint
- func (sf EmptySuffrage) Verbose() string
- type ErrorProposalProcessor
- type FixedSuffrage
- type HookHandlerGenesisOperations
- type HookHandlerProposalProcessorConfig
- type HookHandlerSuffrageConfig
- type RateLimit
- type RateLimitMiddleware
- type RateLimitRule
- type RoundrobinSuffrage
- type SettingNetworkHandlers
Constants ¶
View Source
const ( ProcessNameConfig = "config" HookNameConfigSuffrage = "hook_process_suffrage" HookNameConfigProposalProcessor = "hook_proposal_processor" HookNameConfigGenesisOperations = "hook_genesis_operations" HookNameConfigVerbose = "hook_config_verbose" )
View Source
const ( ProcessNameGenerateGenesisBlock = "generate_genesis_block" HookNameCheckGenesisBlock = "check_genesis_block" )
View Source
const ( ProcessNameDatabase = "database" ProcessNameBlockdata = "blockdata" )
View Source
const HookNameAddHinters = "add_hinters"
View Source
const HookNameCheckEmptyBlock = "check_empty_block"
View Source
const HookNameCheckVersion = "check_version"
View Source
const HookNameCleanTempMongodbDatabase = "clean_temp_mongodb_database"
View Source
const HookNameNetworkRateLimit = "network_ratelimit"
View Source
const HookNameNodepool = "nodepool"
View Source
const HookNameSetNetworkHandlers = "set_network_handlers"
View Source
const HookNameSetPolicy = "set_policy"
View Source
const HookNameValidateConfig = "validate_config"
View Source
const ProcessNameConsensusStates = "consensus_states"
View Source
const ProcessNameDiscovery = "discovery"
View Source
const ProcessNameEncoders = "encoders"
View Source
const ProcessNameLocalNode = "local_node"
View Source
const ProcessNameNetwork = "network"
View Source
const ProcessNameProposalProcessor = "proposal_processor"
View Source
const ProcessNameSuffrage = "suffrage"
View Source
const ProcessNameTimeSyncer = "time-syncer"
Variables ¶
View Source
var ( ContextValueVersion util.ContextKey = "version" ContextValueConfigSource util.ContextKey = "config_source" ContextValueConfigSourceType util.ContextKey = "config_source_type" ContextValueNetwork util.ContextKey = "network" ContextValueBlockdata util.ContextKey = "blockdata" ContextValueDatabase util.ContextKey = "database" ContextValueLocalNode util.ContextKey = "local_node" ContextValueNodepool util.ContextKey = "nodepool" ContextValueSuffrage util.ContextKey = "suffrage" ContextValueProposalProcessor util.ContextKey = "proposal_processor" ContextValueConsensusStates util.ContextKey = "consensus_states" ContextValueGenesisBlockForceCreate util.ContextKey = "force_create_genesis_block" ContextValueGenesisBlock util.ContextKey = "genesis_block" ContextValueOperationProcessors util.ContextKey = "operation_processors" ContextValuePolicy util.ContextKey = "policy" ContextValueRateLimitStore util.ContextKey = "ratelimit-store" ContextValueRateLimitHandlerMap util.ContextKey = "ratelimit-handler-map" ContextValueDiscovery util.ContextKey = "discovery" ContextValueDiscoveryConnInfos util.ContextKey = "discovery-conninfos" )
View Source
var ( DefaultGenesisOperationToken = []byte("genesis-operation-token") DefaultHookHandlersGenesisOperations = map[string]HookHandlerGenesisOperations{} )
View Source
var ( ProcessorBlockdata pm.Process ProcessorDatabase pm.Process )
View Source
var DefaultHookHandlersProposalProcessorConfig = map[string]HookHandlerProposalProcessorConfig{ "default": ProposalProcessorConfigHandlerDefault, "error": ErrorProposalProcessorConfigHandler, }
View Source
var DefaultHookHandlersSuffrageConfig = map[string]HookHandlerSuffrageConfig{ "fixed-suffrage": SuffrageConfigHandlerFixedProposer, "roundrobin": SuffrageConfigHandlerRoundrobin, }
View Source
var HookNameCheckBlockdataPath = "check_blockdata_path"
View Source
var ProcessorConfig pm.Process
View Source
var ProcessorConsensusStates pm.Process
View Source
var ProcessorDiscovery pm.Process
View Source
var ProcessorEncoders pm.Process
View Source
var ProcessorGenerateGenesisBlock pm.Process
View Source
var ProcessorLocalNode pm.Process
View Source
var ProcessorNetwork pm.Process
View Source
var ProcessorProposalProcessor pm.Process
View Source
var ProcessorSuffrage pm.Process
View Source
var ProcessorTimeSyncer pm.Process
Functions ¶
func HookAddHinters ¶
func HookCheckBlockdataPath ¶
func HookCheckEmptyBlock ¶
HookCheckEmptyBlock checks whether local has empty block.
func HookCheckGenesisBlock ¶
func HookGenesisOperationFunc ¶
func HookGenesisOperationFunc(handlers map[string]HookHandlerGenesisOperations) pm.ProcessFunc
func HookNodepool ¶
HookNodepool generates the node list of local node. It does not include the local node itself.
func HookProposalProcessorConfigFunc ¶
func HookProposalProcessorConfigFunc(handlers map[string]HookHandlerProposalProcessorConfig) pm.ProcessFunc
func HookSetNetworkHandlers ¶
func HookSuffrageConfigFunc ¶
func HookSuffrageConfigFunc(handlers map[string]HookHandlerSuffrageConfig) pm.ProcessFunc
func LoadNetworkContextValue ¶
func LoadNodeChannel ¶
func LoadPolicyContextValue ¶
func LoadPolicyContextValue(ctx context.Context, l **isaac.LocalPolicy) error
func LoadProposalProcessorContextValue ¶
func LoadProposalProcessorContextValue(ctx context.Context, l **prprocessor.Processors) error
func LoadRateLimitHandlerMapContextValue ¶
func LoadRateLimitHandlerMapContextValue(ctx context.Context, l *map[string][]RateLimitRule) error
func LoadVersionContextValue ¶
func NewErrorProcessorNewFunc ¶
func NewErrorProcessorNewFunc( db storage.Database, bd blockdata.Blockdata, nodepool *network.Nodepool, suffrage base.Suffrage, oprHintset *hint.Hintmap, whenPreparePoints []config.ErrorPoint, whenSavePoints []config.ErrorPoint, ) prprocessor.ProcessorNewFunc
func NewNetworkServer ¶
func ProcessConsensusStates ¶
Types ¶
type ActinfSuffrageElectFunc ¶
type BaseSuffrage ¶
type BaseSuffrage struct { sync.RWMutex *logging.Logging // contains filtered or unexported fields }
func NewBaseSuffrage ¶
func NewBaseSuffrage( name string, nodes []base.Address, numberOfActing uint, electFunc ActinfSuffrageElectFunc, cacheSize int, ) (*BaseSuffrage, error)
func (*BaseSuffrage) Acting ¶
func (sf *BaseSuffrage) Acting(height base.Height, round base.Round) (base.ActingSuffrage, error)
func (*BaseSuffrage) CacheSize ¶
func (sf *BaseSuffrage) CacheSize() int
func (*BaseSuffrage) Initialize ¶
func (*BaseSuffrage) Initialize() error
func (*BaseSuffrage) IsProposer ¶
func (*BaseSuffrage) Name ¶
func (sf *BaseSuffrage) Name() string
func (*BaseSuffrage) Nodes ¶
func (sf *BaseSuffrage) Nodes() []base.Address
func (*BaseSuffrage) NumberOfActing ¶
func (sf *BaseSuffrage) NumberOfActing() uint
func (*BaseSuffrage) Verbose ¶
func (*BaseSuffrage) Verbose() string
type EmptySuffrage ¶
type EmptySuffrage struct{}
func (EmptySuffrage) Acting ¶
func (EmptySuffrage) Acting(height base.Height, round base.Round) (base.ActingSuffrage, error)
func (EmptySuffrage) Initialize ¶
func (EmptySuffrage) Initialize() error
func (EmptySuffrage) IsProposer ¶
func (EmptySuffrage) Name ¶
func (EmptySuffrage) Name() string
func (EmptySuffrage) Nodes ¶
func (EmptySuffrage) Nodes() []base.Address
func (EmptySuffrage) NumberOfActing ¶
func (EmptySuffrage) NumberOfActing() uint
func (EmptySuffrage) Verbose ¶
func (sf EmptySuffrage) Verbose() string
type ErrorProposalProcessor ¶
type ErrorProposalProcessor struct { *isaac.DefaultProcessor // contains filtered or unexported fields }
func NewErrorProposalProcessor ¶
func NewErrorProposalProcessor( d *isaac.DefaultProcessor, whenPreparePoints, whenSavePoints []config.ErrorPoint, ) *ErrorProposalProcessor
type FixedSuffrage ¶
type FixedSuffrage struct { *BaseSuffrage // contains filtered or unexported fields }
func NewFixedSuffrage ¶
func (*FixedSuffrage) Verbose ¶
func (sf *FixedSuffrage) Verbose() string
type RateLimit ¶
func NewRateLimit ¶
func NewRateLimit( rules []RateLimitRule, defaultRate limiter.Rate, ) *RateLimit
type RateLimitMiddleware ¶
type RateLimitMiddleware struct {
// contains filtered or unexported fields
}
func NewRateLimitMiddleware ¶
func NewRateLimitMiddleware(lt *RateLimit, store limiter.Store) *RateLimitMiddleware
func (*RateLimitMiddleware) Middleware ¶
func (mw *RateLimitMiddleware) Middleware(next http.Handler) http.Handler
type RateLimitRule ¶
type RateLimitRule struct {
// contains filtered or unexported fields
}
func NewRateLimiterRule ¶
func NewRateLimiterRule(ipnet *net.IPNet, rate limiter.Rate) RateLimitRule
func (RateLimitRule) Rate ¶
func (rr RateLimitRule) Rate() limiter.Rate
type RoundrobinSuffrage ¶
type RoundrobinSuffrage struct { *BaseSuffrage // contains filtered or unexported fields }
func NewRoundrobinSuffrage ¶
func (*RoundrobinSuffrage) Verbose ¶
func (sf *RoundrobinSuffrage) Verbose() string
type SettingNetworkHandlers ¶
type SettingNetworkHandlers struct {
// contains filtered or unexported fields
}
func SettingNetworkHandlersFromContext ¶
func SettingNetworkHandlersFromContext(ctx context.Context) (*SettingNetworkHandlers, error)
func (*SettingNetworkHandlers) Set ¶
func (sn *SettingNetworkHandlers) Set() error
Source Files ¶
- context.go
- doc.go
- hook_blockdata_path.go
- hook_check_empty_block.go
- hook_clean_temp_mongodb_database.go
- hook_config_proposal_processor.go
- hook_config_suffrage.go
- hook_config_verbose.go
- hook_genesis_operations.go
- hook_hinter.go
- hook_network_handlers.go
- hook_network_ratelimit.go
- hook_nodepool.go
- hook_policy.go
- hook_validate_config.go
- process_config.go
- process_consensus_states.go
- process_discovery.go
- process_encoders.go
- process_generate_genesis_block.go
- process_init.go
- process_localnode.go
- process_network.go
- process_proposal_processor.go
- process_storage.go
- process_suffrage.go
- process_time_syncer.go
- proposal_processor_with_error.go
- ratelimit.go
- suffrage_base.go
- suffrage_empty.go
- suffrage_fixed.go
- suffrage_roundrobin.go
Click to show internal directories.
Click to hide internal directories.