firo

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpZeroCoinMint      = 0xc1
	OpZeroCoinSpend     = 0xc2
	OpSigmaMint         = 0xc3
	OpSigmaSpend        = 0xc4
	OpLelantusMint      = 0xc5
	OpLelantusJMint     = 0xc6
	OpLelantusJoinSplit = 0xc7

	MainnetMagic wire.BitcoinNet = 0xe3d9fef1
	TestnetMagic wire.BitcoinNet = 0xcffcbeea
	RegtestMagic wire.BitcoinNet = 0xfabfb5da

	GenesisBlockTime       = 1414776286
	SwitchToMTPBlockHeader = 1544443200
	MTPL                   = 64

	SpendTxID = "0000000000000000000000000000000000000000000000000000000000000000"

	TransactionQuorumCommitmentType = 6
)

Variables

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

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

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

func NewFiroRPC

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

Types

type FiroMsgTx

type FiroMsgTx struct {
	wire.MsgTx
	Extra []byte
}

FiroMsgTx encapsulate firo tx and extra

func (*FiroMsgTx) FiroDecode

func (msg *FiroMsgTx) FiroDecode(r io.Reader, pver uint32, enc wire.MessageEncoding) error

FiroDecode to decode bitcoin tx and extra

func (*FiroMsgTx) TxHash

func (msg *FiroMsgTx) TxHash() chainhash.Hash

TxHash calculate hash of transaction

type FiroParser

type FiroParser struct {
	*btc.BitcoinParser
}

FiroParser handle

func NewFiroParser

func NewFiroParser(params *chaincfg.Params, c *btc.Configuration) *FiroParser

NewFiroParser returns new FiroParser instance

func (*FiroParser) GetAddressesFromAddrDesc

func (p *FiroParser) GetAddressesFromAddrDesc(addrDesc bchain.AddressDescriptor) ([]string, bool, error)

GetAddressesFromAddrDesc returns addresses for given address descriptor with flag if the addresses are searchable

func (*FiroParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*FiroParser) ParseBlock

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

ParseBlock parses raw block to our Block struct

func (*FiroParser) ParseTxFromJson

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

ParseTxFromJson parses JSON message containing transaction and returns Tx struct

func (*FiroParser) TxFromFiroMsgTx

func (p *FiroParser) TxFromFiroMsgTx(t *FiroMsgTx, parseAddresses bool) bchain.Tx

TxFromFiroMsgTx converts bitcoin wire Tx to bchain.Tx

func (*FiroParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type FiroRPC

type FiroRPC struct {
	*btc.BitcoinRPC
}

func (*FiroRPC) GetBlock

func (zc *FiroRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

func (*FiroRPC) GetBlockInfo

func (zc *FiroRPC) GetBlockInfo(hash string) (*bchain.BlockInfo, error)

func (*FiroRPC) GetBlockRaw

func (zc *FiroRPC) GetBlockRaw(hash string) ([]byte, error)

func (*FiroRPC) GetBlockWithoutHeader

func (zc *FiroRPC) GetBlockWithoutHeader(hash string, height uint32) (*bchain.Block, error)

func (*FiroRPC) GetTransaction

func (zc *FiroRPC) GetTransaction(txid string) (*bchain.Tx, error)

func (*FiroRPC) GetTransactionForMempool

func (zc *FiroRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error)

func (*FiroRPC) GetTransactionSpecific

func (zc *FiroRPC) GetTransactionSpecific(tx *bchain.Tx) (json.RawMessage, error)

func (*FiroRPC) Initialize

func (zc *FiroRPC) Initialize() error

type MTPBlockHeader

type MTPBlockHeader struct {
	VersionMTP   int32
	MTPHashValue chainhash.Hash
	Reserved1    chainhash.Hash
	Reserved2    chainhash.Hash
}

type MTPHashData

type MTPHashData struct {
	HashRootMTP [16]uint8
	BlockMTP    [128][128]uint64
}

Jump to

Keyboard shortcuts

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