solo

package module
v0.0.0-...-84c06e0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

chain5j-solo

简介

chain5j-solo chain5j链solo共识。

功能

证书

chain5j-solo 的源码允许用户在遵循 Apache 2.0 开源证书 规则的前提下使用。

版权

Copyright@2022 chain5j

chain5j

Documentation

Overview

Package solo

@author: xwc1125

Package solo

@author: xwc1125

Package solo

@author: xwc1125

Package solo

@author: xwc1125

Package solo

@author: xwc1125

Package solo

@author: xwc1125

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownBlock     = errors.New("unknown block")
	ErrFutureBlock      = errors.New("block in the future")
	ErrUnknownAncestor  = errors.New("unknown ancestor")
	ErrInvalidTimestamp = errors.New("invalid timestamp")
)

Functions

func NewConsensus

func NewConsensus(rootCtx context.Context, opts ...option) (protocol.Consensus, error)

func WithAPIs

func WithAPIs(apis protocol.APIs) option

func WithConfig

func WithConfig(config protocol.Config) option

func WithNodeKey

func WithNodeKey(nodeKey protocol.NodeKey) option

Types

type API

type API struct {
}

type Snapshot

type Snapshot interface {
	Store(db kvstore.Database) error                  // 将快照存入数据库
	Copy() Snapshot                                   // 深度拷贝快照
	Apply(headers []*models.Header) (Snapshot, error) // 通过给定的header生成授权快照
}

type SoloConfig

type SoloConfig struct {
	Period uint64 `json:"period"` // Number of seconds between blocks to enforce
	Epoch  uint64 `json:"epoch"`  // 重置投票及检测点的长度
}

Jump to

Keyboard shortcuts

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