Skip to content

Go library to access the blockchain state of Go-ethereum

License

Notifications You must be signed in to change notification settings

umbracle/geth-data-layer

Repository files navigation

Geth-data-layer

Go library to access the geth stored data.

Usage

package main

import (
	"fmt"

	gethdatalayer "github.com/umbracle/geth-data-layer"
)

func main() {
	path := "..../chaindata" // path to the storage data

	store, err := gethdatalayer.NewStore(path)
	if err != nil {
		panic(err)
	}

	iter := store.Iterator()
	// iter.Seek(1000000)

	for iter.Next() {
		val, _ := iter.Value()
		fmt.Println(val.Number)
	}
}

There are three storage interaces:

  • NewAncientStore: Access the ancient store data.
  • NewLevelDbStore: Access the leveldb store data.
  • NewStore: Abstraction on top of the leveldb and ancient data.

About

Go library to access the blockchain state of Go-ethereum

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages