sebak: boscoin.io/sebak/lib/node/runner Index | Files | Directories

package runner

import "boscoin.io/sebak/lib/node/runner"

Package sebak is the node of blockchain, which implements "ISAAC" Consensus Protocol at first time. ISAAC is based on the FBA consensus protocol, but is totally different from SCP(Stellar Cosensus Protocol).

sebak is the old term of "SaeByeog" in Korean, which means dawn.

Struct that bridges together components of a node

NodeRunner bridges together the connection, storage and `LocalNode`. In this regard, it can be seen as a single node, and is used as such in unit tests.

Index

Package Files

api_ballot.go api_block.go api_block_options.go api_discovery.go api_node.go api_transaction.go block_operations.go checker.go checker_ballot_transaction.go checker_message.go doc.go finish_ballot.go init.go isaac_state_manager.go jsonrpc.go node_runner.go test.go test_connection_manager.go util.go

Constants

const (
    NodeInfoHandlerPattern  string = "/"
    ConnectHandlerPattern   string = "/connect"
    DiscoveryHandlerPattern string = "/discovery"
    MessageHandlerPattern   string = "/message"
    BallotHandlerPattern    string = "/ballot"
)
const GetBallotPattern = "/ballots"
const GetBlocksPattern = "/blocks"
const GetTransactionPattern string = "/transactions"
const MaxLimitListOptions uint64 = 10000
const MaxSnapshots uint64 = 500

Variables

var DebugPProf bool = false
var DefaultHandleACCEPTBallotCheckerFuncs = []common.CheckerFunc{
    BallotAlreadyVoted,
    BallotVote,
    BallotIsSameProposer,
    BallotRenewal,
    BallotCheckResult,
    FinishedBallotStore,
}
var DefaultHandleBaseBallotCheckerFuncs = []common.CheckerFunc{
    BallotUnmarshal,
    BallotNotFromKnownValidators,
    BallotCheckSYNC,
    BallotCheckBasis,
}
var DefaultHandleINITBallotCheckerFuncs = []common.CheckerFunc{
    BallotAlreadyVoted,
    BallotVote,
    BallotIsSameProposer,
    BallotValidateOperationBodyCollectTxFee,
    BallotValidateOperationBodyInflation,
    BallotGetMissingTransaction,
    INITBallotValidateTransactions,
    SIGNBallotBroadcast,
    TransitStateToSIGN,
}
var DefaultHandleSIGNBallotCheckerFuncs = []common.CheckerFunc{
    BallotAlreadyVoted,
    BallotVote,
    BallotIsSameProposer,
    BallotRenewal,
    BallotCheckResult,
    ExpiredInSIGN,
    ACCEPTBallotBroadcast,
    TransitStateToACCEPT,
}
var HandleTransactionCheckerForWatcherFuncs = []common.CheckerFunc{
    TransactionUnmarshal,
    HasTransaction,
    MessageHasSameSource,
    MessageValidate,
    BroadcastTransactionFromWatcher,
}
var HandleTransactionCheckerFuncs = []common.CheckerFunc{
    TransactionUnmarshal,
    HasTransaction,
    MessageHasSameSource,
    MessageValidate,
    PushIntoTransactionPoolFromClient,
    BroadcastTransaction,
}
var HandleTransactionCheckerFuncsWithoutBroadcast = []common.CheckerFunc{
    TransactionUnmarshal,
    HasTransaction,
    MessageHasSameSource,
    MessageValidate,
    PushIntoTransactionPoolFromNode,
}
var INITBallotTransactionCheckerFuncs = []common.CheckerFunc{
    IsNew,
    CheckMissingTransaction,
    BallotTransactionsOperationLimit,
    BallotTransactionsSameSource,
    BallotTransactionsOperationBodyCollectTxFee,
    BallotTransactionsAllValid,
}
var NewBallotTransactionCheckerFuncs = []common.CheckerFunc{
    IsNew,
    BallotTransactionsSameSource,
}

func ACCEPTBallotBroadcast Uses

func ACCEPTBallotBroadcast(c common.Checker, args ...interface{}) (err error)

ACCEPTBallotBroadcast will broadcast the confirmed ACCEPT ballot.

