Skip to content

Commit

Permalink
feat: rescope poi-radio
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Jul 14, 2023
1 parent a98fbff commit c91dd8b
Show file tree
Hide file tree
Showing 53 changed files with 905 additions and 867 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
REGISTRY: ghcr.io
BASE_NAME: graphops/poi-radio
BASE_NAME: graphops/subgraph-radio

jobs:
build-linux:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gen-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/release/poi-radio
asset_name: poi-radio-${{ github.event.release.tag_name }}-ubuntu
asset_path: ./target/release/subgraph-radio
asset_name: subgraph-radio-${{ github.event.release.tag_name }}-ubuntu
asset_content_type: binary/octet-stream
build-macos:
runs-on: macos-latest
Expand All @@ -56,6 +56,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/release/poi-radio
asset_name: poi-radio-${{ github.event.release.tag_name }}-macos
asset_path: ./target/release/subgraph-radio
asset_name: subgraph-radio-${{ github.event.release.tag_name }}-macos
asset_content_type: binary/octet-stream
106 changes: 53 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]

members = ["poi-radio", "test-sender", "test-utils", "test-runner", "one-shot"]
members = ["subgraph-radio", "test-sender", "test-utils", "test-runner", "one-shot"]
resolver = "2"

[profile.dev]
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ RUN apt-get update \

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates

COPY . /poi-radio
WORKDIR /poi-radio
COPY . /subgraph-radio
WORKDIR /subgraph-radio

RUN sh install-golang.sh
ENV PATH=$PATH:/usr/local/go/bin

RUN cargo build --release -p poi-radio
RUN cargo build --release -p subgraph-radio

FROM alpine:3.17.3 as alpine
RUN set -x \
&& apk update \
&& apk add --no-cache upx dumb-init
COPY --from=build-image /poi-radio/target/release/poi-radio /poi-radio/target/release/poi-radio
RUN upx --overlay=strip --best /poi-radio/target/release/poi-radio
COPY --from=build-image /subgraph-radio/target/release/subgraph-radio /subgraph-radio/target/release/subgraph-radio
RUN upx --overlay=strip --best /subgraph-radio/target/release/subgraph-radio

FROM gcr.io/distroless/cc AS runtime
COPY --from=build-image /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build-image /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build-image /etc/passwd /etc/passwd
COPY --from=build-image /etc/group /etc/group
COPY --from=alpine /usr/bin/dumb-init /usr/bin/dumb-init
COPY --from=alpine "/poi-radio/target/release/poi-radio" "/usr/local/bin/poi-radio"
ENTRYPOINT [ "/usr/bin/dumb-init", "--", "/usr/local/bin/poi-radio" ]
COPY --from=alpine "/subgraph-radio/target/release/subgraph-radio" "/usr/local/bin/subgraph-radio"
ENTRYPOINT [ "/usr/bin/dumb-init", "--", "/usr/local/bin/subgraph-radio" ]
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# POI Radio
# Subgraph Radio

[![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.graphops.xyz/graphcast/radios/poi-radio)
[![crates.io](https://img.shields.io/crates/v/poi-radio.svg)](https://crates.io/crates/poi-radio)
[![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.graphops.xyz/graphcast/radios/subgraph-radio)
[![crates.io](https://img.shields.io/crates/v/subgraph-radio.svg)](https://crates.io/crates/subgraph-radio)

## Introduction

This is a Graphcast Radio focused on sending gossips about particular subgraphs on a P2P network. The available message types are Public Proof of Indexing (PoI) messages from an indexer, or a version upgrade annoucement message from a subgraph owner.

Reaching Public PoI consensus and ensuring data availability during subgraph upgrades is critical to the indexing service. Both messages should find value from indexers, subgraph owners, and ultimately data consumers.

[Documentation](https://docs.graphops.xyz/graphcast/radios/subgraph-radio) | [Packages](https://github.com/graphops/subgraph-radio/pkgs/container/subgraph-radio) | [Chat](https://discord.com/channels/438038660412342282/1087503343410225152)

### Public PoI message

The key requirement for an Indexer to earn indexing rewards is to submit a valid Proof of Indexing (POI) promptly. The importance of valid POIs causes many Indexers to alert each other on subgraph health in community discussions. To alleviate the Indexer workload, this Radio utilized Graphcast SDK to exchange and aggregate POI along with a list of Indexer on-chain identities that can be used to trace reputations. With the pubsub pattern, the Indexer can get notified as soon as other indexers (with majority of stake) publish a POI different from the local POI.

[Documentation](https://docs.graphops.xyz/graphcast/radios/poi-radio) | [Packages](https://github.com/graphops/poi-radio/pkgs/container/poi-radio) | [Chat](https://discord.com/channels/438038660412342282/1087503343410225152)
### Version Upgrade message

When developers publish a new version (subgraph deployment) to their subgraph, data service instability may occur while their API queries the pre-existing version. Indexers may require some time to sync a subgraph to the chainhead after they have stopped syncing the previous deployment. To decrease the upgrade friction, developers can send a message before publishing the subgraph, including the old deployment hash, new deployment hash, matching subgraph id, the time they would like to publish the version. Indexers who is running the subgraph radio with notification methods configured should get notified; later on this radio can optionally automate the deployment process on graph node, but it is still at the subgraph developers' discretion to await for the indexers to sync upto chainhead, in which point they can publish the staged version without disrupting API usage.

## 🧪 Testing

Expand Down
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Contributing to the POI-Crosschecker Radio
# Contributing to the Subgraph Radio

Welcome to Graphcast POI crosschecker Radio! Thanks a ton for your interest in contributing.
Welcome to Graphcast Subgraph Radio! Thanks a ton for your interest in contributing.

If you run into any problems feel free to create an issue. PRs are much appreciated for simple things. If it's something more complex we'd appreciate having a quick chat in GitHub Issues or the Graph Discord server.

Expand Down
4 changes: 2 additions & 2 deletions one-shot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ edition = "2021"
authors = ["GraphOps (axiomatic-aardvark, hopeyen)"]
description = "One-shot messaging using Graphcast SDK (can be separated to a different repo)"
license = "Apache-2.0"
repository = "https://github.com/graphops/poi-radio"
repository = "https://github.com/graphops/subgraph-radio"
keywords = ["graphprotocol", "data-integrity", "Indexer", "waku", "p2p"]
categories = ["network-programming", "web-programming::http-client"]

[dependencies]
graphcast-sdk = "0.4.0"
poi-radio = { path = "../poi-radio" }
subgraph-radio = { path = "../subgraph-radio" }
prost = "0.11"
once_cell = "1.17"
chrono = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion one-shot/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ pub struct Config {
long,
value_name = "RADIO_NAME",
env = "RADIO_NAME",
default_value = "poi-radio"
default_value = "subgraph-radio"
)]
pub radio_name: String,
#[clap(long, value_name = "FILTER_PROTOCOL", env = "ENABLE_FILTER_PROTOCOL")]
Expand Down
2 changes: 1 addition & 1 deletion one-shot/src/operator/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tracing::{error, info};
use graphcast_sdk::networks::NetworkName;

use crate::operator::RadioOperator;
use poi_radio::{messages::upgrade::VersionUpgradeMessage, OperationError};
use subgraph_radio::{messages::upgrade::VersionUpgradeMessage, OperationError};

impl RadioOperator {
pub async fn gossip_one_shot(&self) -> Result<String, OperationError> {
Expand Down
Loading

0 comments on commit c91dd8b

Please sign in to comment.