Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 2.62 KB

CONTRIBUTING.md

File metadata and controls

73 lines (53 loc) · 2.62 KB

Contributing

This document exists as a brief introduction for how you can contribute to this repository. It includes a guide to the structure of the repository, building and getting your code on main.

If you are new to Go, there is a guide to getting started with the language that provides some basic resources for getting started.

Font Display in Powershell

If using Powershell, change font to NSimSun to be able to see all characters properly. This is taken from this stackoverflow answer.

Repository Structure

This repository consists of two primary parts.

  • abstractor: The abstractor, which is responsible for providing an abstract front-end to various ZK systems.
  • extractor: The extractor, which is responsible for the generation of the Lean code using the data generated by the parser in gnark-lean-extractor.

Building

You can build and see the project in action as follows.

  1. Clone the repository into a location of your choice.
git clone https://github.com/reilabs/gnark-lean-demo
  1. Build the go circuit project using go (meaning that you will need to have that toolchain set up).
cd gnark-lean-demo
go mod download
go build -o gnark-lean-demo -v ./...
./gnark-lean-demo extract-circuit --out=lean-circuit/LeanCircuit.lean

The Lean code will be printed in the file lean-circuit/LeanCircuit.lean

Getting Your Code on main

This repository works on a fork and pull request workflow, with code review and CI as an integral part of the process. This works as follows:

  1. If necessary, you fork the repository, but if you have access to do so please create a branch.
  2. You make your changes on that branch.
  3. Pull request that branch against main.
  4. The pull request will be reviewed and CI will be run on it.
  5. Once the reviewer(s) have accepted the code and CI has passed, the code will be merged to main.

New to Go?

If you are new to working with Go, a great place to start is the official set of tutorials. They explain how to install and set the language up, as well as an interactive tour of how to use the language.

We recommend being familiar with the language and the go command-line interface to the build system and compiler before interacting with the Go portion of this repository.