func BallotAlreadyVoted Uses

func BallotAlreadyVoted(c common.Checker, args ...interface{}) (err error)

BallotAlreadyVoted checks the node of ballot voted.

func BallotCheckBasis Uses

func BallotCheckBasis(c common.Checker, args ...interface{}) (err error)

BallotCheckBasis checks the incoming ballot in valid round.

func BallotCheckResult Uses

func BallotCheckResult(c common.Checker, args ...interface{}) (err error)

BallotCheckResult checks the voting result.

func BallotCheckSYNC Uses

func BallotCheckSYNC(c common.Checker, args ...interface{}) error

BallotCheckSYNC performs sync by considering sync condition. And to participate in the consensus, update the latestblock by referring to the database.

func BallotGetMissingTransaction Uses

func BallotGetMissingTransaction(c common.Checker, args ...interface{}) (err error)

func BallotIsSameProposer Uses

func BallotIsSameProposer(c common.Checker, args ...interface{}) (err error)

BallotIsSameProposer checks the incoming ballot has the same proposer with the current `RunningRound`.

func BallotNotFromKnownValidators Uses

func BallotNotFromKnownValidators(c common.Checker, args ...interface{}) (err error)

BallotNotFromKnownValidators checks the incoming ballot is from the known validators.

func BallotRenewal Uses

func BallotRenewal(c common.Checker, args ...interface{}) (err error)

BallotRenewal checks that the ballot confirmed and proposed time is valid and if the time is invalid, then it broadcasts expired ballot

func BallotTransactionsAllValid Uses

func BallotTransactionsAllValid(c common.Checker, args ...interface{}) (err error)

BallotTransactionsAllValid checks all the transactions are valid or not.

func BallotTransactionsOperationBodyCollectTxFee Uses

func BallotTransactionsOperationBodyCollectTxFee(c common.Checker, args ...interface{}) (err error)

BallotTransactionsOperationBodyCollectTxFee validates the `BallotTransactionsOperationBodyCollectTxFee.Amount` is matched with the collected fee of all transactions.

func BallotTransactionsOperationLimit Uses

func BallotTransactionsOperationLimit(c common.Checker, args ...interface{}) error

BallotTransactionsOperationLimit checks the total number of operations is over `OpsInBallotLimit`.

func BallotTransactionsSameSource Uses

func BallotTransactionsSameSource(c common.Checker, args ...interface{}) (err error)

BallotTransactionsSameSource checks there are transactions which has same source in the `Transactions`.

func BallotUnmarshal Uses

func BallotUnmarshal(c common.Checker, args ...interface{}) (err error)

BallotUnmarshal makes `Ballot` from common.NetworkMessage.

func BallotValidateOperationBodyCollectTxFee Uses

func BallotValidateOperationBodyCollectTxFee(c common.Checker, args ...interface{}) (err error)

BallotValidateOperationBodyCollectTxFee validates `CollectTxFee`.

func BallotValidateOperationBodyInflation Uses

func BallotValidateOperationBodyInflation(c common.Checker, args ...interface{}) (err error)

BallotValidateOperationBodyInflation validates `Inflation`

func BallotVote Uses

func BallotVote(c common.Checker, args ...interface{}) (err error)

BallotVote vote by incoming ballot; if the ballot is new and the round of ballot is not yet registered, this will make new `RunningRound`.

func BroadcastTransaction Uses

func BroadcastTransaction(c common.Checker, args ...interface{}) (err error)

BroadcastTransaction broadcasts the incoming transaction to the other nodes.

func BroadcastTransactionFromWatcher Uses

func BroadcastTransactionFromWatcher(c common.Checker, args ...interface{}) error

BroadcastTransactionFromWatcher is sending tx to one of validators. If all validators returns error, it returns error.

func CheckMissingTransaction Uses

func CheckMissingTransaction(c common.Checker, args ...interface{}) (err error)

CheckMissingTransaction will get the missing tranactions, that is, not in `Pool` from proposer.

func ExpiredInSIGN Uses

func ExpiredInSIGN(c common.Checker, args ...interface{}) (err error)

func FinishProposerTransaction Uses

