anchor

package
v0.0.0-...-303b437 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 6 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorRecord

type AnchorRecord struct {
	AnchorRecordVer int
	DBHeight        uint32 `json:",omitempty"` // The only directory block height included in this anchor
	KeyMR           string `json:",omitempty"` // Merkle root of the only directory block included in this anchor

	DBHeightMax uint32 `json:",omitempty"` // The highest directory block height included in this anchor window
	DBHeightMin uint32 `json:",omitempty"` // The lowest directory block height included in this anchor window
	WindowMR    string `json:",omitempty"` // Merkle root of all directory block KeyMRs from DBHeightMin to DBHeightMax

	RecordHeight uint32 // Directory block height we intended to put the AnchorRecord into

	Bitcoin  *BitcoinStruct  `json:",omitempty"`
	Ethereum *EthereumStruct `json:",omitempty"`
}

AnchorRecord is used to construct anchor chain

func CreateAnchorRecordFromDBlock

func CreateAnchorRecordFromDBlock(dBlock interfaces.IDirectoryBlock) *AnchorRecord

func UnmarshalAnchorRecord

func UnmarshalAnchorRecord(data []byte) (*AnchorRecord, error)

func UnmarshalAndValidateAnchorEntryAnyVersion

func UnmarshalAndValidateAnchorEntryAnyVersion(entry interfaces.IEBEntry, publicKeys []interfaces.Verifier) (*AnchorRecord, bool, error)

func UnmarshalAndValidateAnchorRecord

func UnmarshalAndValidateAnchorRecord(data []byte, publicKeys []interfaces.Verifier) (*AnchorRecord, bool, error)

func UnmarshalAndValidateAnchorRecordV2

func UnmarshalAndValidateAnchorRecordV2(data []byte, extIDs [][]byte, publicKeys []interfaces.Verifier) (*AnchorRecord, bool, error)

func (*AnchorRecord) JSONByte

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

func (*AnchorRecord) JSONString

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

func (*AnchorRecord) Marshal

func (ar *AnchorRecord) Marshal() (rval []byte, err error)

func (*AnchorRecord) MarshalAndSign

func (ar *AnchorRecord) MarshalAndSign(priv interfaces.Signer) ([]byte, error)

func (*AnchorRecord) MarshalAndSignV2

func (ar *AnchorRecord) MarshalAndSignV2(priv interfaces.Signer) ([]byte, []byte, error)

func (*AnchorRecord) String

func (e *AnchorRecord) String() string

func (*AnchorRecord) Unmarshal

func (ar *AnchorRecord) Unmarshal(data []byte) error

type BitcoinStruct

type BitcoinStruct struct {
	Address     string //"1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1",
	TXID        string //"9b0fc92260312ce44e74ef369f5c66bbb85848f2eddd5a7a1cde251e54ccfdd5", BTC Hash - in reverse byte order
	BlockHeight int32  //345678,
	BlockHash   string //"00000000000000000cc14eacfc7057300aea87bed6fee904fd8e1c1f3dc008d4", BTC Hash - in reverse byte order
	Offset      int32  //87
}

type EthereumStruct

type EthereumStruct struct {
	ContractAddress string // Address of the Ethereum anchor contract
	TxID            string // Transaction ID of this particular anchor
	BlockHeight     int64  // Ethereum block height that this anchor was included in
	BlockHash       string // Hash of the Ethereum block that this anchor was included in
	TxIndex         int64  // Where the anchor tx is located within that block
}

Jump to

Keyboard shortcuts

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