util

package
v0.2.0-devnet-70004 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountDetailsURL       = "/auth/accounts/%v"
	LastNoAckURL            = "/checkpoints/last-no-ack"
	CheckpointParamsURL     = "/checkpoints/params"
	ChainManagerParamsURL   = "/chainmanager/params"
	ProposersURL            = "/staking/proposer/%v"
	BufferedCheckpointURL   = "/checkpoints/buffer"
	LatestCheckpointURL     = "/checkpoints/latest"
	CurrentProposerURL      = "/staking/current-proposer"
	LatestSpanURL           = "/bor/latest-span"
	NextSpanInfoURL         = "/bor/prepare-next-span"
	NextSpanSeedURL         = "/bor/next-span-seed"
	DividendAccountRootURL  = "/topup/dividend-account-root"
	ValidatorURL            = "/staking/validator/%v"
	CurrentValidatorSetURL  = "staking/validator-set"
	StakingTxStatusURL      = "/staking/isoldtx"
	TopupTxStatusURL        = "/topup/isoldtx"
	ClerkTxStatusURL        = "/clerk/isoldtx"
	LatestSlashInfoBytesURL = "/slashing/latest_slash_info_bytes"
	TickSlashInfoListURL    = "/slashing/tick_slash_infos"
	SlashingTxStatusURL     = "/slashing/isoldtx"
	SlashingTickCountURL    = "/slashing/tick-count"

	TransactionTimeout      = 1 * time.Minute
	CommitTimeout           = 2 * time.Minute
	BlockInterval           = 6 * time.Second
	TaskDelayBetweenEachVal = 3 * BlockInterval
	ValidatorJoinRetryDelay = 3 * BlockInterval

	BridgeDBFlag = "bridge-db"
)

Variables

This section is empty.

Functions

func AppendPrefix

func AppendPrefix(signerPubKey []byte) []byte

AppendPrefix returns publickey in uncompressed format

func CalculateSpanTaskDelay added in v0.3.0

func CalculateSpanTaskDelay(cliContext cliContext.CLIContext, id uint64, start uint64) (bool, time.Duration)

func CalculateTaskDelay

func CalculateTaskDelay(cliCtx cliContext.CLIContext) (bool, time.Duration)

CalculateTaskDelay calculates delay required for current validator to propose the tx It solves for multiple validators sending same transaction.

func CloseBridgeDBInstance

func CloseBridgeDBInstance()

CloseBridgeDBInstance closes bridge-db instance

func CreateURLWithQuery

func CreateURLWithQuery(uri string, param map[string]interface{}) (string, error)

CreateURLWithQuery receives the uri and parameters in key value form it will return the new url with the given query from the parameter

func FetchNextSpanDetails added in v0.3.0

func FetchNextSpanDetails(cliCtx cliContext.CLIContext, id uint64, start uint64) (*types.Span, error)

fetch next span details from heimdall.

func GetAccount

func GetAccount(cliCtx cliContext.CLIContext, address types.HeimdallAddress) (account authTypes.Account, err error)

GetAccount returns heimdall auth account

func GetBridgeDBInstance

func GetBridgeDBInstance(filePath string) *leveldb.DB

GetBridgeDBInstance get sington object for bridge-db

func GetBufferedCheckpoint added in v0.1.7

func GetBufferedCheckpoint(cliCtx cliContext.CLIContext) (*hmtypes.Checkpoint, error)

GetBufferedCheckpoint return checkpoint from bueffer

func GetChainmanagerParams added in v0.1.7

func GetChainmanagerParams(cliCtx cliContext.CLIContext) (*chainManagerTypes.Params, error)

GetChainmanagerParams return chain manager params

func GetCheckpointParams added in v0.1.7

func GetCheckpointParams(cliCtx cliContext.CLIContext) (*checkpointTypes.Params, error)

GetCheckpointParams return params

func GetLastSpan added in v0.3.0

func GetLastSpan(cliCtx cliContext.CLIContext) (*types.Span, error)

get Last span

func GetlastestCheckpoint added in v0.2.0

func GetlastestCheckpoint(cliCtx cliContext.CLIContext) (*hmtypes.Checkpoint, error)

GetlastestCheckpoint return last successful checkpoint

func IsCatchingUp

func IsCatchingUp(cliCtx cliContext.CLIContext) bool

IsCatchingUp checks if the heimdall node you are connected to is fully synced or not returns true when synced

func IsCurrentProposer

func IsCurrentProposer(cliCtx cliContext.CLIContext) (bool, error)

IsCurrentProposer checks if we are current proposer

func IsEventSender

func IsEventSender(cliCtx cliContext.CLIContext, validatorID uint64) bool

IsEventSender check if we are the EventSender

func IsInProposerList

func IsInProposerList(cliCtx cliContext.CLIContext, count uint64) (bool, error)

IsInProposerList checks if we are in current proposer

func IsProposer

func IsProposer(cliCtx cliContext.CLIContext) (bool, error)

IsProposer checks if we are proposer

func Logger

func Logger() log.Logger

Logger returns logger singleton instance

func WaitForOneEvent

func WaitForOneEvent(tx tmTypes.Tx, client *httpClient.HTTP) (tmTypes.TMEventData, error)

WaitForOneEvent subscribes to a websocket event for the given event time and returns upon receiving it one time, or when the timeout duration has expired.

This handles subscribing and unsubscribing under the hood

Types

type NoopLogger added in v0.1.7

type NoopLogger struct{}

NoopLogger no operational logger

func (NoopLogger) Fatal added in v0.1.7

func (NoopLogger) Fatal(...interface{})

func (NoopLogger) Fatalf added in v0.1.7

func (NoopLogger) Fatalf(string, ...interface{})

func (NoopLogger) Fatalln added in v0.1.7

func (NoopLogger) Fatalln(...interface{})

func (NoopLogger) Panic added in v0.1.7

func (NoopLogger) Panic(...interface{})

func (NoopLogger) Panicf added in v0.1.7

func (NoopLogger) Panicf(string, ...interface{})

func (NoopLogger) Panicln added in v0.1.7

func (NoopLogger) Panicln(...interface{})

func (NoopLogger) Print added in v0.1.7

func (NoopLogger) Print(...interface{})

func (NoopLogger) Printf added in v0.1.7

func (NoopLogger) Printf(string, ...interface{})

func (NoopLogger) Println added in v0.1.7

func (NoopLogger) Println(...interface{})

type Params added in v0.3.0

type Params struct {
	ChainmanagerParams *chainmanagerTypes.Params
	CheckpointParams   *checkpointTypes.Params
}

type ParamsContext added in v0.3.0

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

func NewParamsContext added in v0.3.0

func NewParamsContext(cliCtx cliContext.CLIContext) *ParamsContext

NewParamsContext creates new params context

func (*ParamsContext) GetParams added in v0.3.0

func (paramsContext *ParamsContext) GetParams() (params Params, err error)

GetParams updates cache if required and returns params

Jump to

Keyboard shortcuts

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