GithubHelp home page GithubHelp logo

renovate-bot / tuanggo-_-trusted-setup-frontend Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 13.86 MB

The KZG Ceremony web browser implementation

Home Page: https://ceremony.ethereum.org

Shell 0.25% JavaScript 39.62% TypeScript 58.94% HTML 1.18%

tuanggo-_-trusted-setup-frontend's Introduction

KZG Ceremony Frontend

This React App is a graphic interface to interact with the Ethereum KZG Ceremony. Participants can checkout the website at ceremony.ethereum.org.

Start

To start this app execute the following steps:

  1. Run the sequencer app from https://github.com/ethereum/kzg-ceremony-sequencer. It is assumed that the assigned port is 3000 and that our react app would use port 3001. You can set PORT env variable with a specific port for React.

  2. Setup environment variables:

  • Sequencer API URL

    • Ubuntu: export REACT_APP_API_ROOT=http://localhost:3000
    • Windows (Powershell): $env:REACT_APP_API_ROOT="http://localhost:3000"
  • Environment

    • Ubuntu: export REACT_APP_ENVIRONMENT="testnet"
    • Windows (Powershell): $env:REACT_APP_ENVIRONMENT="testnet"
  1. Install dependencies: yarn install

  2. Start application: yarn start

Note: If the Rust code is updated, copy the /wasm directory from the wrapper library in the public/ directory. Most of the times the wasm-worker.js text will not change.

Build for IPFS

A build for IPFS should result in the same CID as others who have built from the same source. However, it is necessary to use a compatible environment and tool set to ensure that differences aren't introduced. Docker images are available to provide the required environment.

The computation code is written in Rust and compiled to WASM. The compiled WASM package is available, for convenience, in the public/wasm folder, but a thorough build for IPFS will involve rebuilding that package. The code can be found here. The zkparty/wasm-pack-wrapper docker image includes the code as well as the environment for compiling to WASM.

Build and add using Docker

  • Set required environment variables
    • export REACT_APP_API_ROOT=https://seq.ceremony.ethereum.org
    • export REACT_APP_ENVIRONMENT=production
  • Build the WASM wrapper Docker image, or docker pull zkparty/wasm-pack-wrapper
  • Pull a Docker image for node.js: docker pull node:19-bullseye
  • Build the entire site, and run an IPFS node: ./docker-build.sh
  • Wait for the IPFS node to complete its startup. Watch the container's logs: docker logs ipfs-host
  • Add the site to IPFS: docker exec ipfs-host ipfs add -r /export
  • Run the ceremony from the IPFS site:
    • Note the hash generated for /export in the previous step
    • In your browser, navigate to http://localhost:8080/ipfs/<hash>
  • Stop the container once you're finished: docker stop ipfs-host

This will result in a series of log messages reporting the CID of each object in the folder. The CID of the export folder itself is the important one for our purposes.

...
added QmV7zRBYTYf8wmQQzXfnfRFTyYBUByJGaLB37VuHjsj6Y6 export/wasm/pkg
added QmZTdJheNur4R2esdej5w1gktGS5aLHYHtLsChMjACmzuk export/wasm
added QmbTGA1mPf3nb5RRWehvrHn7cz3jwVQdj91r3c6eHmdx4k export
13.80 MiB / 13.80 MiB [=======================================================================================] 100.00%

The latest build has this CID: QmfEC3xvQUi3jS26MP16kZATLgkP1a54fmFhhpnPPyCG8N

or, in base32: bafybeih254gra4gmvvf65qj52r6jphortyir6em4wgsna6x2osmuggpox4

The site can be added to pinning services by uploading the build folder.

You can access it using the ENS latest.kzgceremony.eth

Note: The IPFS deployment was built using WASM wrapper-small-pot tag ipfs_v3 and kzg-ceremony-sequencer commit 2538f2f08d4db880d7f4608e964df0b695bc7d2f.

Building from the Audited commit

An audit of the code was conducted by Sigma Prime. The audit report notes the commit hash at which the audit was restested following implementation of the audit recommendations.

To build the site at that commit:

  • Checkout the wrapper-small-pot repo at tag sigp-audit. Build the WASM code as per above.
  • Checkout this repo at tag frontend-audit.
  • Set environment variables for running live. The .env file should contain these entries:
REACT_APP_API_ROOT=https://seq.ceremony.ethereum.org
REACT_APP_ENVIRONMENT=prod
  • Build the site (see above).

The IPFS CID for the audited code is QmevfvaP3nR5iMncWKa55B2f5mUgTAw9oDjFovD3XNrJTV

  1. Access it here
  2. Or use the ENS audit.kzgceremony.eth
  3. Or at other IPFS gateways

tuanggo-_-trusted-setup-frontend's People

Contributors

axlvaz avatar bigint avatar carlbeek avatar chialit avatar glamperd avatar nicoserranop avatar pettinarip avatar skylenet avatar spalladino avatar taxmeifyoucan avatar tkmct avatar tvanepps avatar vdusart avatar wackerow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.