func FinishProposerTransaction(st *storage.LevelDBBackend, blk block.Block, ptx ballot.ProposerTransaction, log logging.Logger) (err error)

func FinishTransactions Uses

func FinishTransactions(blk block.Block, transactions []*transaction.Transaction, st *storage.LevelDBBackend) (err error)

func FinishedBallotStore Uses

func FinishedBallotStore(c common.Checker, args ...interface{}) error

FinishedBallotStore will store the confirmed ballot to `Block`.

func GenerateBallot Uses

func GenerateBallot(proposer *node.LocalNode, basis voting.Basis, tx transaction.Transaction, ballotState ballot.State, sender *node.LocalNode, conf common.Config) *ballot.Ballot

func GenerateEmptyTxBallot Uses

func GenerateEmptyTxBallot(proposer *node.LocalNode, basis voting.Basis, ballotState ballot.State, sender *node.LocalNode, conf common.Config) *ballot.Ballot

func GetCommonAccount Uses

func GetCommonAccount(st *storage.LevelDBBackend) (account *block.BlockAccount, err error)

func GetCreateAccountTransaction Uses

func GetCreateAccountTransaction(sequenceID uint64, amount uint64) (transaction.Transaction, []byte, *keypair.Full)

func GetGenesisAccount Uses

func GetGenesisAccount(st *storage.LevelDBBackend) (account *block.BlockAccount, err error)

func GetGenesisBalance Uses

func GetGenesisBalance(st *storage.LevelDBBackend) (balance common.Amount, err error)

func GetGenesisTransaction Uses

func GetGenesisTransaction(st *storage.LevelDBBackend) (bt block.BlockTransaction, err error)

func GetPaymentTransaction Uses

func GetPaymentTransaction(kpSource *keypair.Full, target string, sequenceID uint64, amount uint64) (transaction.Transaction, []byte)

func GetTransaction Uses

func GetTransaction() (transaction.Transaction, []byte)

func HasTransaction Uses

func HasTransaction(c common.Checker, args ...interface{}) (err error)

HasTransaction checks transaction is in `Pool` And `Block`

func INITBallotValidateTransactions Uses

func INITBallotValidateTransactions(c common.Checker, args ...interface{}) (err error)

INITBallotValidateTransactions validates the transactions of newly added ballot.

func IsNew Uses

func IsNew(c common.Checker, args ...interface{}) (err error)

IsNew checks the incoming transaction is already stored or not.

func MakeConsensusAndBlock Uses

func MakeConsensusAndBlock(t *testing.T, tx transaction.Transaction, nr *NodeRunner, nodes []*node.LocalNode, proposer *node.LocalNode) (block.Block, error)

func MessageHasSameSource Uses

func MessageHasSameSource(c common.Checker, args ...interface{}) (err error)

SameSource checks there are transactions which has same source in the `Pool`.

func MessageValidate Uses

func MessageValidate(c common.Checker, args ...interface{}) (err error)

MessageValidate validates.

func NewNodeInfo Uses

func NewNodeInfo(nr *NodeRunner) node.NodeInfo

func NodeInfoWithRequest Uses

func NodeInfoWithRequest(localNode *node.LocalNode, r *http.Request) (b []byte, err error)

func ProcessProposerTransaction Uses

func ProcessProposerTransaction(st *storage.LevelDBBackend, blk block.Block, ptx ballot.ProposerTransaction, log logging.Logger) (err error)

func PushIntoTransactionPool Uses

func PushIntoTransactionPool(c common.Checker, args ...interface{}) error

PushIntoTransactionPool add the incoming transactions into `Pool`.

func PushIntoTransactionPoolFromClient Uses

func PushIntoTransactionPoolFromClient(c common.Checker, args ...interface{}) error

PushIntoTransactionPoolFromClient add the incoming tx from client

func PushIntoTransactionPoolFromNode Uses

func PushIntoTransactionPoolFromNode(c common.Checker, args ...interface{}) error

PushIntoTransactionPoolFromNode add the incoming tx from node

func ReceiveBallot Uses

func ReceiveBallot(nodeRunner *NodeRunner, ballot *ballot.Ballot) error

