util

package
v0.0.0-...-d85cb20 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalShuffleTimeByHeaderTime

func CalShuffleTimeByHeaderTime(nextRoundBeginTime, blockTime, blockInterval, maxElectDelegate int64) int64

get block shuffle time by block time and any shuffleTime,can not get future shuffle time

func GetLocalIP

func GetLocalIP() string

func Shuffle

func Shuffle(height int64, delegateNumber int) []int

func ShuffleNewRound

func ShuffleNewRound(beginTime int64, maxElectDelegate int, currentDposList []types.Candidate, blockInterval int64) []types.ShuffleDel

beginTime: current shuffle time delegateNumber: Max delegate number currentDposList: current top delegates

func Sign

func Sign(data []byte, privateKey *ecdsa.PrivateKey) (sign []byte, err error)

sign data and return sign bytes

func VerifySignature

func VerifySignature(address string, data, sign []byte) (bool, error)

check by address

Types

This section is empty.

Jump to

Keyboard shortcuts

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