directoryBlock

package
v6.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBlockPairIntegrity

func CheckBlockPairIntegrity(block interfaces.IDirectoryBlock, prev interfaces.IDirectoryBlock) error

func UnmarshalDBlock

func UnmarshalDBlock(data []byte) (interfaces.IDirectoryBlock, error)

Types

type DBEntry

type DBEntry struct {
	ChainID interfaces.IHash `json:"chainid"`
	KeyMR   interfaces.IHash `json:"keymr"` // Different MR in EBlockHeader
}

func (*DBEntry) GetChainID

func (c *DBEntry) GetChainID() (rval interfaces.IHash)

func (*DBEntry) GetKeyMR

func (c *DBEntry) GetKeyMR() (rval interfaces.IHash)

func (*DBEntry) Init

func (c *DBEntry) Init()

func (*DBEntry) IsSameAs

func (a *DBEntry) IsSameAs(b interfaces.IDBEntry) bool

func (*DBEntry) JSONByte

func (e *DBEntry) JSONByte() ([]byte, error)

func (*DBEntry) JSONString

func (e *DBEntry) JSONString() (string, error)

func (*DBEntry) MarshalBinary

func (e *DBEntry) MarshalBinary() (rval []byte, err error)

func (*DBEntry) SetChainID

func (c *DBEntry) SetChainID(chainID interfaces.IHash)

func (*DBEntry) SetKeyMR

func (c *DBEntry) SetKeyMR(keyMR interfaces.IHash)

func (*DBEntry) ShaHash

func (e *DBEntry) ShaHash() (rval interfaces.IHash)

func (*DBEntry) String

func (e *DBEntry) String() string

func (*DBEntry) UnmarshalBinary

func (e *DBEntry) UnmarshalBinary(data []byte) (err error)

func (*DBEntry) UnmarshalBinaryData

func (e *DBEntry) UnmarshalBinaryData(data []byte) ([]byte, error)

type DBlockHeader

type DBlockHeader struct {
	Version   byte   `json:"version"`
	NetworkID uint32 `json:"networkid"`

	BodyMR       interfaces.IHash `json:"bodymr"`
	PrevKeyMR    interfaces.IHash `json:"prevkeymr"`
	PrevFullHash interfaces.IHash `json:"prevfullhash"`

	Timestamp  uint32 `json:"timestamp"` //in minutes
	DBHeight   uint32 `json:"dbheight"`
	BlockCount uint32 `json:"blockcount"`
}

func NewDBlockHeader

func NewDBlockHeader() *DBlockHeader

func (*DBlockHeader) GetBlockCount

func (h *DBlockHeader) GetBlockCount() uint32

func (*DBlockHeader) GetBodyMR

func (h *DBlockHeader) GetBodyMR() (rval interfaces.IHash)

func (*DBlockHeader) GetDBHeight

func (h *DBlockHeader) GetDBHeight() uint32

func (*DBlockHeader) GetHeaderHash

func (b *DBlockHeader) GetHeaderHash() (interfaces.IHash, error)

func (*DBlockHeader) GetNetworkID

func (h *DBlockHeader) GetNetworkID() uint32

func (*DBlockHeader) GetPrevFullHash

func (h *DBlockHeader) GetPrevFullHash() (rval interfaces.IHash)

func (*DBlockHeader) GetPrevKeyMR

func (h *DBlockHeader) GetPrevKeyMR() (rval interfaces.IHash)

func (*DBlockHeader) GetTimestamp

func (h *DBlockHeader) GetTimestamp() interfaces.Timestamp

func (*DBlockHeader) GetVersion

func (h *DBlockHeader) GetVersion() byte

func (*DBlockHeader) Init

func (h *DBlockHeader) Init()

func (*DBlockHeader) IsSameAs

func (*DBlockHeader) JSONByte

func (e *DBlockHeader) JSONByte() ([]byte, error)

func (*DBlockHeader) JSONString

func (e *DBlockHeader) JSONString() (string, error)

func (*DBlockHeader) MarshalBinary

func (b *DBlockHeader) MarshalBinary() (rval []byte, err error)

func (DBlockHeader) MarshalJSON

func (e DBlockHeader) MarshalJSON() ([]byte, error)

func (*DBlockHeader) SetBlockCount

func (h *DBlockHeader) SetBlockCount(blockcount uint32)

func (*DBlockHeader) SetBodyMR

func (h *DBlockHeader) SetBodyMR(bodyMR interfaces.IHash)

func (*DBlockHeader) SetDBHeight

func (h *DBlockHeader) SetDBHeight(dbheight uint32)

func (*DBlockHeader) SetNetworkID

func (h *DBlockHeader) SetNetworkID(networkID uint32)

func (*DBlockHeader) SetPrevFullHash

func (h *DBlockHeader) SetPrevFullHash(PrevFullHash interfaces.IHash)

func (*DBlockHeader) SetPrevKeyMR

func (h *DBlockHeader) SetPrevKeyMR(prevKeyMR interfaces.IHash)

func (*DBlockHeader) SetTimestamp

func (h *DBlockHeader) SetTimestamp(timestamp interfaces.Timestamp)

func (*DBlockHeader) SetVersion

func (h *DBlockHeader) SetVersion(version byte)

func (*DBlockHeader) String

func (e *DBlockHeader) String() string

func (*DBlockHeader) UnmarshalBinary

func (b *DBlockHeader) UnmarshalBinary(data []byte) (err error)

func (*DBlockHeader) UnmarshalBinaryData