func SIGNBallotBroadcast Uses

func SIGNBallotBroadcast(c common.Checker, args ...interface{}) (err error)

SIGNBallotBroadcast will broadcast the validated SIGN ballot.

func SetLogging Uses

func SetLogging(level logging.Lvl, handler logging.Handler)

func TransactionUnmarshal Uses

func TransactionUnmarshal(c common.Checker, args ...interface{}) (err error)

TransactionUnmarshal makes `Transaction` from incoming `common.NetworkMessage`.

func TransitStateToACCEPT Uses

func TransitStateToACCEPT(c common.Checker, args ...interface{}) (err error)

TransitStateToACCEPT changes ISAACState to ACCEPT

func TransitStateToSIGN Uses

func TransitStateToSIGN(c common.Checker, args ...interface{}) (err error)

TransitStateToSIGN changes ISAACState to SIGN

func ValidateOp Uses

func ValidateOp(st *storage.LevelDBBackend, config common.Config, source *block.BlockAccount, op operation.Operation) (err error)

Validate an operation

This function is critical for consensus, as it defines the validation rules for an operation, and by extension a transaction. It is called from ValidateTx.

Params:

st = Storage backend to use (e.g. to access the blocks)
     Only ever read from, never written to.
config = consist of configuration of the network. common address, congress address, etc.
source = Account from where the transaction (and ops) come from
tx = Transaction to check

func ValidateTx Uses

func ValidateTx(st *storage.LevelDBBackend, config common.Config, tx transaction.Transaction) (err error)

Validate the entirety of a transaction

This function is critical for consensus, as it defines the validation rules for a transaction. It is executed whenever a transaction is received.

As it is run on every single transaction, it should be as fast as possible, thus any new code should carefully consider when it takes place. Consider putting cheap, frequent errors first.

Note that if we get to this function, it means the transaction is known to be well-formed (e.g. the signature is legit).

Params:

st = Storage backend to use (e.g. to access the blocks)
     Only ever read from, never written to.
config = consist of configuration of the network. common address, congress address, etc.
tx = Transaction to check

type BallotChecker Uses

type BallotChecker struct {
    common.DefaultChecker

    NodeRunner         *NodeRunner
    Conf               common.Config
    LocalNode          *node.LocalNode
    Message            common.NetworkMessage
    IsNew              bool
    IsMine             bool
    Ballot             ballot.Ballot
    VotingHole         voting.Hole
    Result             consensus.RoundVoteResult
    VotingFinished     bool
    FinishedVotingHole voting.Hole
    LatestBlockSources []string

    Log logging.Logger
}

type BallotTransactionChecker Uses

type BallotTransactionChecker struct {
    sync.RWMutex
    common.DefaultChecker

    NodeRunner *NodeRunner
    Conf       common.Config
    LocalNode  node.Node
    NetworkID  []byte

    Ballot            ballot.Ballot
    Transactions      []string
    VotingHole        voting.Hole
    ValidTransactions []string

    CheckTransactionsOnly bool
    // contains filtered or unexported fields
}

type CheckerStopCloseConsensus Uses

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

func NewCheckerStopCloseConsensus Uses

func NewCheckerStopCloseConsensus(checker *BallotChecker, message string) CheckerStopCloseConsensus

func (CheckerStopCloseConsensus) Checker Uses

func (c CheckerStopCloseConsensus) Checker() common.Checker

func (CheckerStopCloseConsensus) Error Uses

func (c CheckerStopCloseConsensus) Error() string

type DBEchoArgs Uses

type DBEchoArgs string

type DBEchoResult Uses

type DBEchoResult string

type DBGetArgs Uses

type DBGetArgs struct {
    Snapshot string `json:"snapshot"`
    Key      string `json:"key"`
}

type DBGetIteratorArgs Uses

type DBGetIteratorArgs struct {
    Snapshot string             `json:"snapshot"`
    Prefix   string             `json:"prefix"`
    Options  GetIteratorOptions `json:"options"`
}

type DBGetIteratorResult Uses

type DBGetIteratorResult struct {
    Limit uint64             `json:"limit"`
    Items []storage.IterItem `json:"items"`
}

