pivx

package
v0.0.0-...-216d947 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xe9fdc490
	TestnetMagic wire.BitcoinNet = 0xba657645

	// Zerocoin op codes
	OP_ZEROCOINMINT  = 0xc1
	OP_ZEROCOINSPEND = 0xc2
)

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 for the main PivX network

func NewPivXRPC

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

NewPivXRPC returns new PivXRPC instance.

Types

type PivXParser

type PivXParser struct {
	*btc.BitcoinParser

	BitcoinOutputScriptToAddressesFunc btc.OutputScriptToAddressesFunc
	// contains filtered or unexported fields
}

PivXParser handle

func NewPivXParser

func NewPivXParser(params *chaincfg.Params, c *btc.Configuration) *PivXParser

NewPivXParser returns new PivXParser instance

func (*PivXParser) GetAddrDescForUnknownInput

func (p *PivXParser) GetAddrDescForUnknownInput(tx *bchain.Tx, input int) bchain.AddressDescriptor

func (*PivXParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*PivXParser) ParseBlock

func (p *PivXParser) ParseBlock(b []byte) (*bchain.Block, error)

ParseBlock parses raw block to our Block struct

func (*PivXParser) ParseTx

func (p *PivXParser) ParseTx(b []byte) (*bchain.Tx, error)

ParseTx parses byte array containing transaction and returns Tx struct

func (*PivXParser) ParseTxFromJson

func (p *PivXParser) ParseTxFromJson(msg json.RawMessage) (*bchain.Tx, error)

ParseTxFromJson parses JSON message containing transaction and returns Tx struct

func (*PivXParser) TxFromMsgTx

func (p *PivXParser) TxFromMsgTx(t *wire.MsgTx, parseAddresses bool) bchain.Tx

TxFromMsgTx parses tx and adds handling for OP_ZEROCOINSPEND inputs

func (*PivXParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type PivXRPC

type PivXRPC struct {
	*btc.BitcoinRPC
}

PivXRPC is an interface to JSON-RPC bitcoind service.

func (*PivXRPC) Initialize

func (b *PivXRPC) Initialize() error

Initialize initializes PivXRPC instance.

Jump to

Keyboard shortcuts

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