flo

package
v0.0.0-...-fae8f5a Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xf1a5c0fd
	TestnetMagic wire.BitcoinNet = 0xf25ac0fd
	RegtestMagic wire.BitcoinNet = 0xdab5bffa
)

magic numbers

Variables

View Source
var (
	MainNetParams chaincfg.Params
	TestNetParams chaincfg.Params
)

chain parameters

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main Flo network, and the test Flo network

func NewFloRPC

func NewFloRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)

NewFloRPC returns new FloRPC instance.

Types

type FloParser

type FloParser struct {
	*btc.BitcoinLikeParser
	// contains filtered or unexported fields
}

FloParser handle

func NewFloParser

func NewFloParser(params *chaincfg.Params, c *btc.Configuration) *FloParser

NewFloParser returns new FloParser instance

func (*FloParser) PackTx

func (p *FloParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error)

PackTx packs transaction to byte array using protobuf

func (*FloParser) UnpackTx

func (p *FloParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error)

UnpackTx unpacks transaction from protobuf byte array

type FloRPC

type FloRPC struct {
	*btc.BitcoinRPC
}

FloRPC is an interface to JSON-RPC bitcoind service.

func (*FloRPC) GetBlock

func (f *FloRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*FloRPC) GetBlockFull

func (f *FloRPC) GetBlockFull(hash string) (*bchain.Block, error)

GetBlockFull returns block with given hash

func (*FloRPC) GetTransactionForMempool

func (f *FloRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error)

GetTransactionForMempool returns a transaction by the transaction ID. It could be optimized for mempool, i.e. without block time and confirmations

func (*FloRPC) Initialize

func (f *FloRPC) Initialize() error

Initialize initializes FloRPC instance.

Jump to

Keyboard shortcuts

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