Documentation ¶
Overview ¶
Package babble wraps the babble and EVM-Lite components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InmemBabble ¶
type InmemBabble struct {
// contains filtered or unexported fields
}
InmemBabble implementes EVM-Lite's Consensus interface. It uses an inmemory Babble node.
func NewInmemBabble ¶
func NewInmemBabble(config *babble_config.Config, logger *logrus.Entry) *InmemBabble
NewInmemBabble instantiates a new InmemBabble consensus system
func (*InmemBabble) Info ¶
func (ib *InmemBabble) Info() (map[string]string, error)
Info returns Babble stats
func (*InmemBabble) Init ¶
Init instantiates a Babble inmemory node.
XXX - Normally, the Babble object takes a reference to the InmemProxy via its config. Here, we need the InmemProxy to have a reference to the Babble object as well; a sort of circular reference, which is quite ugly. This is necessary because the InmemProxy calls the babble object directly to retrieve the list of validators. We will change this when Blocks are modified to contain the validator-set. cf. work on babble merkleize branch.
type InmemProxy ¶
type InmemProxy struct {
// contains filtered or unexported fields
}
InmemProxy implements the Babble AppProxy interface
func NewInmemProxy ¶
func NewInmemProxy(state *state.State, service *service.Service, babble *babble.Babble, submitCh chan []byte, logger *logrus.Entry) *InmemProxy
NewInmemProxy initializes and return a new InmemProxy
func (*InmemProxy) CommitBlock ¶
func (p *InmemProxy) CommitBlock(block hashgraph.Block) (proxy.CommitResponse, error)
CommitBlock applies the block's transactions to the state and commits. All transaction fees are sent to the coinbase address, which is computed from the block and the current validator-set. It also checks the block's internal transactions against the POA smart-contract to verify if joining peers are authorised to become validators in Babble. It returns the resulting state-hash and internal transaction receips.
func (*InmemProxy) GetSnapshot ¶
func (p *InmemProxy) GetSnapshot(blockIndex int) ([]byte, error)
GetSnapshot will generate a snapshot
func (*InmemProxy) Restore ¶
func (p *InmemProxy) Restore(snapshot []byte) error
Restore will restore a snapshot
func (*InmemProxy) SubmitCh ¶
func (p *InmemProxy) SubmitCh() chan []byte
SubmitCh is the channel through which the Service sends transactions to the node.