Giter Site home page Giter Site logo

deegiimurun / espresso-sequencer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from espressosystems/espresso-sequencer

0.0 0.0 0.0 3.12 MB

Shell 0.41% Python 0.57% Rust 82.26% Nix 0.99% Makefile 0.03% Dockerfile 0.34% Solidity 15.23% Just 0.18%

espresso-sequencer's Introduction

Espresso Sequencer

The Espresso Sequencer offers rollups credible neutrality and enhanced interoperability, without compromising on scale. Consisting of a data availability solution and a decentralized network of nodes that sequences transactions, layer-2 rollups can leverage the Espresso Sequencer to give developers and end users fast confirmations, low (and fair) fees, and robust infrastructure.

Documentation

Architecture diagram

Running the demo

Refer to sequencer-example-l2 for instructions on how to run a dockerized Espresso Sequencer network with an example Layer 2 rollup application.

Development

  • Obtain code: git clone [email protected]:EspressoSystems/espresso-sequencer.
  • Make sure nix is installed.
  • Activate the environment with nix-shell, or nix develop, or direnv allow if using direnv.
  • For installation without nix please see ubuntu.md.

Run the tests

just pull # to pull docker images
cargo test --all-features

Building figures

make doc

Building and running

Docker images and the docker-compose-demo.yaml file are provided for convenience. The Docker-based demo fetches the images from the ghcr repository, where they are updated with every push to main on GitHub. For testing uncommitted changes, you can also run the binaries by manually building and running the services.

Build all executables with cargo build --release. You may then start a sequencer network. First, start an orchestrator. Choose a port $PORT to run it on and decide how many sequencer nodes $N you will use, then run target/release/orchestrator -p $PORT -n $N.

The sequencer will distribute a HotShot configuration to all the nodes which connect to it, which specifies consensus parameters like view timers. There is a default config, but you can override any parameters you want by passing additional options to the orchestrator executable. Run target/release/orchestrator --help to see a list of available options. Next, you must launch two web-server instances, which are necessary to facilitate consensus. One web server is for data availability, while the other coordinates consensus among sequencer nodes. Pick a $DA_PORT and a $CONSENSUS_PORT and run:

target/release/web-server -p $DA_PORT
target/release/web-server -p $CONSENSUS_PORT

Once you have started the orchestrator and the web servers, you must connect $N sequencer nodes to them, after which the network will start up automatically. To start one node, run

target/release/sequencer \
    --orchestrator-url http://localhost:$PORT \
    --da-server-url http://localhost:$DA_PORT \
    --consensus-server-url http://localhost:$CONSENSUS_PORT \
    -- http --port 8083 -- query --storage-path storage -- submit

A useful Bash snippet for running $N nodes simultaneously in the background of your shell is:

for i in `seq $N`; do
    target/release/sequencer \
        --orchestrator-url http://localhost:$PORT \
        --da-server-url http://localhost:$DA_PORT \
        --consensus-server-url http://localhost:$CONSENSUS_PORT
done

Note: if the sequencer shows a "Connection refused" error you may need to use 127.0.0.1 instead of localhost when connecting to the web server. This is because localhost may resolve to ::1 if dual stack (ipv4 and ipv6) networking is enabled.

Contracts

Development

A foundry project for the contracts specific to HotShot can be found in the directory contracts.

To compile

forge build

To run the tests

forge test

In order to avoid constant warnings about checksum mismatches with svm-rs managed solc we set FOUNDRY_SRC to solc installed via flake.nix.

  • To use the contrats from rust generate the rust contracts bindings: just gen-bindings.

To generate documentation in ./docs for solidity code run

forge doc

Deployment

To deploy the contracts to a local testnet, first run a dev chain (e. g. anvil), then run

forge script DeployHotShot --broadcast --rpc-url local

To deploy to sepolia set SEPOLIA_RPC_URL and MNEMONIC env vars and run

forge script DeployHotShot --broadcast --rpc-url sepolia

To additionally verify the contact on etherscan set the ETHERSCAN_API_KEY env var and run

forge script DeployHotShot --broadcast --rpc-url sepolia --verify

Running the script will save a file with details about the deployment in contracts/broadcast/$CHAIN_ID.

Misc

Authenticate with GitHub container registry

This is only necessary to fetch private images.

  • Go to your github profile
  • Developer Settings > Personal access tokens > Personal access tokens (classic)
  • Generate a new token
    • for the scope options of the token, tick the repo box.
  • Run docker login ghcr.io --username <you_github_id> --password <your_personal_access_token>

License

Copyright

(c) 2022 Espresso Systems espresso-sequencer was developed by Espresso Systems. While we plan to adopt an open source license, we have not yet selected one. As such, all rights are reserved for the time being. Please reach out to us if you have thoughts on licensing.

Disclaimer

DISCLAIMER: This software is provided "as is" and its security has not been externally audited. Use at your own risk.

espresso-sequencer's People

Contributors

sveitser avatar jbearer avatar nomaxg avatar dependabot[bot] avatar laplacefox avatar ancient123 avatar github-actions[bot] avatar philippecamacho avatar fkrell avatar imjeremyhe avatar alxiong avatar dieracdelta avatar clu8 avatar gooddaisy avatar ggutoski avatar rob-maron 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.