Documentation ¶
Index ¶
- Constants
- Variables
- type AccountHashH
- type AccountStateBlock
- type Address
- type Balance
- type Block
- type BlockType
- type CondTimer
- type Hash
- type HashHeight
- type Height
- type Lifecycle
- type LifecycleStatus
- func (ls *LifecycleStatus) PostInit() *LifecycleStatus
- func (ls *LifecycleStatus) PostStart() *LifecycleStatus
- func (ls *LifecycleStatus) PostStop() *LifecycleStatus
- func (ls *LifecycleStatus) PreInit() *LifecycleStatus
- func (ls *LifecycleStatus) PreStart() *LifecycleStatus
- func (ls *LifecycleStatus) PreStop() *LifecycleStatus
- func (ls *LifecycleStatus) Status() int32
- func (ls *LifecycleStatus) Stopped() bool
- type NetMsgType
- type NonBlockLock
- type RWLock
- type Sign
- type SnapshotBlock
- type SnapshotPoint
- type StoreDBType
- type Tblock
- type Version
Constants ¶
View Source
const ( Origin = 0 PreInit = 1 PostInit = 2 PreStart = 3 PostStart = 4 PreStop = 5 PostStop = 6 )
BlockType types.
View Source
const (
DwlDone = "DownloaderDoneEvent"
)
Variables ¶
View Source
var EmptyBalance = Balance(0)
View Source
var EmptyHash = Hash("")
View Source
var EmptyHashHeight = HashHeight{ Hash: EmptyHash, Height: EmptyHeight, }
View Source
var EmptyHeight = Height(0)
View Source
var FirstHeight = Height(1)
Functions ¶
This section is empty.
Types ¶
type AccountHashH ¶
type AccountHashH struct { HashHeight Addr Address }
func NewAccountHashH ¶
func NewAccountHashH(address Address, hash Hash, height Height) *AccountHashH
type AccountStateBlock ¶
type AccountStateBlock struct { Tblock Amount Balance ModifiedAmount Balance BlockType BlockType // 1: send 2:received From Address To Address Source *HashHeight }
func NewAccountBlock ¶
func NewAccountBlockEmpty ¶
func NewAccountBlockEmpty() *AccountStateBlock
func NewAccountBlockFrom ¶
func NewAccountBlockFrom( accountBlock *AccountStateBlock, signer Address, timestamp time.Time, modifiedAmount Balance, blockType BlockType, from *Address, to *Address, source *HashHeight, ) *AccountStateBlock
type CondTimer ¶
type CondTimer struct {
// contains filtered or unexported fields
}
func NewCondTimer ¶
func NewCondTimer() *CondTimer
type HashHeight ¶
type LifecycleStatus ¶
type LifecycleStatus struct {
S int32 // 0:origin 1: initing 2:inited 3:starting 4:started 5:stopping 6:stopped
}
func (*LifecycleStatus) PostInit ¶
func (ls *LifecycleStatus) PostInit() *LifecycleStatus
func (*LifecycleStatus) PostStart ¶
func (ls *LifecycleStatus) PostStart() *LifecycleStatus
func (*LifecycleStatus) PostStop ¶
func (ls *LifecycleStatus) PostStop() *LifecycleStatus
func (*LifecycleStatus) PreInit ¶
func (ls *LifecycleStatus) PreInit() *LifecycleStatus
func (*LifecycleStatus) PreStart ¶
func (ls *LifecycleStatus) PreStart() *LifecycleStatus
func (*LifecycleStatus) PreStop ¶
func (ls *LifecycleStatus) PreStop() *LifecycleStatus
func (*LifecycleStatus) Status ¶
func (ls *LifecycleStatus) Status() int32
func (*LifecycleStatus) Stopped ¶
func (ls *LifecycleStatus) Stopped() bool
type NetMsgType ¶
type NetMsgType uint8
const ( PeerConnected NetMsgType = 1 PeerClosed NetMsgType = 2 State NetMsgType = 101 RequestAccountHash NetMsgType = 102 RequestSnapshotHash NetMsgType = 103 RequestAccountBlocks NetMsgType = 104 RequestSnapshotBlocks NetMsgType = 105 AccountHashes NetMsgType = 121 SnapshotHashes NetMsgType = 122 AccountBlocks NetMsgType = 123 SnapshotBlocks NetMsgType = 124 )
func (NetMsgType) String ¶
func (tp NetMsgType) String() string
type NonBlockLock ¶
type NonBlockLock struct {
// contains filtered or unexported fields
}
func (*NonBlockLock) TryLock ¶
func (lock *NonBlockLock) TryLock() bool
func (*NonBlockLock) UnLock ¶
func (lock *NonBlockLock) UnLock() bool
type SnapshotBlock ¶
type SnapshotBlock struct { Tblock Accounts []*AccountHashH }
func NewSnapshotBlock ¶
func NewSnapshotBlock( height Height, hash Hash, prevHash Hash, signer Address, timestamp time.Time, accounts []*AccountHashH, ) *SnapshotBlock
type SnapshotPoint ¶
type SnapshotPoint struct { SnapshotHeight Height SnapshotHash Hash AccountHeight Height AccountHash Hash }
func (*SnapshotPoint) Equals ¶
func (point *SnapshotPoint) Equals(peer *SnapshotPoint) bool
func (*SnapshotPoint) String ¶
func (point *SnapshotPoint) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.