monetaryunit

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Net Magics
	MainnetMagic wire.BitcoinNet = 0x91c4fdea
	TestnetMagic wire.BitcoinNet = 0x477665bd
)

Variables

View Source
var (
	MainNetParams chaincfg.Params
	TestNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main MonetaryUnit network

func NewMonetaryUnitRPC

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

NewMonetaryUnitRPC returns new MonetaryUnitRPC instance.

Types

type MonetaryUnitParser

type MonetaryUnitParser struct {
	*btc.BitcoinParser

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

MonetaryUnitParser handle

func NewMonetaryUnitParser

func NewMonetaryUnitParser(params *chaincfg.Params, c *btc.Configuration) *MonetaryUnitParser

NewMonetaryUnitParser returns new MonetaryUnitParser instance

func (*MonetaryUnitParser) GetAddrDescForUnknownInput

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

func (*MonetaryUnitParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*MonetaryUnitParser) ParseBlock

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

ParseBlock parses raw block to our Block struct

func (*MonetaryUnitParser) ParseTx

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

ParseTx parses byte array containing transaction and returns Tx struct

func (*MonetaryUnitParser) ParseTxFromJson

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

ParseTxFromJson parses JSON message containing transaction and returns Tx struct

func (*MonetaryUnitParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type MonetaryUnitRPC

type MonetaryUnitRPC struct {
	*btc.BitcoinRPC
}

MonetaryUnitRPC is an interface to JSON-RPC bitcoind service.

func (*MonetaryUnitRPC) GetBlock

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

GetBlock gets block from backend

func (*MonetaryUnitRPC) Initialize

func (b *MonetaryUnitRPC) Initialize() error

Initialize initializes MonetaryUnitRPC instance.

Jump to

Keyboard shortcuts

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