bitcoin

package
v0.0.0-...-3050db6 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BTCAddress string = "mxnf2a9MfEjvkjS4zL7efoWSgbZe5rMn1m"
View Source
var BTCFee float64 = 0.0001

var BTCPrivKey = "cRhC7gEZMJdZ35SrBbcRX19R1sM3f5F1tHsmjPvsbfLSds81FxQp"

View Source
var IgnoreWrongEntries bool = true
View Source
var MinConfirmations int64 = 1
View Source
var RPCAddress string = "http://localhost:18332/"
View Source
var RPCPass string = "pass"
View Source
var RPCUser string = "user"
View Source
var WalletPassphrase string = "password"

Functions

func AnchorBlockByHeight

func AnchorBlockByHeight(dbo *database.AnchorDatabaseOverlay, height uint32) (done bool, skip bool, err error)

returns done when we're done anchoring returns skip if we can skip anchoring this block

func AnchorBlocksIntoBitcoin

func AnchorBlocksIntoBitcoin(dbo *database.AnchorDatabaseOverlay) error

func GetOurUnspentOutputs

func GetOurUnspentOutputs(address string) ([]bitcoind.UnspentOutput, error)

func GetSpendableOutputs

func GetSpendableOutputs(address string) ([]bitcoind.UnspentOutput, error)

func InitRPCClient

func InitRPCClient(cfg *config.AnchorConfig) error

func LoadConfig

func LoadConfig(c *config.AnchorConfig)

func SendRawTransactionToBTC

func SendRawTransactionToBTC(hash string, blockHeight uint32) (string, error)

SendRawTransactionToBTC is the main function used to anchor factom dir block hash to bitcoin blockchain

func SendTransaction

func SendTransaction(inputs []bitcoind.UnspentOutput, address, data string) (string, error)

func SynchronizeBitcoinData

func SynchronizeBitcoinData(dbo *database.AnchorDatabaseOverlay) (int, error)

func UpdateFee

func UpdateFee()

Types

type Transaction

type Transaction struct {
	InputAddresses        []string
	OPReturn              string
	TxHash                string
	BlockNumber           int64
	BlockHash             string
	OpReturnIndex         int64
	TransactionBlockIndex int64
}

func ListBitcoinTransactionsSinceBlock

func ListBitcoinTransactionsSinceBlock(block string) ([]Transaction, string, error)

func ToTransactions

func ToTransactions(txs []bitcoind.Transaction) ([]Transaction, error)

func (*Transaction) GetAnchorData

func (t *Transaction) GetAnchorData() (dBlockHeight uint32, keyMR string)

func (*Transaction) GetBlockHash

func (t *Transaction) GetBlockHash() string

func (*Transaction) GetBlockNumber

func (t *Transaction) GetBlockNumber() int64

func (*Transaction) GetHash

func (t *Transaction) GetHash() string

func (*Transaction) GetOpReturnIndex

func (t *Transaction) GetOpReturnIndex() int64

func (*Transaction) GetTransactionIndex

func (t *Transaction) GetTransactionIndex() int64

func (*Transaction) IsOurs

func (t *Transaction) IsOurs(ourAddress string) bool

func (*Transaction) String

func (r *Transaction) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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