eboost

package
v0.0.0-...-3a49f0e Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xfcd9b7dd
	TestnetMagic wire.BitcoinNet = 0xfbcdccd3
	RegtestMagic wire.BitcoinNet = 0xfabfb5da
)

Variables

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

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

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

func NewEboostRPC

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

NewEboostRPC returns new EboostRPC instance.

Types

type EboostParser

type EboostParser struct {
	*btc.BitcoinParser
	// contains filtered or unexported fields
}

EboostParser handle

func NewEboostParser

func NewEboostParser(params *chaincfg.Params, c *btc.Configuration) *EboostParser

NewEboostParser returns new EboostParser instance

func (*EboostParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*EboostParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type EboostRPC

type EboostRPC struct {
	*btc.BitcoinRPC
}

EboostRPC is an interface to JSON-RPC bitcoind service.

func (*EboostRPC) GetBlock

func (b *EboostRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*EboostRPC) GetMempoolEntry

func (b *EboostRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error)

GetMempoolEntry returns mempool data for given transaction

func (*EboostRPC) GetTransactionForMempool

func (b *EboostRPC) 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 (*EboostRPC) Initialize

func (b *EboostRPC) Initialize() error

Initialize initializes EboostRPC instance.

Jump to

Keyboard shortcuts

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