Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update README to latest changes #18

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 62 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,95 @@ The Subgraph Oracle verifies the availability of the subgraph files and does oth

```
USAGE:
availability-oracle [FLAGS] [OPTIONS] --rewards-manager-contract <rewards-manager-contract> \
--url <url> --ipfs <ipfs> --signing-key <signing-key> --subgraph <subgraph>
availability-oracle [FLAGS] [OPTIONS] --ipfs <ipfs> --signing-key <signing-key> --subgraph <subgraph> --url <url>

FLAGS:
--dry-run log the results but not send a transaction to the rewards manager
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
--rewards-manager-contract <rewards-manager-contract>
Address of the Graph Protocol RewardsManager contract [env: REWARDS_MANAGER_CONTRACT=]
--url <url>
RPC URL for EVM-compatible netwrok, must be a valid URL [env: RPC_URL=]
--grace-period <grace-period>
Grace period, in seconds from subgraph creation, for which subgraphs will not be checked [env:
ORACLE_GRACE_PERIOD=] [default: 0]
Grace period, in seconds from subgraph creation, for which subgraphs will not be checked [env: ORACLE_GRACE_PERIOD=] [default: 0]

--ipfs <ipfs>
IPFS endpoint with access to the subgraph files [env: ORACLE_IPFS=]

--ipfs-concurrency <ipfs-concurrency>
Maximum concurrent calls to IPFS [env: ORACLE_IPFS_CONCURRENCY=] [default: 100]

--ipfs-timeout <ipfs-timeout>
IPFS timeout after which a file will be considered unavailable [env: ORACLE_IPFS_TIMEOUT_SECS=] [default:
30]
--metrics-port <metrics-port> [env: ORACLE_METRICS_PORT=] [default: 8090]
IPFS timeout after which a file will be considered unavailable [env: ORACLE_IPFS_TIMEOUT_SECS=] [default: 30]

--metrics-port <metrics-port>
[env: ORACLE_METRICS_PORT=] [default: 8090]

--min-signal <min-signal>
Minimum signal for a subgraph to be checked [env: ORACLE_MIN_SIGNAL=] [default: 100]

--oracle-index <oracle-index>
Assigned index for the oracle, to be used when voting on SubgraphAvailabilityManager [env: ORACLE_INDEX=]

--period <period>
How often the oracle should check the subgraphs. With the default value of 0, the oracle will run once and
terminate [env: ORACLE_PERIOD_SECS=] [default: 0]
How often the oracle should check the subgraphs. With the default value of 0, the oracle will run once and terminate [env: ORACLE_PERIOD_SECS=] [default: 0]

--rewards-manager-contract <rewards-manager-contract>
The address of the rewards manager contract [env: REWARDS_MANAGER_CONTRACT=]

--signing-key <signing-key>
The secret key of the oracle for signing transactions [env: ORACLE_SIGNING_KEY=]

--subgraph <subgraph> Graphql endpoint to the network subgraph [env: ORACLE_SUBGRAPH=]
--subgraph <subgraph>
Graphql endpoint to the network subgraph [env: ORACLE_SUBGRAPH=]

--subgraph-availability-manager-contract <subgraph-availability-manager-contract>
The address of the subgraph availability manager contract [env: SUBGRAPH_AVAILABILITY_MANAGER_CONTRACT=]

--supported-data-source-kinds <supported-data-source-kinds>...
a comma separated list of the supported data source kinds [env: SUPPORTED_DATA_SOURCE_KINDS=] [default: ethereum,ethereum/contract,file/ipfs,substreams,file/arweave]

-s, --supported-networks <supported-networks>...
a comma separated list of the supported network ids [env: SUPPORTED_NETWORKS=] [default: mainnet]

--url <url>
RPC url for the network [env: RPC_URL=]

```

Example command to testing with a dry run:
## Examples

### Example command to testing with a dry run:

```
cargo run -p availability-oracle -- --ipfs https://api.thegraph.com/ipfs --subgraph https://gateway.thegraph.com/network --dry-run --min-signal 10000
cargo run -p availability-oracle -- \
--ipfs https://api.thegraph.com/ipfs \
--subgraph https://gateway.thegraph.com/network \
--min-signal 10000 \
--url <url> \
--dry-run
```

### Example command to run `SubgraphAvailabilityManager` configuration:

```
cargo run -p availability-oracle -- \
--ipfs https://api.thegraph.com/ipfs \
--subgraph https://gateway.thegraph.com/network \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a deprecated endpoint so I'd suggest replacing this with a correct network subgraph endpoint (ideally the one that's published to the Network, so including a placeholder for an API key?). But this can be done in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. I'll replace with a placeholder for the entire url and when we switch to network we can add that endpoint with placeholders.

--min-signal 10000 \
--url <url> \
--subgraph-availability-manager-contract <address> \
--oracle-index <index> \
--signing-key <signing-key>
```

### Example command to run `RewardsManager` configuration:

```
cargo run -p availability-oracle -- \
--ipfs https://api.thegraph.com/ipfs \
--subgraph https://gateway.thegraph.com/network \
--min-signal 10000 \
--url <url> \
--rewards-manager-contract <address> \
--signing-key <signing-key>
```
Loading