Skip to content

Go module to read bitcoin blk.dat file into msgBlock formated blocks

Notifications You must be signed in to change notification settings

metasv/metasv-blk-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MetaSV blk Reader

MetaSV golang tool to read blk.data file , and parse it into blocks

Usage

func main()  {
	// create a new reader, replace the blk folder path and file number
	reader := blkreader.NewBlockFileReader("./", 2112, blkreader.MainNetMagic)
	defer reader.Close()
	for  {
		// read next block from blk file
		block, err := reader.NextBlock()
		// break if EOF
		if err == io.EOF{
			break
		}
		if err != nil {
			panic(err)
		}
		fmt.Println(block.BlockHash().String())
	}
}

About

Go module to read bitcoin blk.dat file into msgBlock formated blocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages