blocktemplate

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRYPTOHASHSIZE   = 32
	CRYPTOPUBKEYSIZE = 33
)

Variables

This section is empty.

Functions

func PackVarInt

func PackVarInt(writer io.Writer, varInt uint64) error

func UnPackVarInt

func UnPackVarInt(reader io.Reader) (uint64, error)

Types

type Block

type Block struct {
	BlockHeader BlockHeader
	MinerTx     MinerTransaction
	TxHashes    []CryptoHash
}

func (Block) Pack

func (b Block) Pack(writer io.Writer) error

func (*Block) UnPack

func (b *Block) UnPack(reader io.Reader) error

type BlockHashingBlob

type BlockHashingBlob struct {
	BlockHeader  BlockHeader
	TreeRootHash CryptoHash
	TxHashSize   uint64
}

func (BlockHashingBlob) Pack

func (b BlockHashingBlob) Pack(writer io.Writer) error

func (*BlockHashingBlob) UnPack

func (b *BlockHashingBlob) UnPack(reader io.Reader) error

type BlockHeader

type BlockHeader struct {
	MajorVersion uint8
	MinorVersion uint8
	Timestamp    uint64
	PrevId       CryptoHash
	Nonce        uint32
}

func (BlockHeader) Pack

func (b BlockHeader) Pack(writer io.Writer) error

func (*BlockHeader) UnPack

func (b *BlockHeader) UnPack(reader io.Reader) error

type BlockTemplateBlob

type BlockTemplateBlob struct {
	Block Block
}

func (BlockTemplateBlob) Pack

func (b BlockTemplateBlob) Pack(writer io.Writer) error

func (*BlockTemplateBlob) UnPack

func (b *BlockTemplateBlob) UnPack(reader io.Reader) error

type CryptoHash

type CryptoHash struct {
	HashData [CRYPTOHASHSIZE]byte
}

func (*CryptoHash) FromHex

func (c *CryptoHash) FromHex(hexStr string) error

func (CryptoHash) Pack

func (c CryptoHash) Pack(writer io.Writer) error

func (CryptoHash) ToHex

func (c CryptoHash) ToHex() string

func (*CryptoHash) UnPack

func (c *CryptoHash) UnPack(reader io.Reader) error

type CryptoPubKey

type CryptoPubKey struct {
	PubKeyData [CRYPTOPUBKEYSIZE]byte
}

func (*CryptoPubKey) FromHex

func (c *CryptoPubKey) FromHex(hexStr string) error

func (CryptoPubKey) Pack

func (c CryptoPubKey) Pack(writer io.Writer) error

func (CryptoPubKey) ToHex

func (c CryptoPubKey) ToHex() string

func (*CryptoPubKey) UnPack

func (c *CryptoPubKey) UnPack(reader io.Reader) error

type MinerTransaction

type MinerTransaction struct {
	Version    uint64
	UnlockTime uint64
	Vin        []TxInGen
	Vout       []TxOutGen
	Extra      []byte
	RctSigType uint8
}

func (MinerTransaction) Pack

func (m MinerTransaction) Pack(writer io.Writer) error

func (*MinerTransaction) UnPack

func (m *MinerTransaction) UnPack(reader io.Reader) error

type TxInGen

type TxInGen struct {
	Height uint32
}

func (TxInGen) Pack

func (t TxInGen) Pack(writer io.Writer) error

func (*TxInGen) UnPack

func (t *TxInGen) UnPack(reader io.Reader) error

type TxOutGen

type TxOutGen struct {
	Amount  uint64
	PubKey  CryptoPubKey
	ViewTag byte
}

func (TxOutGen) Pack

func (t TxOutGen) Pack(writer io.Writer) error

func (*TxOutGen) UnPack

func (t *TxOutGen) UnPack(reader io.Reader) error

Jump to

Keyboard shortcuts

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