snowgem

package
v0.0.0-...-c58ffef Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	MainNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main SnowGem network, the regression test SnowGem network, the test SnowGem network and the simulation test SnowGem network, in this order

func NewSnowGemRPC

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

NewSnowGemRPC returns new SnowGemRPC instance

Types

type SnowGemParser

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

SnowGemParser handle

func NewSnowGemParser

func NewSnowGemParser(params *chaincfg.Params, c *btc.Configuration) *SnowGemParser

NewSnowGemParser returns new SnowGemParser instance

func (*SnowGemParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*SnowGemParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type SnowGemRPC

type SnowGemRPC struct {
	*btc.BitcoinRPC
}

SnowGemRPC is an interface to JSON-RPC bitcoind service

func (*SnowGemRPC) GetBlock

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

GetBlock returns block with given hash.

func (*SnowGemRPC) GetMempoolEntry

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

GetMempoolEntry returns mempool data for given transaction

func (*SnowGemRPC) GetTransactionForMempool

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

func (z *SnowGemRPC) Initialize() error

Initialize initializes SnowGemRPC instance

Jump to

Keyboard shortcuts

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