Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareInstructions ¶
func CompareInstructions(a, b Instruction) int
CompareInstructions returns negative if a<b, 0 if a=b and positive if a>b. It considers an operation smaller than an attestation, a pending attestation smaller than a Bitcoin attestation. It orders operations by their tag byte and then by their argument.
Types ¶
type Attestation ¶
func (Attestation) Human ¶
func (att Attestation) Human() string
func (Attestation) Name ¶
func (att Attestation) Name() string
type Bitcoin ¶
type Bitcoin interface { GetBlockHash(height int64) (*chainhash.Hash, error) GetBlockHeader(hash *chainhash.Hash) (*wire.BlockHeader, error) }
func NewBitcoindInterface ¶
func NewBitcoindInterface(config rpcclient.ConnConfig) (Bitcoin, error)
func NewEsploraClient ¶
type File ¶
A File represents the parsed content of an .ots file: it has an initial digest and a series of sequences of instructions. Each sequence must be evaluated separately, applying the operations on top of each other, starting with the .Digest until they end on an attestation.
func ReadFromFile ¶
func (File) GetBitcoinAttestedSequences ¶
func (File) GetPendingSequences ¶
func (File) SerializeInstructionSequences ¶
func (File) SerializeToFile ¶
type Instruction ¶
type Instruction struct { *Operation Argument []byte *Attestation }
a Instruction can be an operation like "append" or "prepend" (this will be the case when .Operation != nil) or an attestation (when .Attestation != nil). It will have a non-nil .Argument whenever the operation requires an argument.
type Sequence ¶
type Sequence []Instruction
func UpgradeSequence ¶ added in v0.4.0
func (Sequence) Compute ¶
Compute runs a sequence of operations on top of an initial digest and returns the result, which is often a Bitcoin block merkle root. It also tries to identify the point in the sequence in which an actual Bitcoin transaction is formed and parse that.
func (Sequence) GetAttestation ¶ added in v0.2.2
func (seq Sequence) GetAttestation() Attestation