crown

package
v0.0.0-...-fa8983d Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

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 NewCrownRPC

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

NewCrownRPC returns new CrownRPC instance

Types

type CrownParser

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

CrownParser handle

func NewCrownParser

func NewCrownParser(params *chaincfg.Params, c *btc.Configuration) *CrownParser

NewCrownParser returns new CrownParser instance

func (*CrownParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*CrownParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type CrownRPC

type CrownRPC struct {
	*btc.BitcoinRPC
}

CrownRPC is an interface to JSON-RPC bitcoind service

func (*CrownRPC) GetBlock

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

GetBlock returns block with given hash

func (*CrownRPC) GetTransactionForMempool

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

func (b *CrownRPC) Initialize() error

Initialize initializes DashRPC instance.

Jump to

Keyboard shortcuts

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