Documentation ¶
Index ¶
- Constants
- Variables
- func GetChainParams(chain string) *chaincfg.Params
- func NewPwrBRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
- func Uint16(r io.Reader, byteOrder binary.ByteOrder) (uint16, error)
- func Uint32(r io.Reader, byteOrder binary.ByteOrder) (uint32, error)
- func Uint64(r io.Reader, byteOrder binary.ByteOrder) (uint64, error)
- func Uint8(r io.Reader) (uint8, error)
- type CmdFindSerial
- type CmdGetInfo
- type CmdGetMasternodeCount
- type PwrBParser
- func (p *PwrBParser) GetAddrDescForUnknownInput(tx *bchain.Tx, input int) bchain.AddressDescriptor
- func (p *PwrBParser) GetValueSatForUnknownInput(tx *bchain.Tx, input int) *big.Int
- func (p *PwrBParser) GetValueSatFromZerocoinSpend(signatureScript []byte) (*big.Int, error)
- func (p *PwrBParser) IsAddrDescIndexable(addrDesc bchain.AddressDescriptor) bool
- func (p *PwrBParser) P2CSScriptToAddress(script []byte) ([]string, bool, error)
- func (p *PwrBParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error)
- func (p *PwrBParser) ParseBlock(b []byte) (*bchain.Block, error)
- func (p *PwrBParser) ParseTx(b []byte) (*bchain.Tx, error)
- func (p *PwrBParser) ParseTxFromJson(msg json.RawMessage) (*bchain.Tx, error)
- func (p *PwrBParser) TxFromMsgTx(t *wire.MsgTx, parseAddresses bool) bchain.Tx
- func (p *PwrBParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error)
- type PwrBRPC
- type ResFindSerial
- type ResGetInfo
- type ResGetMasternodeCount
Constants ¶
const ( // Net Magics MainnetMagic wire.BitcoinNet = 0xcfd2e3f1 TestnetMagic wire.BitcoinNet = 0x2553b7cd // Zerocoin op codes OP_ZEROCOINMINT = 0xc1 OP_ZEROCOINSPEND = 0xc2 OP_CHECKCOLDSTAKEVERIFY = 0xd1 OP_RETURN = 0x6a // Labels ZCMINT_LABEL = "Zerocoin Mint" ZCSPEND_LABEL = "Zerocoin Spend" CBASE_LABEL = "CoinBase TX" CSTAKE_LABEL = "CoinStake TX" BET_LABEL = "PowerBall Bet" // Dummy Internal Addresses CBASE_ADDR_INT = 0xf7 CSTAKE_ADDR_INT = 0xf8 // Staking Addresses STAKING_ADDR_MAIN = 63 STAKING_ADDR_TEST = 63 )
Variables ¶
var ( MainNetParams chaincfg.Params TestNetParams chaincfg.Params )
Functions ¶
func GetChainParams ¶
GetChainParams contains network parameters for the main PwrB network
func NewPwrBRPC ¶
func NewPwrBRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
NewPwrBRPC returns new PwrBRPC instance.
func Uint16 ¶
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 ¶
Uint32 reads four bytes from the provided reader, converts it to a number using the provided byte order, and returns the resulting uint32.
Types ¶
type CmdFindSerial ¶
findserial
type CmdGetInfo ¶
type CmdGetInfo struct {
Method string `json:"method"`
}
type CmdGetMasternodeCount ¶
type CmdGetMasternodeCount struct {
Method string `json:"method"`
}
type PwrBParser ¶
type PwrBParser struct { *btc.BitcoinParser BitcoinOutputScriptToAddressesFunc btc.OutputScriptToAddressesFunc // contains filtered or unexported fields }
PwrBParser handle
func NewPwrBParser ¶
func NewPwrBParser(params *chaincfg.Params, c *btc.Configuration) *PwrBParser
NewPwrBParser returns new PwrBParser instance
func (*PwrBParser) GetAddrDescForUnknownInput ¶
func (p *PwrBParser) GetAddrDescForUnknownInput(tx *bchain.Tx, input int) bchain.AddressDescriptor
func (*PwrBParser) GetValueSatForUnknownInput ¶
func (*PwrBParser) GetValueSatFromZerocoinSpend ¶
func (p *PwrBParser) GetValueSatFromZerocoinSpend(signatureScript []byte) (*big.Int, error)
Decodes the amount from the zerocoin spend script
func (*PwrBParser) IsAddrDescIndexable ¶
func (p *PwrBParser) 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 (*PwrBParser) P2CSScriptToAddress ¶
func (p *PwrBParser) P2CSScriptToAddress(script []byte) ([]string, bool, error)
Returns P2CS owner/staker addresses
func (*PwrBParser) ParseBlock ¶
func (p *PwrBParser) ParseBlock(b []byte) (*bchain.Block, error)
ParseBlock parses raw block to our Block struct
func (*PwrBParser) ParseTx ¶
func (p *PwrBParser) ParseTx(b []byte) (*bchain.Tx, error)
ParseTx parses byte array containing transaction and returns Tx struct
func (*PwrBParser) ParseTxFromJson ¶
func (p *PwrBParser) ParseTxFromJson(msg json.RawMessage) (*bchain.Tx, error)
ParseTxFromJson parses JSON message containing transaction and returns Tx struct
func (*PwrBParser) TxFromMsgTx ¶
Parses tx and adds handling for OP_ZEROCOINSPEND inputs
type PwrBRPC ¶
type PwrBRPC struct { *btc.BitcoinRPC BitcoinGetChainInfo func() (*bchain.ChainInfo, error) }
PwrBRPC is an interface to JSON-RPC bitcoind service.
func (*PwrBRPC) GetChainInfo ¶
GetChainInfo returns information about the connected backend PWRB adds MoneySupply and ZerocoinSupply to btc implementation
func (*PwrBRPC) GetNextSuperBlock ¶
GetNextSuperBlock returns the next superblock height after nHeight
func (*PwrBRPC) Initialize ¶
Initialize initializes PwrBRPC instance.