koto

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

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0x6f746f4b
	TestnetMagic wire.BitcoinNet = 0x6f6b6f54
	RegtestMagic wire.BitcoinNet = 0x6f6b6552
)

magic numbers

Variables

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

chain parameters

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main Koto network, the regression test Koto network, the test Koto network and the simulation test Koto network, in this order

func NewKotoRPC

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

NewKotoRPC returns new LitecoinRPC instance

Types

type KotoParser

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

KotoParser handle

func NewKotoParser

func NewKotoParser(params *chaincfg.Params, c *btc.Configuration) *KotoParser

NewKotoParser returns new KotoParser instance

func (*KotoParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*KotoParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type KotoRPC

type KotoRPC struct {
	*btc.BitcoinRPC
}

KotoRPC is an interface to JSON-RPC bitcoind service

func (*KotoRPC) GetBlock

func (z *KotoRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*KotoRPC) GetMempoolEntry

func (z *KotoRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error)

GetMempoolEntry returns mempool data for given transaction

func (*KotoRPC) GetTransactionForMempool

func (z *KotoRPC) 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 (*KotoRPC) Initialize

func (z *KotoRPC) Initialize() error

Initialize initializes KotoRPC instance.

Jump to

Keyboard shortcuts

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