func (b *DBlockHeader) UnmarshalBinaryData(data []byte) ([]byte, error)

type DirectoryBlock

type DirectoryBlock struct {
	//Not Marshalized
	DBHash     interfaces.IHash `json:"dbhash"`
	KeyMR      interfaces.IHash `json:"keymr"`
	HeaderHash interfaces.IHash `json:"headerhash"`

	//Marshalized
	Header    interfaces.IDirectoryBlockHeader `json:"header"`
	DBEntries []interfaces.IDBEntry            `json:"dbentries"`
	// contains filtered or unexported fields
}

func (*DirectoryBlock) AddEntry

func (b *DirectoryBlock) AddEntry(chainID interfaces.IHash, keyMR interfaces.IHash) error

func (*DirectoryBlock) BodyKeyMR

func (b *DirectoryBlock) BodyKeyMR() (rval interfaces.IHash)

func (*DirectoryBlock) BuildBodyMR

func (b *DirectoryBlock) BuildBodyMR() (interfaces.IHash, error)

func (*DirectoryBlock) BuildKeyMerkleRoot

func (b *DirectoryBlock) BuildKeyMerkleRoot() (keyMR interfaces.IHash, err error)

func (*DirectoryBlock) CheckDBEntries

func (c *DirectoryBlock) CheckDBEntries() error

func (*DirectoryBlock) DatabasePrimaryIndex

func (c *DirectoryBlock) DatabasePrimaryIndex() (rval interfaces.IHash)

func (*DirectoryBlock) DatabaseSecondaryIndex

func (c *DirectoryBlock) DatabaseSecondaryIndex() (rval interfaces.IHash)

func (*DirectoryBlock) GetChainID

func (c *DirectoryBlock) GetChainID() (rval interfaces.IHash)

func (*DirectoryBlock) GetDBEntries

func (c *DirectoryBlock) GetDBEntries() []interfaces.IDBEntry

func (*DirectoryBlock) GetDatabaseHeight

func (c *DirectoryBlock) GetDatabaseHeight() uint32

func (*DirectoryBlock) GetEBlockDBEntries

func (c *DirectoryBlock) GetEBlockDBEntries() []interfaces.IDBEntry

func (*DirectoryBlock) GetEntryHashes

func (c *DirectoryBlock) GetEntryHashes() []interfaces.IHash

func (*DirectoryBlock) GetEntryHashesForBranch

func (c *DirectoryBlock) GetEntryHashesForBranch() []interfaces.IHash

func (*DirectoryBlock) GetEntrySigHashes

func (c *DirectoryBlock) GetEntrySigHashes() []interfaces.IHash

func (*DirectoryBlock) GetFullHash

func (b *DirectoryBlock) GetFullHash() (rval interfaces.IHash)

func (*DirectoryBlock) GetHash

func (b *DirectoryBlock) GetHash() (rval interfaces.IHash)

func (*DirectoryBlock) GetHeader

func (*DirectoryBlock) GetHeaderHash

func (b *DirectoryBlock) GetHeaderHash() (interfaces.IHash, error)

func (*DirectoryBlock) GetKeyMR

func (c *DirectoryBlock) GetKeyMR() (rval interfaces.IHash)

func (*DirectoryBlock) GetTimestamp

func (h *DirectoryBlock) GetTimestamp() interfaces.Timestamp

func (*DirectoryBlock) Init

func (c *DirectoryBlock) Init()

func (*DirectoryBlock) IsSameAs

func (*DirectoryBlock) JSONByte

func (e *DirectoryBlock) JSONByte() ([]byte, error)

func (*DirectoryBlock) JSONString

func (e *DirectoryBlock) JSONString() (string, error)

func (*DirectoryBlock) MarshalBinary

func (b *DirectoryBlock) MarshalBinary() (rval []byte, err error)

func (DirectoryBlock) MarshalJSON

func (e DirectoryBlock) MarshalJSON() ([]byte, error)

func (*DirectoryBlock) New

func (*DirectoryBlock) SetABlockHash

func (c *DirectoryBlock) SetABlockHash(aBlock interfaces.IAdminBlock) error

func (*DirectoryBlock) SetDBEntries

func (c *DirectoryBlock) SetDBEntries(dbEntries []interfaces.IDBEntry) error

func (*DirectoryBlock) SetECBlockHash

func (c *DirectoryBlock) SetECBlockHash(ecBlock interfaces.IEntryCreditBlock) error

func (*DirectoryBlock) SetEntryHash

func (c *DirectoryBlock) SetEntryHash(hash, chainID interfaces.IHash, index int)

func (*DirectoryBlock) SetFBlockHash

func (c *DirectoryBlock) SetFBlockHash(fBlock interfaces.IFBlock) error

func (*DirectoryBlock) SetHeader

func (c *DirectoryBlock) SetHeader(header interfaces.IDirectoryBlockHeader)

func (*DirectoryBlock) Sort

func (c *DirectoryBlock) Sort()

bubble sort

func (*DirectoryBlock) String

func (e *DirectoryBlock) String() string

func (*DirectoryBlock) UnmarshalBinary

func (b *DirectoryBlock) UnmarshalBinary(data []byte) (err error)

func (*DirectoryBlock) UnmarshalBinaryData

func (b *DirectoryBlock) UnmarshalBinaryData(data []byte) ([]byte, error)

type ExpandedDBlock

type ExpandedDBlock DirectoryBlock

type ExpandedDBlockHeader

type ExpandedDBlockHeader DBlockHeader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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