c-kzg-4844/bindings/go
Justin Traglia 7b500394f0
Remove go bindings example (#341)
2023-08-16 00:08:54 +03:00
..
blst_headers Upgrade blst to v0.3.11 (#330) 2023-08-10 12:53:42 +01:00
README.md Remove go bindings example (#341) 2023-08-16 00:08:54 +03:00
main.go [Go] Make UnmarshalText funcs safer (#306) 2023-05-25 14:40:21 +03:00
main_test.go Switch to big-endian (#305) 2023-05-24 08:44:05 -05:00

README.md

Go bindings

This package implements Go bindings (using Cgo) for the exported functions in C-KZG-4844.

Installation

go get github.com/ethereum/c-kzg-4844

Go version

This package requires 1.19rc1 or later. Version 1.19beta1 and before will not work. These versions have a linking issue and are unable to see blst functions.

Tests

Run the tests with this command:

go test

Benchmarks

Run the benchmarks with this command:

go test -bench=Benchmark

Minimal

By default, FIELD_ELEMENTS_PER_BLOB will be 4096 (mainnet), but you can manually set it to 4 (minimal), like so:

CGO_CFLAGS="-DFIELD_ELEMENTS_PER_BLOB=4" go build

Note

The go.mod and go.sum files are in the project's root directory because the bindings need access to the c-kzg-4844 source, but Go cannot reference files outside its module/package. The best way to deal with this is to make the whole project available, that way everything is accessible.