daps

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 = 0x8479b7a4
)

Variables

View Source
var (
	MainNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main Crown network

func NewDapsRPC

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

NewDapsRPC returns new DapsRPC instance

Types

type DapsParser

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

DapsParser handle

func NewDapsParser

func NewDapsParser(params *chaincfg.Params, c *btc.Configuration) *DapsParser

NewDapsParser returns new DapsParser instance

func (*DapsParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*DapsParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type DapsRPC

type DapsRPC struct {
	*btc.BitcoinRPC
}

DapsRPC is an interface to JSON-RPC bitcoind service

func (*DapsRPC) GetBlock

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

GetBlock returns block with given hash

func (*DapsRPC) GetTransactionForMempool

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

func (b *DapsRPC) Initialize() error

Initialize initializes DashRPC instance.

Jump to

Keyboard shortcuts

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