Coder Social home page Coder Social logo

denis2glez / celestia-node-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eigerco/lumina

0.0 1.0 0.0 503 KB

Celestia light node implementation in Rust WASM

License: Apache License 2.0

Shell 2.43% JavaScript 0.70% Rust 96.34% HTML 0.53%

celestia-node-rs's Introduction

Rust Celestia node

Rust implementation of Celestia's data availability node able to run natively and in the browser-based environments.

Supported features:

  • Synchronize and verify ExtendedHeaders from genesis to the network head
  • Header exchange (header-ex) client and server
  • Listening for, verifying and redistributing extended headers on gossip protocol (header-sub)
  • Persistent store for Headers
  • Integration tests with Go implementation
  • Data Availability Sampling
  • Creating, distributing, and listening for Fraud proofs

Building and running

Install common dependencies

# install dependencies
sudo apt-get install -y build-essential curl git protobuf-compiler

# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# open a new terminal or run
source "$HOME/.cargo/env"

# clone the repository
git clone https://github.com/eigerco/celestia-node-rs
cd celestia-node-rs

Running the node natively

# install celestia-node
cargo install --path celestia

# run celestia node
celestia node --network mocha

# check out help for more configuration options
celestia node --help

Building and serving node-wasm

# build wasm-node to be bundled with celestia
wasm-pack build --target web node-wasm

# serve celestia node on default localhost:9876
celestia browser

Running Go celestia node for integration

Follow this guide to authorize yourself in github's container registry.

Start a celestia network with single validator and bridge

docker compose -f ci/docker-compose.yml up --build --force-recreate -d
# and to stop it
docker compose -f ci/docker-compose.yml down

Note

You can run more bridge nodes by uncommenting / replicating the bridge service definition in ci/docker-compose.yml.

To get the JWT token for the account with coins (coins will be transferred in block 2):

export CELESTIA_NODE_AUTH_TOKEN=$(docker compose -f ci/docker-compose.yml exec bridge celestia bridge auth admin --p2p.network private)

Accessing json RPC api with Go celestia cli:

celestia rpc blob Submit 0x0c204d39600fddd3 '"Hello world"' --print-request

Extracting blocks for test cases:

celestia rpc header GetByHeight 27 | jq .result

Running integration tests with celestia node

Make sure you have the celestia network running inside docker compose from the section above.

Generate authentication tokens for the tests

./tools/gen_auth_tokens.sh

Run tests

cargo test

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.