Skip to content

Fantom-foundation/carmendb

 
 

Repository files navigation

Introduction

This directory contains the Go implementation of Carmen. It includes the officially supported Merkle Patricia Trie State Root Hash compatible implementation.

Build

Carmen is included in other systems as a Go library. The Go implementation does not need any C++ dependency, i.e.; no build is required to use the library.

Integrate

Carmen is added to another project simply as a dependency:

go get github.com/Fantom-foundation/carmendb/

Development

For development purposes, it may come handy to execute all tests. It needs build of c++ parts.

Execute in the root directory:

make 

Then execute in this directory:

go test ./...  -timeout=60m  

On memory constrained systems, parallelism may need to be reduced

go test ./... -parallel=1  -timeout 600m   

all tests should pass.

Installing gomock

Tests extensively use mocks. To regenerate mocks, use the command:

go generate ./...

If this command reports that gomock is not installed, one can install it using the following command:

go install go.uber.org/mock/mockgen@latest

Formatting

Formatting rules are enforced in the devvelopment process by running:

gofmt -s -w .

Benchmarks

Some of the key parts may be exercised with benchmarks. For example, the Stores benchmark is executed as:

go test ./backend/store -bench=BenchmarkInsert

For more information about the running benchmarks see: Go testing documentation.

About

Carmen engine for fast world state storage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.2%
  • Other 0.8%