grs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xd4b4bef9
	TestnetMagic wire.BitcoinNet = 0x0709110b
)

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 Groestlcoin network, the regression test Groestlcoin network, the test Groestlcoin network and the simulation test Groestlcoin network, in this order

func NewGroestlcoinRPC

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

Types

type GroestlcoinParser

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

GroestlcoinParser handle

func NewGroestlcoinParser

func NewGroestlcoinParser(params *chaincfg.Params, c *btc.Configuration) *GroestlcoinParser

NewGroestlcoinParser returns new GroestlcoinParser instance

func (*GroestlcoinParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*GroestlcoinParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type GroestlcoinRPC

type GroestlcoinRPC struct {
	*btc.BitcoinRPC
}

func (*GroestlcoinRPC) GetBlock

func (g *GroestlcoinRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*GroestlcoinRPC) GetTransactionForMempool

func (g *GroestlcoinRPC) 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 (*GroestlcoinRPC) Initialize

func (g *GroestlcoinRPC) Initialize() error

Initialize initializes GroestlcoinRPC instance.

Jump to

Keyboard shortcuts

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