deeponion

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xf2dbf1d1
)

magic numbers

Variables

View Source
var (
	MainNetParams chaincfg.Params
)

chain parameters

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main DeepOnion network,

func NewDeepOnionRPC

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

NewDeepOnionRPC returns new DeepOnionRPC instance.

Types

type DeepOnionParser

type DeepOnionParser struct {
	*btc.BitcoinParser
	// contains filtered or unexported fields
}

DeepOnionParser handle

func NewDeepOnionParser

func NewDeepOnionParser(params *chaincfg.Params, c *btc.Configuration) *DeepOnionParser

NewDeepOnionParser returns new DeepOnionParser instance

func (*DeepOnionParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*DeepOnionParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type DeepOnionRPC

type DeepOnionRPC struct {
	*btc.BitcoinRPC
}

DeepOnionRPC is an interface to JSON-RPC bitcoind service.

func (*DeepOnionRPC) GetBlock

func (s *DeepOnionRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*DeepOnionRPC) GetTransactionForMempool

func (s *DeepOnionRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error)

GetTransactionForMempool returns a transaction by the transaction ID. It could be optimized for mempool, i.e. without block time and confirmations

func (*DeepOnionRPC) Initialize

func (b *DeepOnionRPC) Initialize() error

Initialize initializes DeepOnionRPC instance.

Jump to

Keyboard shortcuts

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