Documentation ¶
Index ¶
- Variables
- func AnchorBlockByHeight(dbo *database.AnchorDatabaseOverlay, height uint32) (done bool, skip bool, err error)
- func AnchorBlocksIntoBitcoin(dbo *database.AnchorDatabaseOverlay) error
- func GetOurUnspentOutputs(address string) ([]bitcoind.UnspentOutput, error)
- func GetSpendableOutputs(address string) ([]bitcoind.UnspentOutput, error)
- func InitRPCClient(cfg *config.AnchorConfig) error
- func LoadConfig(c *config.AnchorConfig)
- func SendRawTransactionToBTC(hash string, blockHeight uint32) (string, error)
- func SendTransaction(inputs []bitcoind.UnspentOutput, address, data string) (string, error)
- func SynchronizeBitcoinData(dbo *database.AnchorDatabaseOverlay) (int, error)
- func UpdateFee()
- type Transaction
- func (t *Transaction) GetAnchorData() (dBlockHeight uint32, keyMR string)
- func (t *Transaction) GetBlockHash() string
- func (t *Transaction) GetBlockNumber() int64
- func (t *Transaction) GetHash() string
- func (t *Transaction) GetOpReturnIndex() int64
- func (t *Transaction) GetTransactionIndex() int64
- func (t *Transaction) IsOurs(ourAddress string) bool
- func (r *Transaction) String() string
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 ¶
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)
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
Click to show internal directories.
Click to hide internal directories.