syncer

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncConsensusStateDuration = time.Second * 2
	SyncPeerDuration           = time.Second * 30
	SyncValidator              = time.Second * 2
)
View Source
const (
	SyncLocked   = "1"
	SyncUnlocked = "0"
)
View Source
const (
	LockTypeBlock          = "block"
	LockTypeConsensusState = "consensus_state"
	LockTypePeer           = "peer"
	LockTypeValidator      = "validator"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type COSMOS

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

func (COSMOS) BlockLoop

func (s COSMOS) BlockLoop(ctx context.Context) error

BlockLoop 同步块

func (COSMOS) ConsensusStateLoop

func (s COSMOS) ConsensusStateLoop(ctx context.Context) error

func (COSMOS) Lock

func (s COSMOS) Lock(key string) bool

SyncLock 同步时锁定,同一个时间只会有一个同步协程

func (COSMOS) PeerLoop

func (s COSMOS) PeerLoop(ctx context.Context) error

func (COSMOS) RpcPeers

func (s COSMOS) RpcPeers(ctx context.Context) error

func (COSMOS) Unlock

func (s COSMOS) Unlock(key string) bool

func (COSMOS) Validator

func (s COSMOS) Validator(height int64, t time.Time) error

type QOS

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

func (QOS) BlockLoop

func (s QOS) BlockLoop(ctx context.Context) error

BlockLoop 同步块

func (QOS) ConsensusStateLoop

func (s QOS) ConsensusStateLoop(ctx context.Context) error

func (QOS) Lock

func (s QOS) Lock(key string) bool

SyncLock 同步时锁定,同一个时间只会有一个同步协程

func (QOS) PeerLoop

func (s QOS) PeerLoop(ctx context.Context) error

func (QOS) RpcPeers

func (s QOS) RpcPeers(ctx context.Context) error

func (QOS) Unlock

func (s QOS) Unlock(key string) bool

func (QOS) Validator

func (s QOS) Validator(height int64, t time.Time) error

type QOSStakingValidator

type QOSStakingValidator struct {
	Commission struct {
		MaxChangeRate string `json:"max_change_rate"`
		MaxRate       string `json:"max_rate"`
		Rate          string `json:"rate"`
		UpdateTime    string `json:"update_time"`
	} `json:"commission"`
	ConsensusPubkey string `json:"consensus_pubkey"`
	DelegatorShares string `json:"delegator_shares"`
	Description     struct {
		Details string `json:"details"`
		Logo    string `json:"logo"`
		Moniker string `json:"moniker"`
		Website string `json:"website"`
	} `json:"description"`
	Jailed            bool   `json:"jailed"`
	MinSelfDelegation string `json:"min_self_delegation"`
	OperatorAddress   string `json:"operator_address"`
	Status            int    `json:"status"`
	Tokens            string `json:"tokens"`
	UnbondingHeight   string `json:"unbonding_height"`
	UnbondingTime     string `json:"unbonding_time"`
}

QOSStakingValidator struct

type QSC

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

func (QSC) BlockLoop

func (s QSC) BlockLoop(ctx context.Context) error

BlockLoop 同步块

func (QSC) ConsensusStateLoop

func (s QSC) ConsensusStateLoop(ctx context.Context) error

func (QSC) Lock

func (s QSC) Lock(key string) bool

SyncLock 同步时锁定,同一个时间只会有一个同步协程

func (QSC) PeerLoop

func (s QSC) PeerLoop(ctx context.Context) error

func (QSC) RpcPeers

func (s QSC) RpcPeers(ctx context.Context) error

func (QSC) Unlock

func (s QSC) Unlock(key string) bool

func (QSC) Validator

func (s QSC) Validator(height int64, t time.Time) error

type StakingValidator

type StakingValidator struct {
	Commission struct {
		MaxChangeRate string `json:"max_change_rate"`
		MaxRate       string `json:"max_rate"`
		Rate          string `json:"rate"`
		UpdateTime    string `json:"update_time"`
	} `json:"commission"`
	ConsPubKey      string `json:"consensus_pubkey"`
	DelegatorShares string `json:"delegator_shares"`
	Description     struct {
		Details  string `json:"details"`
		Identity string `json:"identity"`
		Moniker  string `json:"moniker"`
		Website  string `json:"website"`
	} `json:"description"`
	Jailed                  bool   `json:"jailed"`
	MinSelfDelegation       string `json:"min_self_delegation"`
	OperatorAddress         string `json:"operator_address"`
	Status                  int    `json:"status"`
	Tokens                  string `json:"tokens"`
	UnbondingHeight         string `json:"unbonding_height"`
	UnbondingCompletionTime string `json:"unbonding_time"`
}

type Syncer

type Syncer interface {
	Validator(height int64, t time.Time) error
	BlockLoop(ctx context.Context) error
	ConsensusStateLoop(ctx context.Context) error
	RpcPeers(ctx context.Context) error

	Lock(key string) bool
	Unlock(key string) bool
}

Syncer

func NewSyncer

func NewSyncer(node *service.Node) Syncer

Jump to

Keyboard shortcuts

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