ravencoin

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0x4e564152
	TestnetMagic wire.BitcoinNet = 0x544e5652
)

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 NewRavencoinRPC

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

NewRavencoinRPC returns new RavencoinRPC instance.

Types

type RavencoinParser

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

RavencoinParser handle

func NewRavencoinParser

func NewRavencoinParser(params *chaincfg.Params, c *btc.Configuration) *RavencoinParser

NewRavencoinParser returns new RavencoinParser instance

func (*RavencoinParser) PackTx added in v0.3.3

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

PackTx packs transaction to byte array using protobuf

func (*RavencoinParser) UnpackTx added in v0.3.3

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

UnpackTx unpacks transaction from protobuf byte array

type RavencoinRPC

type RavencoinRPC struct {
	*btc.BitcoinRPC
}

RavencoinRPC is an interface to JSON-RPC bitcoind service.

func (*RavencoinRPC) GetBlock added in v0.3.3

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

GetBlock returns block with given hash.

func (*RavencoinRPC) GetTransactionForMempool added in v0.3.3

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

func (b *RavencoinRPC) Initialize() error

Initialize initializes RavencoinRPC instance.

Jump to

Keyboard shortcuts

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