concretecoin

package
v0.0.0-...-96a87f1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xf0fcc58f

	OP_ZEROCOINMINT         = 0xc1
	OP_ZEROCOINSPEND        = 0xc2
	OP_CHECKCOLDSTAKEVERIFY = 0xd1

	ZCMINT_LABEL  = "Zerocoin Mint"
	ZCSPEND_LABEL = "Zerocoin Spend"
	CBASE_LABEL   = "CoinBase TX"
	CSTAKE_LABEL  = "CoinStake TX"

	CBASE_ADDR_INT  = 0xf7
	CSTAKE_ADDR_INT = 0xf8

	STAKING_ADDR_MAIN = 63
)

Variables

View Source
var (
	MainNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main PivX network

func NewConcreteCoinRPC

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

func Uint16

func Uint16(r io.Reader, byteOrder binary.ByteOrder) (uint16, error)

Uint16 reads two bytes from the provided reader, converts it to a number using the provided byte order, and returns the resulting uint16.

func Uint32

func Uint32(r io.Reader, byteOrder binary.ByteOrder) (uint32, error)

Uint32 reads four bytes from the provided reader, converts it to a number using the provided byte order, and returns the resulting uint32.

func Uint64

func Uint64(r io.Reader, byteOrder binary.ByteOrder) (uint64, error)

Uint64 reads eight bytes from the provided reader, converts it to a number using the provided byte order, and returns the resulting uint64.

func Uint8

func Uint8(r io.Reader) (uint8, error)

Uint8 reads one byte from the provided reader and returns the resulting uint8.

Types

type ConcreteCoinParser

type ConcreteCoinParser struct {
	*btc.BitcoinParser

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

func NewConcreteCoinParser

func NewConcreteCoinParser(params *chaincfg.Params, c *btc.Configuration) *ConcreteCoinParser

func (*ConcreteCoinParser) GetAddrDescForUnknownInput

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

func (*ConcreteCoinParser) GetValueSatForUnknownInput

func (p *ConcreteCoinParser) GetValueSatForUnknownInput(tx *bchain.Tx, input int) *big.Int

func (*ConcreteCoinParser) GetValueSatFromZerocoinSpend

func (p *ConcreteCoinParser) GetValueSatFromZerocoinSpend(signatureScript []byte) (*big.Int, error)

func (*ConcreteCoinParser) IsAddrDescIndexable

func (p *ConcreteCoinParser) IsAddrDescIndexable(addrDesc bchain.AddressDescriptor) bool

IsAddrDescIndexable returns true if AddressDescriptor should be added to index empty or OP_RETURN scripts are not indexed. also are not indexed: zerocoin mints/spends coinbase txes and coinstake markers

func (*ConcreteCoinParser) P2CSScriptToAddress

func (p *ConcreteCoinParser) P2CSScriptToAddress(script []byte) ([]string, bool, error)

func (*ConcreteCoinParser) PackTx

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

func (*ConcreteCoinParser) ParseBlock

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

ParseBlock parses raw block to our Block struct

func (*ConcreteCoinParser) ParseTx

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

func (*ConcreteCoinParser) ParseTxFromJson

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

ParseTxFromJson parses JSON message containing transaction and returns Tx struct

func (*ConcreteCoinParser) TxFromMsgTx

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

func (*ConcreteCoinParser) UnpackTx

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

type ConcreteCoinRPC

type ConcreteCoinRPC struct {
	*btc.BitcoinRPC
}

func (*ConcreteCoinRPC) Initialize

func (b *ConcreteCoinRPC) Initialize() error

Jump to

Keyboard shortcuts

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