blockparser

package
v0.0.0-...-87aad58 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 12 Imported by: 0

README

blockparser

Blockparser reads bitcoin's blocks on disk, and outputs a text file with a text representation of all the utxos being created and destroyed. This txos file can then be used in txottl and ibdsim to test utreexo performance.

usage

Compile, and put the binary in ~/.bitcoin/testnet3/blocks for testnet or ~/.bitcoin/blocks for mainnet. Alternatively copy blk*.dat to some folder and run it there. You need to recompile for mainnet vs testnet. It will generate a text file, which you can then feed into txottl.

TODO: merge blockparser, txottl, ibdsim all into one big binary.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BtU32

func BtU32(b []byte) uint32

TODO make actual error return here 4 byte Big Endian slice to uint32. Returns ffffffff if something doesn't work.

func HashFromString

func HashFromString(s string) chainhash.Hash

func LBtU32

func LBtU32(b []byte) uint32

Converts 4 byte Little Endian slices to uint32. Returns ffffffff if something doesn't work.

func Parser

func Parser(sig chan bool) error

Parser parses blocks from the .dat files bitcoin core provides

func U32tB

func U32tB(i uint32) []byte

uint32 to 4 bytes. Always works.

Types

type RawHeaderData

type RawHeaderData struct {
	FileNum           [4]byte
	Offset            [4]byte
	CurrentHeaderHash [32]byte
	Prevhash          [32]byte
}

Header data read off the .dat file. FileNum is the .dat file number Offset is where it is in the .dat file. CurrentHeaderHash is the 80byte header double hashed Prevhash is the 32 byte previous header included in the 80byte header.

Jump to

Keyboard shortcuts

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