rapids

package
v0.0.0-...-c1bac29 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xcbf5a261
)

Variables

View Source
var (
	MainNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

func NewRapidsRPC

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

NewRapidsRPC returns new SnowGemRPC instance

Types

type RapidsParser

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

RapidsParser handle

func NewRapidsParser

func NewRapidsParser(params *chaincfg.Params, c *btc.Configuration) *RapidsParser

NewRapidsParser returns new RapidsParser instance

func (*RapidsParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*RapidsParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type RapidsRPC

type RapidsRPC struct {
	*btc.BitcoinRPC
}

RapidsRPC is an interface to JSON-RPC bitcoind service

func (*RapidsRPC) GetBlock

func (z *RapidsRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*RapidsRPC) GetMempoolEntry

func (z *RapidsRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error)

GetMempoolEntry returns mempool data for given transaction

func (*RapidsRPC) GetTransactionForMempool

func (z *RapidsRPC) 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 (*RapidsRPC) Initialize

func (z *RapidsRPC) Initialize() error

Initialize initializes SnowGemRPC instance

Jump to

Keyboard shortcuts

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