type DBGetResult Uses

type DBGetResult storage.IterItem

type DBHasArgs Uses

type DBHasArgs struct {
    Snapshot string `json:"snapshot"`
    Key      string `json:"key"`
}

type DBHasResult Uses

type DBHasResult bool

type DBOpenSnapshot Uses

type DBOpenSnapshot struct{}

type DBOpenSnapshotResult Uses

type DBOpenSnapshotResult struct {
    Snapshot string `json:"snapshot"`
}

type DBReleaseSnapshot Uses

type DBReleaseSnapshot struct {
    Snapshot string `json:"snapshot"`
}

type DBReleaseSnapshotResult Uses

type DBReleaseSnapshotResult bool

type FixedSelector Uses

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

func (FixedSelector) Select Uses

func (s FixedSelector) Select(_ uint64, _ uint64) string

type GetBlocksOptions Uses

type GetBlocksOptions struct {
    *storage.DefaultListOptions

    HeightRange [2]uint64
    Hashes      []string
    Mode        GetBlocksOptionsMode
}

func NewGetBlocksOptionsFromRequest Uses

func NewGetBlocksOptionsFromRequest(r *http.Request) (options *GetBlocksOptions, err error)

func (GetBlocksOptions) Height Uses

func (g GetBlocksOptions) Height() uint64

func (*GetBlocksOptions) SetHashes Uses

func (g *GetBlocksOptions) SetHashes(h []string) *GetBlocksOptions

func (*GetBlocksOptions) SetHeightRange Uses

func (g *GetBlocksOptions) SetHeightRange(h [2]uint64) *GetBlocksOptions

func (*GetBlocksOptions) SetMode Uses

func (g *GetBlocksOptions) SetMode(mode GetBlocksOptionsMode) *GetBlocksOptions

func (GetBlocksOptions) Template Uses

func (g GetBlocksOptions) Template() string

func (GetBlocksOptions) URLValues Uses

func (g GetBlocksOptions) URLValues() url.Values

type GetBlocksOptionsMode Uses

type GetBlocksOptionsMode string
const (
    GetBlocksOptionsModeHeader GetBlocksOptionsMode = "header" // default
    GetBlocksOptionsModeBlock  GetBlocksOptionsMode = "block"
    GetBlocksOptionsModeFull   GetBlocksOptionsMode = "full"
)

type GetIteratorOptions Uses

type GetIteratorOptions struct {
    Reverse bool   `json:"reverse"`
    Cursor  []byte `json:"cursor"`
    Limit   uint64 `json:"limit"`
}

type ISAACStateManager Uses

type ISAACStateManager struct {
    sync.RWMutex

    Conf common.Config
    // contains filtered or unexported fields
}

ISAACStateManager manages the ISAACState. The most important function `Start()` is called in startStateManager() function in node_runner.go by goroutine.

func NewISAACStateManager Uses

func NewISAACStateManager(nr *NodeRunner, conf common.Config) *ISAACStateManager

func (*ISAACStateManager) NextHeight Uses

func (sm *ISAACStateManager) NextHeight()

func (*ISAACStateManager) NextRound Uses

func (sm *ISAACStateManager) NextRound()

func (*ISAACStateManager) SetTransitSignal Uses

func (sm *ISAACStateManager) SetTransitSignal(f func(consensus.ISAACState))

func (*ISAACStateManager) Start Uses

func (sm *ISAACStateManager) Start()

In `Start()` method a node proposes ballot. Or it sets or resets timeout. If it is expired, it broadcasts B(`EXP`). And it manages the node round.

func (*ISAACStateManager) State Uses

func (sm *ISAACStateManager) State() consensus.ISAACState

func (*ISAACStateManager) Stop Uses

func (sm *ISAACStateManager) Stop()

func (*ISAACStateManager) TransitISAACState Uses

func (sm *ISAACStateManager) TransitISAACState(height uint64, round uint64, ballotState ballot.State)

type MessageChecker Uses

