ca

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopNode     = 5
	DefaultNode = 6
	ErrNode     = 0
)

Variables

This section is empty.

Functions

func ConvertDepositToSignAddress added in v1.1.1

func ConvertDepositToSignAddress(address common.Address) (addr common.Address, err error)

ConvertDepositToSignAddress

func ConvertSignToDepositAddress added in v1.1.1

func ConvertSignToDepositAddress(address common.Address) (addr common.Address, err error)

ConvertSignToDepositAddress

func GetAccountOriginalRole

func GetAccountOriginalRole(account common.Address, hash common.Hash) (common.RoleType, error)

GetAccountOriginalRole

func GetAccountTopologyInfo

func GetAccountTopologyInfo(account common.Address, number uint64) (*mc.TopologyNodeInfo, error)

GetAccountTopologyInfo

func GetDepositAddress added in v1.1.1

func GetDepositAddress() common.Address

GetSelfDepositAddress

func GetDropNode

func GetDropNode() (result []common.Address)

GetDropNode

func GetElectedByHeight

func GetElectedByHeight(height *big.Int) ([]vm.DepositDetail, error)

GetElectedByHeight get all elected node by height.

func GetElectedByHeightAndRole

func GetElectedByHeightAndRole(height *big.Int, roleType common.RoleType) ([]vm.DepositDetail, error)

GetElectedByHeightAndRole get elected node, miner or validator by block height and type.

func GetElectedByHeightAndRoleByHash added in v1.1.2

func GetElectedByHeightAndRoleByHash(hash common.Hash, roleType common.RoleType) ([]vm.DepositDetail, error)

GetElectedByHeightAndRole get elected node, miner or validator by block height and type.

func GetElectedByHeightByHash added in v1.1.2

func GetElectedByHeightByHash(hash common.Hash) ([]vm.DepositDetail, error)

GetElectedByHeight get all elected node by height.

func GetElectedByHeightWithdraw

func GetElectedByHeightWithdraw(height *big.Int) ([]vm.DepositDetail, error)

GetElectedByHeightWithdraw get all info in deposit.

func GetElectedByHeightWithdrawByHash added in v1.1.2

func GetElectedByHeightWithdrawByHash(hash common.Hash) ([]vm.DepositDetail, error)

GetElectedByHeightWithdraw get all info in deposit.

func GetGapValidator added in v1.1.1

func GetGapValidator() (rlt []common.Address)

GetGapValidator

func GetHash added in v1.1.2

func GetHash() common.Hash

func GetHeight

func GetHeight() *big.Int

func GetNodeNumber

func GetNodeNumber() (uint32, error)

GetNodeNumber

func GetRole

func GetRole() (role common.RoleType)

Get self identity.

func GetRolesByGroup

func GetRolesByGroup(roleType common.RoleType) (result []common.Address)

GetRolesByGroup

func GetRolesByGroupOnlyNextElect

func GetRolesByGroupOnlyNextElect(roleType common.RoleType) (result []common.Address)

GetRolesByGroupOnlyBackup

func GetRolesByGroupWithNextElect

func GetRolesByGroupWithNextElect(roleType common.RoleType) (result []common.Address)

GetRolesByGroupWithBackup

func GetSelfLevel

func GetSelfLevel() int

GetSelfLevel

func GetSignAddress added in v1.1.1

func GetSignAddress() common.Address

GetSelfAddress

func GetTopologyByHash added in v1.1.1

func GetTopologyByHash(reqTypes common.RoleType, hash common.Hash) (*mc.TopologyGraph, error)

func GetTopologyByNumber

func GetTopologyByNumber(reqTypes common.RoleType, number uint64) (*mc.TopologyGraph, error)

GetTopologyByNumber

func GetTopologyInLinker

func GetTopologyInLinker() (result map[common.RoleType][]common.Address)

GetTopologyInLinker

func InDuration

func InDuration() bool

InDuration

func SetTopologyReader

func SetTopologyReader(topologyReader TopologyGraphReader)

SetTopologyReader

func Start

func Start(id discover.NodeID, path string, addr common.Address)

Run this Identity.

func Stop

func Stop()

Stop this Identity.

Types

type Identity

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

Identity stand for node's identity.

type TopologyGraphReader

type TopologyGraphReader interface {
	GetCurrentHash() common.Hash
	GetHashByNumber(number uint64) common.Hash
	GetTopologyGraphByHash(blockHash common.Hash) (*mc.TopologyGraph, error)
	GetOriginalElectByHash(blockHash common.Hash) ([]common.Elect, error)
	GetNextElectByHash(blockHash common.Hash) ([]common.Elect, error)
	GetBroadcastAccounts(blockHash common.Hash) ([]common.Address, error)
	GetInnerMinersAccount(blockHash common.Hash) ([]common.Address, error)
	GetSuperSeq(blockHash common.Hash) (uint64, error)
}

Jump to

Keyboard shortcuts

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