divi

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MainnetMagic = "network messages so the messages can be identified to belong to a specific coin"
	// Source https://github.com/DiviProject/Divi/blob/master0/divi/src/chainparams.cpp#L128-L136
	MainnetMagic wire.BitcoinNet = 0x8f8da0df
)

Variables

View Source
var (
	// MainNetParams = ???
	MainNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main Divi network

func NewDiviRPC

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

NewDiviRPC returns new DivicoinRPC instance.

Types

type DivicoinParser

type DivicoinParser struct {
	*btc.BitcoinParser

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

DivicoinParser handle

func NewDiviParser

func NewDiviParser(params *chaincfg.Params, c *btc.Configuration) *DivicoinParser

NewDiviParser returns new DivicoinParser instance

func (*DivicoinParser) GetAddrDescForUnknownInput

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

GetAddrDescForUnknownInput = ???

func (*DivicoinParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*DivicoinParser) ParseBlock

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

ParseBlock parses raw block to our Block struct

func (*DivicoinParser) ParseTx

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

ParseTx parses byte array containing transaction and returns Tx struct

func (*DivicoinParser) ParseTxFromJSON

func (p *DivicoinParser) ParseTxFromJSON(msg json.RawMessage) (*bchain.Tx, error)

ParseTxFromJSON parses JSON message containing transaction and returns Tx struct

func (*DivicoinParser) TxFromMsgTx

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

TxFromMsgTx parses tx and adds handling for OP_ZEROCOINSPEND inputs

func (*DivicoinParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type DivicoinRPC

type DivicoinRPC struct {
	*btc.BitcoinRPC
}

DivicoinRPC is an interface to JSON-RPC bitcoind service.

func (*DivicoinRPC) Initialize

func (b *DivicoinRPC) Initialize() error

Initialize initializes DivicoinRPC instance.

Jump to

Keyboard shortcuts

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