poa

package
v0.0.0-...-7ee7fde Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

prove of authority.

Copyright (c) 2018-2020. The asimov developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoundManager

type RoundManager struct {
}

manage how validators will create blocks within a round. validators may change between different round.

func NewRoundManager

func NewRoundManager() *RoundManager

func (*RoundManager) GetContract

func (m *RoundManager) GetContract() common.Address

func (*RoundManager) GetHsMappingByRound

func (m *RoundManager) GetHsMappingByRound(round uint32) (map[string]*ainterface.ValidatorInfo, error)

func (*RoundManager) GetNextRound

func (m *RoundManager) GetNextRound(round *ainterface.Round) (*ainterface.Round, error)

func (*RoundManager) GetRoundInterval

func (m *RoundManager) GetRoundInterval(round int64) int64

func (*RoundManager) GetValidators

func (m *RoundManager) GetValidators(blockHash common.Hash, round uint32, fn ainterface.GetValidatorsCallBack) (
	[]*common.Address, map[common.Address]uint16, error)

func (*RoundManager) Halt

func (m *RoundManager) Halt()

func (*RoundManager) HasValidator

func (m *RoundManager) HasValidator(validator common.Address) bool

func (*RoundManager) Init

func (*RoundManager) Start

func (m *RoundManager) Start()

type Service

type Service struct {
	sync.Mutex
	// contains filtered or unexported fields
}

prove of authority. using round robin algorithm to generate blocks with orders in the list of authority peers. this consensus is used by sub chain using asimov. please refer to the white paper of asimov.

func NewService

func NewService(config *params.Config) (*Service, error)

* create POA Service

func (*Service) GetRoundInterval

func (s *Service) GetRoundInterval() int64

func (*Service) Halt

func (s *Service) Halt() error

func (*Service) Start

func (s *Service) Start() error

* start the Service

Jump to

Keyboard shortcuts

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