type MessageChecker struct {
    common.DefaultChecker

    Conf            common.Config
    LocalNode       *node.LocalNode
    NetworkID       []byte
    Message         common.NetworkMessage
    Log             logging.Logger
    Consensus       *consensus.ISAAC
    TransactionPool *transaction.Pool
    Storage         *storage.LevelDBBackend
    Transaction     transaction.Transaction
}

type NetworkHandlerNode Uses

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

func NewNetworkHandlerNode Uses

func NewNetworkHandlerNode(localNode *node.LocalNode, network network.Network, storage *storage.LevelDBBackend, consensus *consensus.ISAAC, transactionPool *transaction.Pool, urlPrefix string, conf common.Config) *NetworkHandlerNode

func (NetworkHandlerNode) BallotHandler Uses

func (api NetworkHandlerNode) BallotHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) ConnectHandler Uses

func (api NetworkHandlerNode) ConnectHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) DiscoveryHandler Uses

func (nh NetworkHandlerNode) DiscoveryHandler(w http.ResponseWriter, r *http.Request)

DiscoveryHandler will receive the `DiscoveryMessage` and checks the undiscovered validators. If found, trying to update validator data.

func (NetworkHandlerNode) GetBallotHandler Uses

func (nh NetworkHandlerNode) GetBallotHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) GetBlocksHandler Uses

func (nh NetworkHandlerNode) GetBlocksHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) GetNodeTransactionsHandler Uses

func (nh NetworkHandlerNode) GetNodeTransactionsHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) HandlerURLPattern Uses

func (api NetworkHandlerNode) HandlerURLPattern(pattern string) string

func (NetworkHandlerNode) MessageHandler Uses

func (api NetworkHandlerNode) MessageHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) NodeInfoHandler Uses

func (api NetworkHandlerNode) NodeInfoHandler(w http.ResponseWriter, r *http.Request)

func (NetworkHandlerNode) ReceiveTransaction Uses

func (api NetworkHandlerNode) ReceiveTransaction(body []byte, funcs []common.CheckerFunc) (transaction.Transaction, error)

type NodeRunner Uses

type NodeRunner struct {
    sync.RWMutex

    TransactionPool *transaction.Pool

    Conf common.Config
    // contains filtered or unexported fields
}

func MakeNodeRunner Uses

func MakeNodeRunner() (*NodeRunner, *node.LocalNode)

func NewNodeRunner Uses

func NewNodeRunner(
    localNode *node.LocalNode,
    policy voting.ThresholdPolicy,
    n network.Network,
    c *consensus.ISAAC,
    storage *storage.LevelDBBackend,
    tp *transaction.Pool,
    conf common.Config,
) (nr *NodeRunner, err error)

func (*NodeRunner) BallotSendRecord Uses

func (nr *NodeRunner) BallotSendRecord() *consensus.BallotSendRecord

func (*NodeRunner) BroadcastBallot Uses

func (nr *NodeRunner) BroadcastBallot(b ballot.Ballot)

func (*NodeRunner) ConnectValidators Uses

func (nr *NodeRunner) ConnectValidators()

func (*NodeRunner) ConnectionManager Uses

func (nr *NodeRunner) ConnectionManager() network.ConnectionManager

func (*NodeRunner) Consensus Uses

func (nr *NodeRunner) Consensus() *consensus.ISAAC

func (*NodeRunner) InitRound Uses

func (nr *NodeRunner) InitRound()

func (*NodeRunner) InitSent Uses

func (nr *NodeRunner) InitSent(state consensus.ISAACState)

func (*NodeRunner) Log Uses

func (nr *NodeRunner) Log() logging.Logger

func (*NodeRunner) Network Uses

func (nr *NodeRunner) Network() network.Network

func (*NodeRunner) NetworkID Uses

func (nr *NodeRunner) NetworkID() []byte

func (*NodeRunner) NextHeight Uses

func (nr *NodeRunner) NextHeight()

func (*NodeRunner) Node Uses

func (nr *NodeRunner) Node() *node.LocalNode

func (*NodeRunner) NodeInfo Uses

func (nr *NodeRunner) NodeInfo() node.NodeInfo

func (*NodeRunner) Policy Uses

func (nr *NodeRunner) Policy() voting.ThresholdPolicy

func (*NodeRunner) Ready Uses

func (nr *NodeRunner) Ready()

