tendermint

package
v0.0.0-...-2935fa7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NeverCreateEmptyBlocks  = "never"
	AlwaysCreateEmptyBlocks = "always"
)

Variables

View Source
var (
	ErrInvalidLengthTendermint        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTendermint          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTendermint = fmt.Errorf("proto: unexpected end of group")
)

Functions

func DBProvider

func DBProvider(ID string, backendType dbm.BackendType, dbDir string) (dbm.DB, error)

func DeriveGenesisDoc

func DeriveGenesisDoc(hscGenesisDoc *genesis.GenesisDoc, appHash []byte) *tmTypes.GenesisDoc

func EnsureNodeKey

func EnsureNodeKey(nodeKeyFile string) (*p2p.NodeKey, error)

func NewLogger

func NewLogger(logger *logging.Logger) log.Logger

func NewNodeKey

func NewNodeKey() *p2p.NodeKey

func NewPrivValidatorMemory

func NewPrivValidatorMemory(addressable crypto.Addressable, signer crypto.Signer) *privValidatorMemory

Create a PrivValidator with in-memory state that takes an addressable representing the validator identity and a signer providing private signing for that identity.

func WriteNodeKey

func WriteNodeKey(nodeKeyFile string, key json.RawMessage) error

Types

type BurrowConfig

type BurrowConfig struct {
	Enabled bool
	// Initial peers we connect to for peer exchange
	Seeds string
	// Whether this node should crawl the network looking for new peers - disconnecting to peers after it has shared addresses
	SeedMode bool
	// Peers to which we automatically connect
	PersistentPeers string
	ListenHost      string
	ListenPort      string
	// Optional external that nodes may provide with their NodeInfo
	ExternalAddress string
	// Set true for strict address routability rules
	// Set false for private or local networks
	AddrBookStrict bool
	Moniker        string
	// Only accept connections from registered peers
	IdentifyPeers bool
	// Peers ID or address this node is authorize to sync with
	AuthorizedPeers string
	// EmptyBlocks mode and possible interval between empty blocks in seconds, one of:
	// "", "never" (to never create unnecessary blocks)
	// "always" (to create empty blocks each consensus round)
	CreateEmptyBlocks string
}

HiveSmartChain's view on Tendermint's config. Since we operate as a Tendermint harness not all configuration values are applicable, we may not allow some values to specified, or we may not allow some to be set independently. So this serves as a layer of indirection over Tendermint's real config that we derive from ours.

func DefaultBurrowConfig

func DefaultBurrowConfig() *BurrowConfig

func (*BurrowConfig) Config

func (btc *BurrowConfig) Config(rootDir string, timeoutFactor float64) (*tmConfig.Config, error)

func (*BurrowConfig) DefaultAuthorizedPeersProvider

func (btc *BurrowConfig) DefaultAuthorizedPeersProvider() abci.AuthorizedPeers

func (*BurrowConfig) ListenAddress

func (btc *BurrowConfig) ListenAddress() string

type LastSignedInfo

type LastSignedInfo struct {
	sync.Mutex
	Height    int64           `json:"height"`
	Round     int32           `json:"round"`
	Step      int8            `json:"step"`
	Signature []byte          `json:"signature,omitempty"` // so we don't lose signatures
	SignBytes binary.HexBytes `json:"signbytes,omitempty"` // so we don't lose signatures
}

LastSignedInfo contains information about the latest data signed by a validator to help prevent double signing.

func NewLastSignedInfo

func NewLastSignedInfo() *LastSignedInfo

func (*LastSignedInfo) SignProposal

func (lsi *LastSignedInfo) SignProposal(sign tmCryptoSigner, chainID string, proposal *tmproto.Proposal) error

SignProposal signs a canonical representation of the proposal, along with the chainID. Implements PrivValidator.

func (*LastSignedInfo) SignVote

func (lsi *LastSignedInfo) SignVote(sign tmCryptoSigner, chainID string, vote *tmproto.Vote) error

SignVote signs a canonical representation of the vote, along with the chainID. Implements PrivValidator.

func (*LastSignedInfo) String

func (lsi *LastSignedInfo) String() string

String returns a string representation of the LastSignedInfo.

type Node

type Node struct {
	*node.Node
	// contains filtered or unexported fields
}

Serves as a wrapper around the Tendermint node's closeable resources (database connections)

func NewNode

func NewNode(conf *config.Config, privValidator tmTypes.PrivValidator, genesisDoc *tmTypes.GenesisDoc,
	app *abci.App, metricsProvider node.MetricsProvider, logger *logging.Logger) (*Node, error)

func (*Node) Close

func (n *Node) Close()

func (*Node) DBProvider

