Skip to content

Commit

Permalink
Revamp README (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix authored Nov 13, 2023
1 parent 0e8fd8d commit 44c065b
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 1 deletion.
101 changes: 101 additions & 0 deletions .github/actions/test-coverage/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# This code is sourced from the go-coverage-report Repository by ncruces.
# Original code: https://github.com/ncruces/go-coverage-report
#
# MIT License
#
# Copyright (c) 2023 Nuno Cruces
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

#!/usr/bin/env bash
set -euo pipefail

# This is a simple script to generate an HTML coverage report,
# and SVG badge for your Go project.
#
# It's meant to be used manually or as a pre-commit hook.
#
# Place it some where in your code tree and execute it.
# If your tests pass, next to the script you'll find
# the coverage.html report and coverage.svg badge.
#
# You can add the badge to your README.md as such:
# [![Go Coverage](PATH_TO/coverage.svg)](https://raw.githack.com/URL/coverage.html)
#
# Visit https://raw.githack.com/ to find the correct URL.
#
# To have the script run as a pre-commmit hook,
# symlink the script to .git/hooks/pre-commit:
#
# ln -s PATH_TO/coverage.sh .git/hooks/pre-commit
#
# Or, if you have other pre-commit hooks,
# call it from your main hook.

# Get the script's directory after resolving a possible symlink.
SCRIPT_DIR="$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")"

OUT_DIR="${1-$SCRIPT_DIR}"
OUT_FILE="$(mktemp)"

# Get coverage for all packages in the current directory; store next to script.
go test -short ./... -coverprofile "$OUT_FILE"

if [[ "${INPUT_REPORT-true}" == "true" ]]; then
# Create an HTML report; store next to script.
go tool cover -html="$OUT_FILE" -o "$OUT_DIR/coverage.html"
fi

# Extract total coverage: the decimal number from the last line of the function report.
COVERAGE=$(go tool cover -func="$OUT_FILE" | tail -1 | grep -Eo '[0-9]+\.[0-9]')

echo "coverage: $COVERAGE% of statements"

date "+%s,$COVERAGE" >> "$OUT_DIR/coverage.log"
sort -u -o "$OUT_DIR/coverage.log" "$OUT_DIR/coverage.log"

# Pick a color for the badge.
if awk "BEGIN {exit !($COVERAGE >= 90)}"; then
COLOR=brightgreen
elif awk "BEGIN {exit !($COVERAGE >= 80)}"; then
COLOR=green
elif awk "BEGIN {exit !($COVERAGE >= 70)}"; then
COLOR=yellowgreen
elif awk "BEGIN {exit !($COVERAGE >= 60)}"; then
COLOR=yellow
elif awk "BEGIN {exit !($COVERAGE >= 50)}"; then
COLOR=orange
else
COLOR=red
fi

# Download the badge; store next to script.
curl -s "https://img.shields.io/badge/coverage-$COVERAGE%25-$COLOR" > "$OUT_DIR/coverage.svg"

if [[ "${INPUT_CHART-false}" == "true" ]]; then
# Download the chart; store next to script.
curl -s -H "Content-Type: text/plain" --data-binary "@$OUT_DIR/coverage.log" \
https://go-coverage-report.nunocruces.workers.dev/chart/ > \
"$OUT_DIR/coverage-chart.svg"
fi

# When running as a pre-commit hook, add the report and badge to the commit.
if [[ -n "${GIT_INDEX_FILE-}" ]]; then
git add "$OUT_DIR/coverage.html" "$OUT_DIR/coverage.svg"
fi
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,40 @@

## Overview

EigenDA is a secure, high-throughput, and decentralized data availability (DA) service built on top of Ethereum using the EigenLayer restaking ecosystem. To understand how EigenDA works and how it fits into the modern landscape of DA for blockchain applications, see the [DA Landscape](https://docs.eigenda.xyz/data-availability/) and [How EigenDA Works](https://docs.eigenda.xyz/how-it-works/) sections of our [docs](https://docs.eigenda.xyz/) (Accessing these pages will require you to log in using your github account).
EigenDA is a secure, high-throughput, and decentralized data availability (DA) service built on top of Ethereum using the [EigenLayer](https://github.com/Layr-Labs/eigenlayer-contracts) restaking primitives.

EigenDA is the [first actively validated service (AVS)](https://www.blog.eigenlayer.xyz/twelve-early-projects-building-on-eigenlayer/) built on EigenLayer. The EigenLayer restakers delegate stake to node operators performing validation for EigenDA for service payments, and rollups post data to EigenDA to access low cost, high throughput data availability service with security derived from Ethereum.

- Aligning with Ethereum ecosystem and building toward the Ethereum scaling [endgame](https://vitalik.ca/general/2021/12/06/endgame.html)
- A standard for high throughput and low cost data availability to enable growth of new on-chain use cases
- Horizontally scaling both security and throughput with the amount of restake and operators in the network, and meanwhile protecting decentralization (less work needed from each operator as network scaling)
- Innovative features such as Dual Quorum (two sperate quorums can be required to attest to the availability of data, for example ETH quorum and rollup's native token), customizable safety and liveness.

To understand more how EigenDA works and how it transforms the modern landscape of data availability, continue reading [EigenDA introduction](https://www.blog.eigenlayer.xyz/intro-to-eigenda-hyperscale-data-availability-for-rollups/).

To dive deep into the technical details, continue reading [EigenDA protocol spec](https://github.com/Layr-Labs/eigenda/blob/master/docs/spec/overview.md).

If you're interested in integrating your rollup with EigenDA, please fill out the [EigenDA questionnaire](https://docs.google.com/forms/d/e/1FAIpQLSez6PG-BL6C6Mc4QY1M--vbV219OGL_0Euv2zhJ1HmcUiU7cw/viewform).

## API Documentation

The EigenDA public API is documented [here](https://github.com/Layr-Labs/eigenda/tree/master/api/docs).

## Operating EigenDA Node

If you want to be an EigenDA operator and run a node, please clone [Operator Setup Guide](https://github.com/Layr-Labs/eigenda-operator-setup) GitHub repo and follow the instructions there.

## Contributing
We welcome all contributions! There are many ways to contribute to the project, including but not limited to:

- Opening a PR
- [Submitting feature requests or bugs](https://github.com/Layr-Labs/eigenda/issues/new/choose)
- Improving our product or contribution documentation
- Voting on [open issues](https://github.com/Layr-Labs/eigenda/issues) or
contributing use cases to a feature request

## Contact

- [Open an Issue](https://github.com/Layr-Labs/eigenda/issues/new/choose)
- [EigenLayer/EigenDA forum](https://forum.eigenlayer.xyz/c/eigenda/9)
- [Email](mailto:[email protected])

0 comments on commit 44c065b

Please sign in to comment.