diff --git a/.github/workflows/config/markdownlinkcheckignore.json b/.github/workflows/config/markdownlinkcheckignore.json new file mode 100644 index 0000000..1114b3e --- /dev/null +++ b/.github/workflows/config/markdownlinkcheckignore.json @@ -0,0 +1,12 @@ +{ + "ignorePatterns": [ + { + "_comment": "Finds /protocol AC codes e.g. #0001-MKTF-001", + "pattern": "^#[0-9]{4}-[A-Z]{4}-[0-9]{3}" + }, + { + "_comment": "Finds /non-protocol-specs AC codes e.g. #0001-NP-LIQB-001", + "pattern": "^#[0-9]{4}-[A-Z]{2}-[A-Z]{4}-[0-9]{3}" + } + ] +} \ No newline at end of file diff --git a/.github/workflows/config/markdownlint.json b/.github/workflows/config/markdownlint.json new file mode 100644 index 0000000..991f79f --- /dev/null +++ b/.github/workflows/config/markdownlint.json @@ -0,0 +1,14 @@ +{ + "default": true, + "line-length": false, + "commands-show-output": false, + "no-bare-urls": true, + "no-inline-html": false, + "no-hard-tabs": false, + "MD012": { + "maximum": 2 + }, + "MD024": { + "siblings_only": true + } +} \ No newline at end of file diff --git a/.github/workflows/config/markdownlintignore b/.github/workflows/config/markdownlintignore new file mode 100644 index 0000000..97ea633 --- /dev/null +++ b/.github/workflows/config/markdownlintignore @@ -0,0 +1 @@ +LICENCE \ No newline at end of file diff --git a/.github/workflows/process-oracle-providers.yml b/.github/workflows/process-oracle-providers.yml deleted file mode 100644 index fd351b6..0000000 --- a/.github/workflows/process-oracle-providers.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Process oracle providers - -on: - pull_request: - types: [opened, ready_for_review, reopened, edited, synchronize] - -jobs: - process_oracles_providers: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} - fetch-depth: 0 - - name: Use Node.js 16 - id: Node - uses: actions/setup-node@v2 - with: - node-version: 16.15.1 - - name: Install root dependencies - run: yarn install - - name: Process oracle providers - run: npm run process - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "chore: process oracle providers" - commit_options: "--no-verify --signoff" - skip_fetch: true - skip_checkout: true diff --git a/.github/workflows/quality_check.yml b/.github/workflows/quality_check.yml new file mode 100644 index 0000000..d289064 --- /dev/null +++ b/.github/workflows/quality_check.yml @@ -0,0 +1,39 @@ +--- + + +name: "Quality checks" + +"on": + pull_request: + branches: + - main + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + spellcheck: + name: "Spellcheck" + runs-on: ubuntu-latest + steps: + - name: "Check out" + uses: actions/checkout@v3.5.3 + + - name: "Run PySpelling" + uses: rojopolis/spellcheck-github-actions@0.33.1 + with: + task_name: Markdown + + markdownlint: + name: "Markdownlint" + runs-on: ubuntu-latest + steps: + - name: "Check out" + uses: actions/checkout@v3.5.3 + + - name: "Run Markdownlint" + uses: nosborn/github-action-markdown-cli@v3.3.0 + with: + files: . + config_file: .github/workflows/config/markdownlint.json + ignore_path: .github/workflows/config/markdownlintignore diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..4c2bfad --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Gobalsky Labs Ltd. + +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. \ No newline at end of file diff --git a/README.md b/README.md index 20dfbdf..d68cde5 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,20 @@ -# Vega Oracle Profiles +# Well known Vega entities This is a repository for maintaining data about well known entities to the Vega community. -Oracle profiles are an optional, extra layer of information about oracles on the Vega network, including: +## Well known information -- Oracle name -- Description -- URL -- [Proofs](#proofs), like verified social media accounts - -Oracle developers can use profiles to explain their methodology and demonstrate their reputation. - -Apps on the Vega network can include profiles to help users make decisions about markets. - -Profiles are also used to flag potential issues with oracles or reasons to doubt their legitimacy. - -## Data stored here - -- [Oracle providers](./oracle-providers/): details about public keys of known oracle providers -- [Template](./template.toml): template file for new profile submissions +- [Oracle providers](./oracle-providers): details about well known public keys of known oracle providers +- [Data nodes](./data-nodes): details about well known public data nodes ## Disclaimer -This repository is for data regarding oracles used in markets on the Vega trading platform. +This repository is for data regarding well known information related to the Vega trading platform. Anyone can contribute to it and no representations or warranties of any kind are made by any party about the accuracy of the information contained in it. -## Quick start: creating an oracle profile - -1. Copy the [template oracle profile](./template.toml) -2. Use the oracle's public key or ethereum address as the filename. For example `public-key_` or `ehthereum-address_
` -3. Populate the template with the oracle details -4. Optional: Provide [proofs](#proofs) for social media accounts -3. Open a pull request and mark it as ready for review - -The Vega project team will review the contents of the PRs and if able to verify the proofs contained therein will merge it. This does not constitute an endorsement of the oracle, and does not imply the community should trust it. All it demonstrates is that the proofs are independently verifiable and this verification could (and should) be repeated by individuals within the community. - -When merged, the details in the file may be shown alongside other oracle info in apps on the Vega network. - -## Submission guidelines - -### Public key -The public key defined in the market proposal. - -As one key can act as an oracle for multiple markets, the oracle profile may be associated with more than one market. - -### Description -The following markdown formatting is accepted: - -- Headings -- Links -- Bold -- Underline -- Italic -- Strikethrough - -### Proofs -Link to [signed messages](#how-to-sign-a-message) on websites and social media accounts to associate them with the oracle. Each proof is verified by a panel of repo admins. - -Oracle providers are welcome to submit any kind of proof. Common proofs include: - -- **Twitter**\ -Link to a tweet containing the Twitter username as a signed message -- **Website**\ -Link to a .txt file, at the website root, containing the website URL as a signed message -- **Discord**\ -Link to a comment in [the Vega Protocol Discord channel](https://discord.com/channels/720571334798737489/) containing the Discord username as a signed message -- **Vega forums**\ -Link to a comment in [the Vega forum](https://community.vega.xyz/) containing the forum username as a signed message -- **GitHub**\ -Link to a file in a GitHub repo containing the GitHub username as a signed message - - -## How to sign a message - -The keypair used to sign the message must match the public key in the oracle profile and market spec. - -### VEGA Desktop Wallet -1. Open your Vega desktop wallet -2. Click the keypair you want to use -3. Enter your message in the text area -4. Click ‘sign’ -5. Click the signed message to copy it to your clipboard - -### VEGA CLI Wallet -To generate a signed message using local wallet, run the following command: - -#### MacOS & Linux - -``` -./vegawallet sign --key ReplaceWithTheOraclePublicKey --wallet ReplaceWithTheWalletUsername --message ReplaceWithTheMessage -``` - -#### Windows - -``` -vegawallet sign --key ReplaceWithTheOraclePublicKey --wallet ReplaceWithTheWalletUsername --message ReplaceWithTheMessage -``` - -## Status - -Apps on the Vega network may choose to expose these statuses to users. - -| Flag | Description | -|:--|:--| -| Unknown | This public key's proofs have not been verified yet, or no proofs have been provided yet. | -| Good | This public key's proofs have been verified. | -| Suspicious | This public key is suspected to be acting in bad faith, pending investigation. | -| Malicious | This public key has been observed acting in bad faith. | -| Retired | This public key is no longer in use. | -| Compromised | This public key is no longer in the control of its original owners. | - - ## Help and issues -If you need help creating an oracle profile, you can find it in [the Vega forum](https://community.vega.xyz/). - -You are also welcome to make suggestions or highlight problems by [raising an issue](https://github.com/vegaprotocol/well-known/issues/new). - +- You are welcome to make suggestions or highlight problems in this repository by [raising an issue](https://github.com/vegaprotocol/well-known/issues/new). +- Open a discussion on the [Vega discussions page](https://github.com/vegaprotocol/community/discussions) +- Join the community in [Discord](https://discord.gg/vega-protocol-720571334798737489) diff --git a/data-nodes/README.md b/data-nodes/README.md new file mode 100644 index 0000000..386aa3d --- /dev/null +++ b/data-nodes/README.md @@ -0,0 +1,24 @@ +# Vega data nodes + +This is a repository for maintaining data about well known entities to the Vega community, and can be used for clients and users to discover and connect to data nodes. + +Data nodes provide a service by exposing read only APIs built on top of the Vega platform. + +Data nodes provide the following core features: + +- Consume all events from [Vega](https://github.com/vegaprotocol/vega) core +- Aggregates received events and stores the aggregated data +- Serves stored data via [APIs](https://docs.vega.xyz/mainnet/api/overview) +- Allows advanced configuration [Configure a node](https://github.com/vegaprotocol/vega/tree/develop/datanode#configuration) + +To find out more about the data node service please see the data node [readme](https://github.com/vegaprotocol/vega/blob/develop/datanode/README.md) and / or the [data node operator documentaton](https://docs.vega.xyz/mainnet/node-operators/get-started/setup-datanode). + +## Data stored here + +- [Data node providers](./data-node-providers/data-node-profiles): details about discovery and connection to data nodes. + +## Disclaimer + +This repository is for data regarding oracles used in markets on the Vega trading platform. + +Anyone can contribute to it and no representations or warranties of any kind are made by any party about the accuracy of the information contained in it. diff --git a/data-nodes/fairground.json b/data-nodes/fairground.json new file mode 100644 index 0000000..07815a8 --- /dev/null +++ b/data-nodes/fairground.json @@ -0,0 +1,39 @@ +{ + "name": "fairground", + "chainid": "vega-fairground-202305051805", + "testnet": true, + "nodes": [ + { + "name": "n00", + "status": "enabled", + "health": 1, + "grpc": "api.n00.testnet.vega.rocks:3007", + "rest": "https://api.n00.testnet.vega.rocks", + "graphql": "https://api.n00.testnet.vega.rocks/graphql" + }, + { + "name": "n06", + "status": "enabled", + "health": 1, + "grpc": "api.n06.testnet.vega.rocks:3007", + "rest": "https://api.n06.testnet.vega.rocks", + "graphql": "https://api.n06.testnet.vega.rocks/graphql" + }, + { + "name": "n07", + "status": "enabled", + "health": 1, + "grpc": "api.n07.testnet.vega.rocks:3007", + "rest": "https://api.n07.testnet.vega.rocks", + "graphql": "https://api.n07.testnet.vega.rocks/graphql" + }, + { + "name": "n08", + "status": "enabled", + "health": 1, + "grpc": "api.n08.testnet.vega.rocks:3007", + "rest": "https://api.n08.testnet.vega.rocks", + "graphql": "https://api.n08.testnet.vega.rocks/graphql" + } + ] +} diff --git a/data-nodes/mainnet.json b/data-nodes/mainnet.json new file mode 100644 index 0000000..6deebfc --- /dev/null +++ b/data-nodes/mainnet.json @@ -0,0 +1,87 @@ +{ + "name": "mainnet", + "chainid": "vega-mainnet-0011", + "testnet": false, + "nodes": [ + { + "name": "Commodum", + "status": "enabled", + "health": 1, + "grpc": "tls://vega-mainnet-data-grpc.commodum.io:443", + "rest": "https://vega-mainnet-data.commodum.io", + "graphql": "https://vega-mainnet-data.commodum.io/graphql" + }, + { + "name": "Nodes Guru", + "status": "enabled", + "health": 1, + "grpc": "vega-data.nodes.guru:3007", + "rest": "https://vega-data.nodes.guru:3008", + "graphql": "https://vega-data.nodes.guru:3008/graphql" + }, + { + "name": "BHarvest", + "status": "enabled", + "health": 1, + "grpc": "vega-data.bharvest.io:3007", + "rest": "https://vega-data.bharvest.io", + "graphql": "https://vega-data.bharvest.io/graphql" + }, + { + "name": "Path Rock Network", + "status": "enabled", + "health": 1, + "grpc": "datanode.vega.pathrocknetwork.org:3007", + "rest": "https://datanode.vega.pathrocknetwork.org", + "graphql": "https://datanode.vega.pathrocknetwork.org/graphql" + }, + { + "name": "Aurora Edge", + "status": "enabled", + "health": 1, + "grpc": "tls://vega-grpc.aurora-edge.com:443", + "rest": "https://vega.aurora-edge.com", + "graphql": "https://vega.aurora-edge.com/graphql" + }, + { + "name": "Darling", + "status": "enabled", + "health": 1, + "grpc": "darling.network:3007", + "rest": "https://darling.network", + "graphql": "https://darling.network/graphql" + }, + { + "name": "Velvet P2P", + "status": "enabled", + "health": 1, + "grpc": "tls://grpc.velvet.tm.p2p.org:443", + "rest": "https://rest.velvet.tm.p2p.org", + "grpahql": "https://gql.velvet.tm.p2p.org/graphql" + }, + { + "name": "Lovali", + "status": "enabled", + "health": 1, + "grpc": "vega-grpc.mainnet.lovali.xyz:3007", + "rest": "https://vega-rest.mainnet.lovali.xyz", + "graphql": "https://vega-query.mainnet.lovali.xyz/graphql" + }, + { + "name": "AnyValid", + "status": "enabled", + "health": 1, + "grpc": "vega-mainnet.anyvalid.com:3007", + "rest": "https://vega-mainnet.anyvalid.com", + "graphql": "https://vega-mainnet.anyvalid.com/graphql" + }, + { + "name": "Staking Cabin", + "status": "enabled", + "health": 1, + "grpc": "vega.mainnet.stakingcabin.com:3007", + "rest": "https://vega.mainnet.stakingcabin.com:3008", + "graphql": "https://vega.mainnet.stakingcabin.com:3008/query" + } + ] +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..4df73f8 --- /dev/null +++ b/makefile @@ -0,0 +1,14 @@ +# Set default to run all checks if none specified +.DEFAULT_GOAL := all + +all: spellcheck markdownlint + +# check the markdown formatting (/protocol specs only at this time) +.PHONY: markdownlint +markdownlint: + @./markdownlint.sh + +# check the markdown spelling (/protocol specs only at this time) +.PHONY: spellcheck +spellcheck: + @./spellcheck.sh \ No newline at end of file diff --git a/markdownlint.sh b/markdownlint.sh new file mode 100755 index 0000000..3e4dc28 --- /dev/null +++ b/markdownlint.sh @@ -0,0 +1,9 @@ +#!/bin/bash -x + +echo "Installing markdownlint-cli..." + +npm install -g markdownlint-cli --yes + +echo "Running markdownlint-cli..." + +markdownlint --ignore-path .github/workflows/config/markdownlintignore --config .github/workflows/config/markdownlint.json . \ No newline at end of file diff --git a/oracle-providers/README.md b/oracle-providers/README.md new file mode 100644 index 0000000..52131cf --- /dev/null +++ b/oracle-providers/README.md @@ -0,0 +1,145 @@ +# Vega Oracle Profiles + +This is a repository for maintaining data about well known entities to the Vega community. + +Oracle profiles are an optional, extra layer of information about oracles on the Vega network, including: + +- Oracle name +- Description +- URL +- [Proofs](#proofs), like verified social media accounts + +Oracle developers can use profiles to explain their methodology and demonstrate their reputation. + +Apps on the Vega network can include profiles to help users make decisions about markets. + +Profiles are also used to flag potential issues with oracles or reasons to doubt their legitimacy. + +## Disclaimer + +This repository is for data regarding oracles used in markets on the Vega trading platform. + +Anyone can contribute to it and no representations or warranties of any kind are made by any party about the accuracy of the information contained in it. + +## Quick start: creating an oracle profile + +Example oracle proof: + +``` +{ + "name": "Pyth Oracle", + "url": "https://pyth.network", + "description_markdown": "# The Pyth oracles contract\n\nPyth network provide many oracles prices.\n", + "oracle": { + "status": "GOOD", + "status_reason": "", + "first_verified": "2023-05-22T00:00:00.000Z", + "last_verified": "2023-05-22T00:00:00.000Z", + "type": "eth_address", + "eth_address": "0x2880ab155794e7179c9ee2e38200202908c17b43" + }, + "proofs": [ + { + "format": "url", + "available": true, + "type": "web", + "url": "https://gnosisscan.io/address/0x2880ab155794e7179c9ee2e38200202908c17b43#code" + } + ], + "github_link": "https://github.com/vegaprotocol/well-known/blob/main/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml" +} +``` + +1. Use the template above and fill in the desired oracle information +1. Add it to the oracle-proofs.json file (watch out for commas!) +1. Optional: Provide [proofs](#proofs) for social media accounts +1. Open a pull request and mark it as ready for review + +The Vega project team will review the contents of the pull requests and if able to verify the proofs contained therein will merge it. This does not constitute an endorsement of the oracle, and does not imply the community should trust it. All it demonstrates is that the proofs are independently verifiable and this verification could (and should) be repeated by individuals within the community. + +When merged, the details in the file may be shown alongside other oracle info in apps on the Vega network. + +## Submission guidelines + +### Public key + +The public key defined in the market proposal. + +As one key can act as an oracle for multiple markets, the oracle profile may be associated with more than one market. + +### Description + +The following markdown formatting is accepted: + +- Headings +- Links +- Bold +- Underline +- Italic +- Strike-through + +### Proofs + +Link to [signed messages](#how-to-sign-a-message) on websites and social media accounts to associate them with the oracle. Each proof is verified by a panel of repository admins. + +Oracle providers are welcome to submit any kind of proof. Common proofs include: + +- **Twitter**\ +Link to a tweet containing the Twitter username as a signed message +- **Website**\ +Link to a `.txt` file, at the website root, containing the website URL as a signed message +- **Discord**\ +Link to a comment in [the Vega Protocol Discord channel](https://discord.com/channels/720571334798737489/) containing the Discord username as a signed message +- **Vega forums**\ +Link to a comment in [the Vega forum](https://community.vega.xyz/) containing the forum username as a signed message +- **GitHub**\ +Link to a file in a GitHub repository containing the GitHub username as a signed message + + +## How to sign a message + +The keypair used to sign the message must match the public key in the oracle profile and market spec. + +### VEGA Desktop Wallet + +1. Open your Vega desktop wallet +2. Click the keypair you want to use +3. Enter your message in the text area +4. Click ‘sign’ +5. Click the signed message to copy it to your clipboard + +### VEGA CLI Wallet + +To generate a signed message using local wallet, run the following command: + +#### MacOS & Linux + +``` bash +./vegawallet sign --key ReplaceWithTheOraclePublicKey --wallet ReplaceWithTheWalletUsername --message ReplaceWithTheMessage +``` + +#### Windows + +``` bash +vegawallet sign --key ReplaceWithTheOraclePublicKey --wallet ReplaceWithTheWalletUsername --message ReplaceWithTheMessage +``` + +## Status + +Apps on the Vega network may choose to expose these statuses to users. + +| Flag | Description | +|:--|:--| +| Unknown | This public key's proofs have not been verified yet, or no proofs have been provided yet. | +| Good | This public key's proofs have been verified. | +| Suspicious | This public key is suspected to be acting in bad faith, pending investigation. | +| Malicious | This public key has been observed acting in bad faith. | +| Retired | This public key is no longer in use. | +| Compromised | This public key is no longer in the control of its original owners. | + + +## Help and issues + +If you need help creating an oracle profile, you can find it in [the Vega forum](https://community.vega.xyz/). + +You are also welcome to make suggestions or highlight problems by [raising an issue](https://github.com/vegaprotocol/well-known/issues/new). diff --git a/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml b/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml deleted file mode 100644 index beab914..0000000 --- a/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml +++ /dev/null @@ -1,23 +0,0 @@ -name = "Pyth Oracle" -url ="https://pyth.network" -description_markdown = """ -# The Pyth oracles contract - -Pyth network provide many oracles prices. -""" - -[oracle] -source_chain = "Ethereum" -source_chain_id = "1" -type = "eth_address" -eth_address= "0x2880ab155794e7179c9ee2e38200202908c17b43" -status = "GOOD" -status_reason = "" -first_verified = 2023-05-22T00:00:00Z -last_verified = 2023-05-22T00:00:00Z - -[[proofs]] -type = "web" -format = "url" -url = "https://gnosisscan.io/address/0x2880ab155794e7179c9ee2e38200202908c17b43#code" -available = true diff --git a/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml b/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml deleted file mode 100644 index 2894e31..0000000 --- a/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml +++ /dev/null @@ -1,23 +0,0 @@ -name = "Pyth rebased prices oracle" -url =" https://github.com/vegaprotocol/pyth-rebase-contract" -description_markdown = """ -# Pyth rebased prices oracle - -A simple contract providing prices from the pyth on chain oracles quoted in USDT -""" - -[oracle] -source_chain = "gnosis" -source_chain_id = "100" -type = "eth_address" -eth_address= "0x719abd606155442c21b7d561426d42bd0e40a776" -status = "GOOD" -status_reason = "" -first_verified = 2023-05-22T00:00:00Z -last_verified = 2023-05-22T00:00:00Z - -[[proofs]] -type = "web" -format = "url" -url = "https://gnosisscan.io/address/0x719abd606155442c21b7d561426d42bd0e40a776#code" -available = true diff --git a/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml b/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml deleted file mode 100644 index 3f93e84..0000000 --- a/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml +++ /dev/null @@ -1,23 +0,0 @@ -name = "Uniswap price sources" -url ="https://github.com/jeremyletang/uniswap_price_source" -description_markdown = """ -# Uniswap price source - -A smart contract providing prices from uniswap v3 pools -""" - -[oracle] -source_chain = "Ethereum" -source_chain_id = "1" -type = "eth_address" -eth_address= "0xBEDBC6302eAFFd4032Dd1DF94e326F7ecb9Ff4f9" -status = "GOOD" -status_reason = "" -first_verified = 2023-05-22T00:00:00Z -last_verified = 2023-05-22T00:00:00Z - -[[proofs]] -type = "web" -format = "url" -url = "https://etherscan.io/address/0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9#code" -available = true diff --git a/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml b/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml deleted file mode 100644 index aff29aa..0000000 --- a/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml +++ /dev/null @@ -1,23 +0,0 @@ -name = "Coinbase Oracle" -url ="https://coinbase.com" -description_markdown = """ -# Coinbase Oracle - -Coinbase is a leading cryptocurrency exchange that provides an API serving signed oracle data in OpenOracle format. See the [API documentation](https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcoinbasepriceoracle) for more details. - -_Note that although it remains supported, Coinbase Oracle appears relatively unmaintained. For example, it does not seem to gain support for new assets as they are listed on Coinbase and the docs no longer confirm the public key of the signer. The proof provided links to a prior version of the docs that confirms the key on archive.org and has been experimentally verified against the API results served at the time of this update._ -""" - -[oracle] -type = "eth_address" -eth_address= "0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC" -status = "GOOD" -status_reason = "" -first_verified = 2023-05-22T00:00:00Z -last_verified = 2023-05-22T00:00:00Z - -[[proofs]] -type = "web" -format = "url" -url = "https://web.archive.org/web/20200923175817/https://docs.pro.coinbase.com/#oracle" -available = true diff --git a/__generated__/oracle-proofs.json b/oracle-providers/oracle-proofs.json similarity index 100% rename from __generated__/oracle-proofs.json rename to oracle-providers/oracle-proofs.json diff --git a/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml b/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml deleted file mode 100644 index f35a3e9..0000000 --- a/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml +++ /dev/null @@ -1,48 +0,0 @@ -name = "Vega Admin Oracle for Testnet" -url ="https://fairground.wtf" -description_markdown = """ -The Vega Fairground admin oracle, uses a json file to settle based on Binance Spot price. -E.g. in case the market is BTC/USDC the spot price for BTC/USDC on Binance will be used. - -Twitter: @VegaFairground -""" - -[oracle] -type = "public_key" -public_key = "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f" -status = "GOOD" -status_reason = "" -first_verified = 2022-01-01T00:00:00Z -last_verified = 2022-12-31T00:00:00Z - -[[proofs]] -type = "twitter" -format = "url" -url = "https://twitter.com/vegaprotocol/status/956833487230730241" -available = true - -[[proofs]] -type = "web" -format = "url" -url = "https://fairground.wtf/" -available = true - -[[proofs]] -type = "github" -format = "url" -url = "https://github.com" -available = true - -[[proofs]] -type = "public_key" -format = "signed_message" -public_key = "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f" -message = "SOMEHEX" -available = true - -[[proofs]] -type = "eth_address" -format = "signed_message" -eth_address = "0x0b38D0e7391CF427d309991A110a84daF37114eF" -message = "SOMEHEX" -available = true \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index be31667..0000000 --- a/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "well-known", - "version": "1.0.0", - "repository": "git@github.com:vegaprotocol/well-known.git", - "author": "Matthew Russell ", - "license": "MIT", - "dependencies": { - "toml": "^3.0.0", - "zod": "^3.21.4" - }, - "scripts": { - "process": "node scripts/process-oracle-providers" - } -} diff --git a/scripts/process-oracle-providers.js b/scripts/process-oracle-providers.js deleted file mode 100644 index 28878c5..0000000 --- a/scripts/process-oracle-providers.js +++ /dev/null @@ -1,137 +0,0 @@ -const fs = require("fs"); -const path = require("path"); -const toml = require("toml"); -const z = require("zod"); - -const PROOFS_DIR = path.join(__dirname, "..", "oracle-providers"); -const OUTPUT_FILE = "oracle-proofs.json"; -const OUTPUT_DIR = path.join(__dirname, "..", "__generated__"); - -const STATUS = z.enum([ - "UNKNOWN", - "GOOD", - "SUSPICIOUS", - "MALICIOUS", - "RETIRED", - "COMPROMISED", -]); - -const BASE_PROOF_SCHEMA = z.object({ - format: z.enum(["url", "signed_message"]), - available: z.boolean(), -}); - -const ETH_ADDRESS_SCHEMA = z.string().regex(/^0x[a-fA-F0-9]{40}$/g); -const PUBLIC_KEY_SCHEMA = z.string().regex(/[a-fA-F0-9]{64}/g); - -const PROOF_SCHEMA = z.discriminatedUnion("type", [ - BASE_PROOF_SCHEMA.extend({ - type: z.literal("public_key"), - public_key: PUBLIC_KEY_SCHEMA, - message: z.string().min(1), - }), - BASE_PROOF_SCHEMA.extend({ - type: z.literal("eth_address"), - eth_address: ETH_ADDRESS_SCHEMA, - message: z.string().min(1), - }), - BASE_PROOF_SCHEMA.extend({ - type: z.literal("web"), - url: z.string().url(), - }), - BASE_PROOF_SCHEMA.extend({ - type: z.literal("github"), - url: z.string().url(), - }), - BASE_PROOF_SCHEMA.extend({ - type: z.literal("twitter"), - url: z.string().url(), - }), -]); - -const BASE_ORACLE_SCHEMA = z.object({ - status: STATUS, - status_reason: z.string(), - first_verified: z.date(), - last_verified: z.date(), -}); - -const ORACLE_SCHEMA = z.discriminatedUnion("type", [ - BASE_ORACLE_SCHEMA.extend({ - type: z.literal("public_key"), - public_key: PUBLIC_KEY_SCHEMA, - }), - BASE_ORACLE_SCHEMA.extend({ - type: z.literal("eth_address"), - eth_address: ETH_ADDRESS_SCHEMA, - }), -]); - -const PROVIDER_SCHEMA = z.object({ - name: z.string().min(1), - url: z.string().url(), - description_markdown: z.string(), - oracle: ORACLE_SCHEMA, - proofs: z.array(PROOF_SCHEMA).nonempty(), -}); - -function run() { - const result = []; - const proofFiles = fs.readdirSync(PROOFS_DIR); - - // Loop through each file in directory - proofFiles.forEach((file) => { - console.log("parsing", file); - const validityResult = isFileNameValid(file); - const warn = (msg) => console.warn(`${file}: ${msg}`); - - if (validityResult !== true) { - throw new Error(validityResult); - } - - const rawFile = fs.readFileSync(path.join(PROOFS_DIR, file), "utf8"); - const data = toml.parse(rawFile); - const validatedData = PROVIDER_SCHEMA.parse(data); - validatedData[ - "github_link" - ] = `https://github.com/vegaprotocol/well-known/blob/main/oracle-providers/${file}`; - - // Add to array which will be written to json file - result.push(validatedData); - }); - - // Make the output dir if it doesnt exist - if (!fs.existsSync(OUTPUT_DIR)) { - fs.mkdirSync(OUTPUT_DIR); - } - - fs.writeFile( - path.join(OUTPUT_DIR, OUTPUT_FILE), - JSON.stringify(result, null, 2), - (error) => { - if (error) { - throw new Error(`Failed to write ${OUTPUT_FILE}`); - } - } - ); -} - -function isFileNameValid(file) { - // Only use toml files - if (!file.endsWith(".toml")) { - return "invalid extension"; - } - - const fileWithoutExtension = file.replace(/\.toml$/, ""); - const [type, value] = fileWithoutExtension.split("-"); - - if (type === "public_key") { - PUBLIC_KEY_SCHEMA.parse(value); - } else if (type === "eth_address") { - ETH_ADDRESS_SCHEMA.parse(value); - } - - return true; -} - -run(); diff --git a/spellcheck.sh b/spellcheck.sh new file mode 100755 index 0000000..f8d3037 --- /dev/null +++ b/spellcheck.sh @@ -0,0 +1,17 @@ +#!/bin/bash -x + +echo "Installing pyspelling..." + +pip3 install pyspelling + +echo "Installing aspell..." + +brew install aspell + +echo "Running the spell checker..." + +python3 -m pyspelling --config spellcheck.yaml + +echo "Remove dictionary binary..." + +rm -r dictionary.dic \ No newline at end of file diff --git a/spellcheck.yaml b/spellcheck.yaml new file mode 100644 index 0000000..c0b0330 --- /dev/null +++ b/spellcheck.yaml @@ -0,0 +1,49 @@ +--- + + +matrix: + + - name: Markdown + sources: + - '**/*.md' + - 'README.md' + default_encoding: utf-8 + aspell: + d: en_GB + lang: en + ignore-case: true + dictionary: + encoding: utf-8 + # output: .pyspelling-custom-md-en.dic.tmp + wordlists: + - wordlist.txt + pipeline: + - pyspelling.filters.url: null + # Filters: https://github.com/facelessuser/pyspelling/tree/master/docs/src/markdown/filters + - pyspelling.filters.context: + context_visible_first: true + escapes: '\\[\\`]' + delimiters: + # Ignore multiline content between (possibly indented) triple backticks + - open: '(?s)^(?P---)' + close: '^(?P=open)$' + # Ignore multiline content between (possibly indented) triple backticks + - open: '(?s)^(?P[ ]*```)' + close: '^(?P=open)$' + # Ignore text between inline back ticks + - open: '`' + close: '`' + # Ignore hugo/jinja tags + - open: '{{' + close: '}}' + - pyspelling.filters.markdown: null + - pyspelling.filters.html: + comments: false + attributes: # to include + - alt + - title + ignores: + - a + - api-ref-button + - code + - pre \ No newline at end of file diff --git a/template.toml b/template.toml deleted file mode 100644 index 619b2f3..0000000 --- a/template.toml +++ /dev/null @@ -1,115 +0,0 @@ -# filename somrthing like: "${PUBKEY} ACME Oracle Co.toml" - -name = "Dan's Magic Oracle Co." -url ="https://zombo.com" -description_md = """ -Some markdown describing the oracle provider. - -Twitter: @FacesPics2 -""" - -[oracle] -type = "public_key | eth_address" -public_key = "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f" -status = "UNKNOWN|GOOD|SUSPICIOUS|MALICIOUS|RETIRED|COMPROMISED" -status_reason = "Some proofs currently offline" # char limit, allow limited Markdown eg links -first_verified = 2022-01-01T00:00:00Z -last_verified = 2022-12-31T00:00:00Z - -# Scenarios: -# - all verified proofs are now down: status = flagged -# - some verified proofs are now down: status = flagged? -# - verified proofs were down but now back: status = good -# - URL used to point to valid proof now points to something else or an invalid proof (because malicious or key change) -# - oralce provider changes their key - new file for v2, flag for v1, mark proofs unavailable if needed, update description -# - compromised key - - -[[proofs]] -type = "twitter" -format = "url" -url = "https://twitter.com/vegaprotocol/status/956833487230730241" -available = true - -[[proofs]] -type = "web" -format = "url" -url = "https://acme.io/proof.txt" -available = true - -[[proofs]] -type = "github" -format = "url" -url = "https://github.com/......." -available = true - -[[proofs]] -type = "public_key" -format = "signed_message" -public_key= "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f" -message = "SOMEHEX" -available = true - -[[proofs]] -type = "eth_address" -format = "signed_message" -eth_address = "addressA" -message = "SOMEHEX" -available = true - -[[proofs]] -type = "linkedin" -format = "url" -url = "https://linkedin.com/......." -available = true - -# etc... -# note a new proof type can be added that isn't checkable by any system -# the PR approver should be checking manually and documenting in the PR -# comments should be used if the proof isn't self explanatory - - -[data] -# In future a section like this could allow specifying a filter templates plus some variables -# and parameters to allow a UI to be presented to set up a good oracle spec. for the oracle - -VALID_TIMESTAMP_RANGE = 600 # allow data to be up to 10 mins after settlement date/time -SETTLEMENT_DATETIME = { input_type = "datetime" } -TICKER = { input_type = "list", values = ["LINK", "UNI", "ETH", "BTC"] } -# or TICKER = { input_type = "list", values_url = "https://acme.io/tickers.json" } - -[[data.filters]] -template = """ -{ - "key": { - "name": "prices.${TICKER}.value", - "type": "TYPE_INTEGER" - }, - "conditions": [ - { - "value": "0", - "operator": "OPERATOR_GREATER_THAN" - } - ] -} -""" - -[[data.filters]] -template = """ -{ - "key": { - "name": "prices.${TICKER}.timestamp", - "type": "TYPE_TIMESTAMP" - }, - "conditions": [ - { - "value": "${SETTLEMENT_DATETIME}", - "operator": "OPERATOR_GREATER_THAN" - }, - { - "value": "${SETTLEMENT_DATETIME + VALID_TIMESTAMP_RANGE}", - "operator": "OPERATOR_GREATER_THAN" - } - ] -} -""" diff --git a/wordlist.txt b/wordlist.txt new file mode 100644 index 0000000..da9d999 --- /dev/null +++ b/wordlist.txt @@ -0,0 +1,7 @@ +APIs +CLI +Ethereum +keypair +MacOS +readme +Strike-through \ No newline at end of file