dpovp

package
v0.0.0-...-64d6040 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: GPL-3.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddressByPubkey

func GetAddressByPubkey(pubKey []byte) common.Address

根据publick key 获取地址

func GetCoreNodeIndex

func GetCoreNodeIndex(address *common.Address) int

获取节点索引 后期可优化下

func GetCoreNodeIndexByPubkey

func GetCoreNodeIndexByPubkey(pubKey []byte) int

根据pubkey获取节点索引

func GetCoreNodesCount

func GetCoreNodesCount() int

获取主节点数量

func GetPrivKey

func GetPrivKey() ecdsa.PrivateKey

获取私钥

func GetPubkeyByAddress

func GetPubkeyByAddress(address *common.Address) []byte

通过出块者地址获取节点公钥

func GetSlot

func GetSlot(firstAddress, nextAddress *common.Address) int

获取最新块的出块者序号与本节点序号差

func SetDataDir

func SetDataDir(path string)

设置 datadir路径

func SetPrivKey

func SetPrivKey(key *ecdsa.PrivateKey)

设置私钥 非coinbase私钥

Types

type AddrNodeIDMapping

type AddrNodeIDMapping struct {
	Addr   common.Address
	Pubkey []byte
}

func GetAllSortedCoreNodes

func GetAllSortedCoreNodes() []AddrNodeIDMapping

Get all sorted nodes that who can produce blocks

Jump to

Keyboard shortcuts

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