GithubHelp home page GithubHelp logo

sunriselayer / sunrise-da Goto Github PK

View Code? Open in Web Editor NEW

This project forked from celestiaorg/celestia-node

2.0 0.0 0.0 87.08 MB

Sunrise Data Availability Nodes

License: Apache License 2.0

Shell 0.15% Go 98.95% Makefile 0.78% Dockerfile 0.12%

sunrise-da's Introduction

Sunrise DA

Go Reference GitHub release (latest by date including pre-releases) Go CI Go Report Card codecov

Golang implementation of Sunrise's data availability node types (light | full | bridge).

The sunrise-da types described above comprise the sunrise data availability (DA) network.

The DA network wraps the sunrise-core consensus network by listening for blocks from the consensus network and making them digestible for data availability sampling (DAS).

Continue reading here if you want to learn more about DAS and how it enables secure and scalable access to Sunrise chain data.

Table of Contents

Minimum requirements

Requirement Notes
Go version 1.22 or higher

System Requirements

See the official docs page for system requirements per node type:

Installation

git clone https://github.com/sunriselayer/sunrise-da.git
cd sunrise-da
make build
sudo make install

For more information on setting up a node and the hardware requirements needed, go visit our docs at https://docs.celestia.org.

API docs

The sunrise-da public API is documented here.

Node types

  • Bridge nodes - relay blocks from the sunrise consensus network to the sunrise data availability (DA) network
  • Full nodes - fully reconstruct and store blocks by sampling the DA network for shares
  • Light nodes - verify the availability of block data by sampling the DA network for shares

More information can be found here.

Run a node

<node_type> can be: bridge, full or light.

sunrise-da <node_type> init
sunrise-da <node_type> start

Network

  • Mainnet - the main network of Sunrise. Use tokens with real value
  • Testnet - This network is used to test operations on the mainnet. Normally, the same environment as the mainnet is provided, but tokens have no value
  • Private - a network for testing new features. It may contain critical bugs. Do NOT normally use

Run a bridge node

Bridge nodes connect the data availability layer and the consensus layer.

sunrise-da bridge init --core.ip <URI> --p2p.network <NETWORK>

The --core.ip gRPC port defaults to 9090. Normally, set up a RPC node running sunrise-app.

sunrise-da bridge start --core.ip <URI> --p2p.network <NETWORK>

Run a full node

Full storage nodes are Sunrise nodes that store all the data. Full storage nodes send block shares, headers, and fraud proofs to light nodes.

sunrise-da full init --p2p.network <NETWORK>
sunrise-da full start --core.ip <URI> --p2p.network <NETWORK>

Start a full node using RPC. The bridge and full nodes refer to bootstrap.go.

Run a light node

Light nodes ensure data availability. This is the most common way to interact with Sunrise networks. It does NOT require large storage or high-speed connections.

sunrise-da light init --p2p.network <NAME>
sunrise-da light start --core.ip <URI> --p2p.network <NAME>

Environment variables

Variable Explanation Default value Required
SUNRISE_BOOTSTRAPPER Start the node in bootstrapper mode false Optional

Package-specific documentation

sunrise-da's People

Contributors

wondertan avatar renaynay avatar vgonkivs avatar dependabot[bot] avatar walldiss avatar distractedm1nd avatar bidon15 avatar senna46 avatar rootulp avatar evan-forbes avatar ramin avatar jbowen93 avatar tzdybal avatar kimurayu45z avatar msevey avatar adlerjohn avatar tty47 avatar derrandz avatar cemozerr avatar liamsi avatar hoytren avatar smuu avatar atoulme avatar ynewmann avatar jununifi avatar jcstein avatar sysrex avatar cmwaters avatar nitinmewar avatar toanngosy avatar

Stargazers

 avatar BOHDAN avatar

sunrise-da's Issues

Fix Integration Test

Implementation ideas

Other CI/CDs have been resolved. #6 Integration tests need to be fixed.

eh.Commit has previos block info

Implementation ideas

code

	// Make sure the header is consistent with the commit.
	if eh.Commit.Height != eh.RawHeader.Height {
		return fmt.Errorf("header and commit height mismatch: %d vs %d", eh.RawHeader.Height, eh.Commit.Height)
	}

error

2024-04-16T18:53:24.668+0900    ERROR   header/p2p      p2p/subscriber.go:114   invalid header  {"from": "<peer.ID 12*sHJ3v8>", "err": "header and commit height mismatch: 14 vs 13"}
2024-04-16T18:53:24.668+0900    ERROR   core    core/listener.go:252    listener: broadcasting next header      {"height": 14, "err": "validation failed"}
2024-04-16T18:53:29.669+0900    ERROR   header/p2p      p2p/subscriber.go:114   invalid header  {"from": "<peer.ID 12*sHJ3v8>", "err": "header and commit height mismatch: 15 vs 14"}
2024-04-16T18:53:29.669+0900    ERROR   core    core/listener.go:252    listener: broadcasting next header      {"height": 15, "err": "validation failed"}

If make this validation pass, nex validaton fail

	if hhash, chash := eh.RawHeader.Hash(), eh.Commit.BlockID.Hash; !bytes.Equal(hhash, chash) {
		return fmt.Errorf("commit signs block %X, header is block %X", chash, hhash)
	}

error

2024-04-16T20:19:00.897+0900    ERROR   core    core/listener.go:252    listener: broadcasting next header      {"height": 1040, "err": "validation failed"}
2024-04-16T20:19:05.903+0900    ERROR   header/p2p      p2p/subscriber.go:114   invalid header  {"from": "<peer.ID 12*sHJ3v8>", "err": "commit signs block 17A25A7514152847E7FFDE587BFDAF2D696FAB01A9ED0A30BCA2EBA096C1BAE1, header is block 48F4B3DBDFA1B60363C15AFD0B455642B67269910CEE64BA802D6C48B8AF2853"}
2024-04-16T20:19:05.903+0900    ERROR   core    core/listener.go:252    listener: broadcasting next header      {"height": 1041, "err": "validation failed"}
2024-04-16T20:19:08.979+0900    INFO    basichost       basic/natmgr.go:112     DiscoverNAT error:no NAT found
2024-04-16T20:19:10.909+0900    ERROR   header/p2p      p2p/subscriber.go:114   invalid header  {"from": "<peer.ID 12*sHJ3v8>", "err": "commit signs block 48F4B3DBDFA1B60363C15AFD0B455642B67269910CEE64BA802D6C48B8AF2853, header is block B8610D24F9139B784C121DE52365D13D453F2DAE58B179C70C34092909EAA48E"}
2024-04-16T20:19:10.909+0900    ERROR   core    core/listener.go:252    listener: broadcasting next header      {"height": 1042, "err": "validation failed"}

The previous and next hashes are matched.
The problem is that they are offset by one.

App Verison Problem

Bug

Run

make build
sudo make install
sunrise bridge init --core.ip sunrise-private-1.cauchye.net 
sunrise bridge start --core.ip sunrise-private-1.cauchye.net --p2p.network private

node starts up and begins communicating with the app

got error

2024-04-16T00:53:00.490+0900    ERROR   header/p2p      p2p/subscriber.go:114   invalid header  {"from": "<peer.ID 12*sHJ3v8>", "err": "app version mismatch, expected: 2, got 0"}
2024-04-16T00:53:00.490+0900    ERROR   core    core/listener.go:252    listener: broadcasting next header      {"height": 543, "err": "validation failed"}

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.