dash

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MainnetMagic is mainnet network constant
	MainnetMagic wire.BitcoinNet = 0xbd6b0cbf
	// TestnetMagic is testnet network constant
	TestnetMagic wire.BitcoinNet = 0xffcae2ce
	// RegtestMagic is regtest network constant
	RegtestMagic wire.BitcoinNet = 0xdcb7c1fc
)

Variables

View Source
var (
	// MainNetParams are parser parameters for mainnet
	MainNetParams chaincfg.Params
	// TestNetParams are parser parameters for testnet
	TestNetParams chaincfg.Params
	// RegtestParams are parser parameters for regtest
	RegtestParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

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

func NewDashRPC

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

NewDashRPC returns new DashRPC instance

Types

type DashParser

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

DashParser handle

func NewDashParser

func NewDashParser(params *chaincfg.Params, c *btc.Configuration) *DashParser

NewDashParser returns new DashParser instance

func (*DashParser) PackTx added in v0.2.1

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

PackTx packs transaction to byte array using protobuf

func (*DashParser) UnpackTx added in v0.2.1

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

UnpackTx unpacks transaction from protobuf byte array

type DashRPC

type DashRPC struct {
	*btc.BitcoinRPC
}

DashRPC is an interface to JSON-RPC bitcoind service

func (*DashRPC) GetBlock added in v0.2.1

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

GetBlock returns block with given hash

func (*DashRPC) GetTransactionForMempool added in v0.2.1

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

func (b *DashRPC) Initialize() error

Initialize initializes DashRPC instance.

Jump to

Keyboard shortcuts

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