func (*NodeRunner) RemoveSendRecordsLowerThanOrEqualHeight Uses

func (nr *NodeRunner) RemoveSendRecordsLowerThanOrEqualHeight(height uint64)

func (*NodeRunner) SavingBlockOperations Uses

func (nr *NodeRunner) SavingBlockOperations() *SavingBlockOperations

func (*NodeRunner) SetHandleACCEPTBallotCheckerFuncs Uses

func (nr *NodeRunner) SetHandleACCEPTBallotCheckerFuncs(f ...common.CheckerFunc)

func (*NodeRunner) SetHandleBaseBallotCheckerFuncs Uses

func (nr *NodeRunner) SetHandleBaseBallotCheckerFuncs(f ...common.CheckerFunc)

func (*NodeRunner) SetHandleINITBallotCheckerFuncs Uses

func (nr *NodeRunner) SetHandleINITBallotCheckerFuncs(f ...common.CheckerFunc)

func (*NodeRunner) SetHandleSIGNBallotCheckerFuncs Uses

func (nr *NodeRunner) SetHandleSIGNBallotCheckerFuncs(f ...common.CheckerFunc)

func (*NodeRunner) Start Uses

func (nr *NodeRunner) Start() (err error)

func (*NodeRunner) Stop Uses

func (nr *NodeRunner) Stop()

func (*NodeRunner) StopStateManager Uses

func (nr *NodeRunner) StopStateManager()

func (*NodeRunner) Storage Uses

func (nr *NodeRunner) Storage() *storage.LevelDBBackend

func (*NodeRunner) TransitISAACState Uses

func (nr *NodeRunner) TransitISAACState(basis voting.Basis, ballotState ballot.State)

type OtherSelector Uses

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

func (OtherSelector) Select Uses

func (s OtherSelector) Select(_ uint64, _ uint64) string

type SavingBlockOperations Uses

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

func NewSavingBlockOperations Uses

func NewSavingBlockOperations(st *storage.LevelDBBackend, logger logging.Logger) *SavingBlockOperations

func (*SavingBlockOperations) Check Uses

func (sb *SavingBlockOperations) Check() (err error)

func (*SavingBlockOperations) CheckByBlock Uses

func (sb *SavingBlockOperations) CheckByBlock(st *storage.LevelDBBackend, blk block.Block) (err error)

func (*SavingBlockOperations) CheckTransactionByBlock Uses

func (sb *SavingBlockOperations) CheckTransactionByBlock(st *storage.LevelDBBackend, blk block.Block, hash string) (err error)

func (*SavingBlockOperations) Save Uses

func (sb *SavingBlockOperations) Save(blk block.Block)

func (*SavingBlockOperations) Start Uses

func (sb *SavingBlockOperations) Start()

type SelfThenOtherSelector Uses

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

func (SelfThenOtherSelector) Select Uses

func (s SelfThenOtherSelector) Select(blockHeight uint64, round uint64) string

type TestConnectionManager Uses

type TestConnectionManager struct {
    sync.RWMutex
    network.ConnectionManager
    // contains filtered or unexported fields
}

func NewTestConnectionManager Uses

func NewTestConnectionManager(
    localNode *node.LocalNode,
    n network.Network,
    policy voting.ThresholdPolicy,
    r chan struct{},
) *TestConnectionManager

func (*TestConnectionManager) Broadcast Uses

func (c *TestConnectionManager) Broadcast(message common.Message)

func (*TestConnectionManager) IsReady Uses

func (c *TestConnectionManager) IsReady() bool

func (*TestConnectionManager) Messages Uses

func (c *TestConnectionManager) Messages() []common.Message

type TransactionCache Uses

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

func NewTransactionCache Uses

func NewTransactionCache(st *storage.LevelDBBackend, pool *transaction.Pool) *TransactionCache

func (*TransactionCache) Get Uses

func (b *TransactionCache) Get(hash string) (tx transaction.Transaction, found bool, err error)

Directories

PathSynopsis
api
api/resource
node_api

Package runner imports 42 packages (graph) and is imported by 4 packages. Updated 2019-03-27. Refresh now. Tools for package owners.