raptoreum

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 = 0x2e6d7472
	TestnetMagic wire.BitcoinNet = 0x6d747274
)

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

func NewRaptoreumRPC

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

NewRaptoreumRPC returns new RaptoreumRPC instance.

Types

type RaptoreumParser

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

RaptoreumParser handle

func NewRaptoreumParser

func NewRaptoreumParser(params *chaincfg.Params, c *btc.Configuration) *RaptoreumParser

NewRaptoreumParser returns new RaptoreumParser instance

func (*RaptoreumParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*RaptoreumParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type RaptoreumRPC

type RaptoreumRPC struct {
	*btc.BitcoinRPC
}

RaptoreumRPC is an interface to JSON-RPC bitcoind service.

func (*RaptoreumRPC) GetBlock

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

GetBlock returns block with given hash.

func (*RaptoreumRPC) GetTransactionForMempool

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

func (b *RaptoreumRPC) Initialize() error

Initialize initializes RaptoreumRPC instance.

Jump to

Keyboard shortcuts

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