func (n *Node) DBProvider(ctx *node.DBContext) (dbm.DB, error)

Since Tendermint doesn't close its DB connections

type NodeInfo

type NodeInfo struct {
	ID                   hsccrypto.Address  `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/klyed/hivesmartchain/crypto.Address" json:"ID"`
	ListenAddress        string             `protobuf:"bytes,2,opt,name=ListenAddress,proto3" json:"ListenAddress,omitempty"`
	Network              string             `protobuf:"bytes,3,opt,name=Network,proto3" json:"Network,omitempty"`
	Version              string             `protobuf:"bytes,4,opt,name=Version,proto3" json:"Version,omitempty"`
	Channels             hscbinary.HexBytes `protobuf:"bytes,5,opt,name=Channels,proto3,customtype=github.com/klyed/hivesmartchain/binary.HexBytes" json:"Channels"`
	Moniker              string             `protobuf:"bytes,6,opt,name=Moniker,proto3" json:"Moniker,omitempty"`
	RPCAddress           string             `protobuf:"bytes,7,opt,name=RPCAddress,proto3" json:"RPCAddress,omitempty"`
	TxIndex              string             `protobuf:"bytes,8,opt,name=TxIndex,proto3" json:"TxIndex,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func NewNodeInfo

func NewNodeInfo(ni p2p.DefaultNodeInfo) *NodeInfo

func (*NodeInfo) Descriptor

func (*NodeInfo) Descriptor() ([]byte, []int)

func (*NodeInfo) GetListenAddress

func (m *NodeInfo) GetListenAddress() string

func (*NodeInfo) GetMoniker

func (m *NodeInfo) GetMoniker() string

func (*NodeInfo) GetNetwork

func (m *NodeInfo) GetNetwork() string

func (*NodeInfo) GetRPCAddress

func (m *NodeInfo) GetRPCAddress() string

func (*NodeInfo) GetTxIndex

func (m *NodeInfo) GetTxIndex() string

func (*NodeInfo) GetVersion

func (m *NodeInfo) GetVersion() string

func (*NodeInfo) Marshal

func (m *NodeInfo) Marshal() (dAtA []byte, err error)

func (*NodeInfo) MarshalTo

func (m *NodeInfo) MarshalTo(dAtA []byte) (int, error)

func (*NodeInfo) MarshalToSizedBuffer

func (m *NodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) Reset

func (m *NodeInfo) Reset()

func (*NodeInfo) Size

func (m *NodeInfo) Size() (n int)

func (*NodeInfo) String

func (m *NodeInfo) String() string

func (*NodeInfo) Unmarshal

func (m *NodeInfo) Unmarshal(dAtA []byte) error

func (*NodeInfo) XXX_DiscardUnknown

func (m *NodeInfo) XXX_DiscardUnknown()

func (*NodeInfo) XXX_Marshal

func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeInfo) XXX_Merge

func (m *NodeInfo) XXX_Merge(src proto.Message)

func (*NodeInfo) XXX_MessageName

func (*NodeInfo) XXX_MessageName() string

func (*NodeInfo) XXX_Size

func (m *NodeInfo) XXX_Size() int

func (*NodeInfo) XXX_Unmarshal

func (m *NodeInfo) XXX_Unmarshal(b []byte) error

type NodeView

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

func NewNodeView

func NewNodeView(tmNode *Node, txDecoder txs.Decoder, runID simpleuuid.UUID) (*NodeView, error)

func (*NodeView) BlockStore

func (nv *NodeView) BlockStore() state.BlockStore

func (*NodeView) IsSyncing

func (nv *NodeView) IsSyncing() bool

func (*NodeView) MempoolTransactions

func (nv *NodeView) MempoolTransactions(maxTxs int) ([]*txs.Envelope, error)

Pass -1 to get all available transactions

func (*NodeView) NodeInfo

func (nv *NodeView) NodeInfo() *NodeInfo

func (*NodeView) PeerRoundStates

func (nv *NodeView) PeerRoundStates() ([]*ctypes.PeerRoundState, error)

func (*NodeView) Peers

func (nv *NodeView) Peers() p2p.IPeerSet

func (*NodeView) RoundState

func (nv *NodeView) RoundState() *ctypes.RoundState

func (*NodeView) RoundStateJSON

func (nv *NodeView) RoundStateJSON() ([]byte, error)

func (*NodeView) RunID

func (nv *NodeView) RunID() simpleuuid.UUID

func (*NodeView) ValidatorAddress

func (nv *NodeView) ValidatorAddress() crypto.Address

func (*NodeView) ValidatorPublicKey

func (nv *NodeView) ValidatorPublicKey() *crypto.PublicKey

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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