GithubHelp home page GithubHelp logo

isabella232 / rollup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matter-labs-archive/rollup

0.0 0.0 0.0 1.33 MB

Matter Labs' ZK Rollup

License: Apache License 2.0

Makefile 1.22% Shell 1.02% JavaScript 16.92% Rust 72.16% PLpgSQL 0.77% TSQL 0.11% Dockerfile 0.21% HTML 0.16% Vue 7.44%

rollup's Introduction

FRANKLIN: Matter Labs' Rollup: commit-chain driven by SNARKs

Basics

Prerequisites

Prepare dev environment prerequisites: see docs/setup-dev.md

Setup local dev environment

First-time setup:

franklin init

To completely reset the dev environment:

  • Stop services: franklin dev-down
  • Remove mounted container data: rm -rf ./volumes
  • Repeat the setup procedure above

(Re)deploy db and contraсts:

franklin redeploy

Environment configurations

Env config files are held in etc/env/

List configurations:

franklin env

Switch between configurations:

franklin env <ENV_NAME>

Monitoring & management:

Seed for Metamask: fine music test violin matrix prize squirrel panther purchase material script deal Geth: geth attach http://localhost:8545

NOTE: if you are resetting geth, each Metamask account must be manually reset via Settings > Advanced > Reset account.

Blockscout (local blockchain explorer)

It generates quite some CPU load, but might be useful to visualize blockchain activity. Use with caution.

  • Migrate blockscout (do this once to setup database): franklin blockscout-migrate

  • Start: franklin blockscout-up

  • Stop: franklin blockscout-down

Blockscout will be available at http://localhost:4000/txs

Build and run server + prover locally:

franklin server
franklin prover
franklin client

Client UI will be available at http://localhost:8080

Start server and prover as local docker containers:

  • Start: franklin start

  • Watch logs: franklin logs

  • Stop: franklin stop

Build and push images to dockerhub:

franklin push

Development

Database migrations

  • cd core/storage
  • Add diesel migration
  • Rename core/storage/schema.rs.generated to schema.rs
  • Run tests: franklin db-tests

Generating keys

To generate a proving key, from server dir run:

cargo run --release --bin read_write_keys

It will generate a *VerificationKey.sol and *_pk.key files for 'deposit', 'exit' and 'transfer' circuits in the root folder.

Move files to proper locations:

mv -f n*VerificationKey.sol ./contracts/contracts/
mv -f *_pk.key ./prover/keys/

If the pregenerated leaf format changes, replace the EMPTY_TREE_ROOT constant in contracts/contracts/PlasmaStorage.sol.

Contratcs

Re-build contracts:

cd contracts; yarn build

IMPORTANT! Generated .abi and .bin files are fed to cargo to build module plasma::eth.

So you need to rebuild the code on every change (to be automated).

Publish source code on etherscan

franklin flatten source

rollup's People

Contributors

bradfora avatar gluk64 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.