btctimestamper

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Overview

Package btctimestamper implements a fake Bitcoin timestamper which can be used for testing.

Index

Constants

View Source
const (
	// Component name for monitoring.
	Component = "btc"

	// Description describes this Timestamper.
	Description = "Bitcoin Timestamper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// An unspent transaction finder.
	UnspentFinder btc.UnspentFinder

	// A transaction broadcaster.
	Broadcaster btc.Broadcaster

	// A wallet import format key.
	WIF string

	// Transaction fee
	Fee int64
}

Config contains configuration options for the timestamper.

type Timestamper

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

Timestamper is the type that implements github.com/stratumn/go-core/blockchain.Timestamper.

func New

func New(config *Config) (*Timestamper, error)

New creates an instance of a Timestamper.

func (*Timestamper) GetInfo

func (ts *Timestamper) GetInfo() *blockchain.Info

GetInfo implements github.com/stratumn/go-core/blockchain.HashTimestamper.

func (*Timestamper) Network

func (ts *Timestamper) Network() blockchain.Network

Network implements fmt.Stringer.

func (*Timestamper) TimestampHash

func (ts *Timestamper) TimestampHash(ctx context.Context, hash []byte) (txid types.TransactionID, err error)

TimestampHash implements github.com/stratumn/go-core/blockchain.HashTimestamper.

Jump to

Keyboard shortcuts

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