From 011d302f9eb4e396cbe4f974955b46720872e466 Mon Sep 17 00:00:00 2001 From: zhouop0 <11733741+zhouop0@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:46:31 +0800 Subject: [PATCH 1/3] add super-proof --- docs/super-proof-docs/index.md | 3 + .../super-proof-docs/introduction/features.md | 15 ++ docs/super-proof-docs/introduction/index.mdx | 5 + .../introduction/installation.md | 24 +++ docs/super-proof-docs/run-a-node/index.mdx | 5 + .../super-proof-docs/run-a-node/use_docker.md | 169 ++++++++++++++++++ docusaurus.config.js | 6 + sidebars.js | 28 +++ 8 files changed, 255 insertions(+) create mode 100644 docs/super-proof-docs/index.md create mode 100644 docs/super-proof-docs/introduction/features.md create mode 100644 docs/super-proof-docs/introduction/index.mdx create mode 100644 docs/super-proof-docs/introduction/installation.md create mode 100644 docs/super-proof-docs/run-a-node/index.mdx create mode 100644 docs/super-proof-docs/run-a-node/use_docker.md diff --git a/docs/super-proof-docs/index.md b/docs/super-proof-docs/index.md new file mode 100644 index 0000000..8b76b90 --- /dev/null +++ b/docs/super-proof-docs/index.md @@ -0,0 +1,3 @@ +# Dispute-explorer + +[Dispute-explorer](https://github.com/optimism-java/dispute-explorer) This is a dispute explorer backend for collecting dispute games information who use [OP stack](https://stack.optimism.io/) diff --git a/docs/super-proof-docs/introduction/features.md b/docs/super-proof-docs/introduction/features.md new file mode 100644 index 0000000..9b43334 --- /dev/null +++ b/docs/super-proof-docs/introduction/features.md @@ -0,0 +1,15 @@ +# Features + +* **Game Search Capabilities** - look up dispute game by their dispute game contract address + + +* **Dashboard** - Learn more about the metrics of dispute games and the challenge path of a particular game.View diverse charts and metrics. + + +* **Dispute Game API** - dispute explorer API facilitates queries on games, their associated blocks and transactions, and relevant statistics and metrics. + + +* **Open source** - dispute explorer is open-source and available to everyone. This project fit layer2 block chain which used dispute game with op stack. + + +* **Easy deployment** - Check out our installation guide for a step-by-step walkthrough. \ No newline at end of file diff --git a/docs/super-proof-docs/introduction/index.mdx b/docs/super-proof-docs/introduction/index.mdx new file mode 100644 index 0000000..f5c0e6c --- /dev/null +++ b/docs/super-proof-docs/introduction/index.mdx @@ -0,0 +1,5 @@ +# Run a Super proof node + +import DocCardList from "@theme/DocCardList"; + + diff --git a/docs/super-proof-docs/introduction/installation.md b/docs/super-proof-docs/introduction/installation.md new file mode 100644 index 0000000..0d14c50 --- /dev/null +++ b/docs/super-proof-docs/introduction/installation.md @@ -0,0 +1,24 @@ +import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; + +# Installation + +Super-proof is open source and you can run your own instance either locally or publically exposed on the Internet. + +# Requirements + +In order to run Super-proof you need a virtual machine with these minimum specs: + +* 2 vCPU +* 4 GB RAM +* 100 GB Hard disk + +Additionally you need to connect to an Ethereum node. + +# Use docker to launch a backend node + +You can refer to Super-proof [README.md](https://github.com/optimism-java/dispute-explorer/blob/main/README.md) + + + + + diff --git a/docs/super-proof-docs/run-a-node/index.mdx b/docs/super-proof-docs/run-a-node/index.mdx new file mode 100644 index 0000000..f5c0e6c --- /dev/null +++ b/docs/super-proof-docs/run-a-node/index.mdx @@ -0,0 +1,5 @@ +# Run a Super proof node + +import DocCardList from "@theme/DocCardList"; + + diff --git a/docs/super-proof-docs/run-a-node/use_docker.md b/docs/super-proof-docs/run-a-node/use_docker.md new file mode 100644 index 0000000..adc6b0f --- /dev/null +++ b/docs/super-proof-docs/run-a-node/use_docker.md @@ -0,0 +1,169 @@ +import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; + +# Use docker + +You can use Docker to run dispute explorer backend service [Dispute-explorer](https://github.com/optimism-java/dispute-explorer). + +## Prerequisites + +Download and install [Docker](https://www.docker.com/products/docker-desktop). + +# Run Super-proof backend Step-by-Step + +# Step 1. Config Environment file + +``` +mv .env.template .evn +``` + +``` +#log_format you can use console or json +LOG_FORMAT=console + +# config your mysql data source +MYSQL_DATA_SOURCE= + +# config chain name to tag your block chain name +BLOCKCHAIN= + +# l1 rpc url example: eth json rpc url +L1_RPC_URL= + +RPC_RATE_LIMIT=15 +RPC_RATE_BURST=5 + +# the block number which before the first game has been created to make sure can not missing any game +FROM_BLOCK_NUMBER=6034337 + +# FROM_BLOCK_NUMBER block hash +FROM_BLOCK_HASH=0xafc3e42c5899591501d29649ffef0bfdec68f8d77e6d44ee00ef88cfb1a2f163 + +# the contract address of dispute game factory proxy +DISPUTE_GAME_PROXY_CONTRACT=0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1 + +API_PORT=8080 +``` + +# Step 2. Start Dispute Game Explorer backend service + +use docker-compose to run this service + +``` +cd deploy +docker-compose -f docker-compose.yml up -d +``` + +Now, this project is running now. + +Tip: if you just need a backend service to collect all data, Run Step 1 and Step 2. + +# Step 3. Run meiliSearch + +Run a meiliSearch service to sync MySql data for front service to search quickly + +``` +cd deploy +docker-compose -f docker-compose-meiliSearch.yml up -d meiliSearch +``` + +Now, meiliSearch is running. + +# Step 4. Run meiliSync + +first, we need to find the api_key of meiliSearch + +``` +curl -H "Authorization: Bearer " http://localhost:port/keys +``` + +You should get a result, similar to : + +```json +{ + "results": [{ + "name": "Default Search API Key", + "description": "Use it to search from the frontend", + "key": "d09536ef1e2742b4792c607465dc169f659f1b2dcb0107bfdce2542b602ed534", + "uid": "675ff658-9e73-460c-a3be-c6fcee624edf", + "actions": ["search"], + "indexes": ["*"], + "expiresAt": null, + "createdAt": "2024-08-06T08:47:38.225365511Z", + "updatedAt": "2024-08-06T08:47:38.225365511Z" + }, { + "name": "Default Admin API Key", + "description": "Use it for anything that is not a search operation. Caution! Do not expose it on a public frontend", + "key": "abc40e8457b32aa86d20ab0db0b42a86298b253209c4c31d9936b378e686d132", + "uid": "db1499f6-59a1-42c7-a13a-e18e191f456c", + "actions": ["*"], + "indexes": ["*"], + "expiresAt": null, + "createdAt": "2024-08-06T08:47:38.225052792Z", + "updatedAt": "2024-08-06T08:47:38.225052792Z" + }], + "offset": 0, + "limit": 20, + "total": 2 +} +``` + +And, use `Default Admin API Key`, `key` to update config.yml + +``` +meilisearch: + api_url: http://localhost:7701 + api_key: abc40e8457b32aa86d20ab0db0b42a86298b253209c4c31d9936b378e686d132 +``` + +launch the meiliSync service + +``` +cd deploy +docker-compose -f docker-compose-meiliSearch up -d meiliSync +``` + +# Step 5. Validate meiliSync Service + +We can visit meiliSearch api to validate meiliSync service. more [meiliSearch docs](https://www.meilisearch.com/docs/reference/api/overview) + +``` +curl -H "Authorization: Bearer " http://localhost:port/indexes +``` + +You should get a result, similar to : + +```json +{ + "results": [ + { + "uid": "disputegame", + "createdAt": "2024-08-06T09:24:24.640693956Z", + "updatedAt": "2024-08-07T07:02:32.402360903Z", + "primaryKey": "id" + }, + { + "uid": "gameclaim", + "createdAt": "2024-08-06T09:24:24.670117944Z", + "updatedAt": "2024-08-07T07:02:28.94487306Z", + "primaryKey": "id" + }, + { + "uid": "gamecredit", + "createdAt": "2024-08-06T10:37:42.013472322Z", + "updatedAt": "2024-08-07T07:02:32.379350451Z", + "primaryKey": "id" + }, + { + "uid": "syncevents", + "createdAt": "2024-08-06T09:24:24.696318772Z", + "updatedAt": "2024-08-07T07:02:30.382386632Z", + "primaryKey": "id" + } + ], + "offset": 0, + "limit": 20, + "total": 4 +} +``` + +If you get information like this, it means our deploy it`s success. diff --git a/docusaurus.config.js b/docusaurus.config.js index 39ebf2a..b6253e0 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -108,6 +108,12 @@ const config = { position: "left", label: "Op-Besu", }, + { + type: "doc", + docId: "super-proof-docs/index", + position: "left", + label: "Super-proof", + }, { href: "https://discord.gg/qHK3Vj4j", className: "header-discord-link", diff --git a/sidebars.js b/sidebars.js index ded67bf..8c81147 100644 --- a/sidebars.js +++ b/sidebars.js @@ -34,6 +34,34 @@ const sidebars = { ], }, ], + superProofSidebar: [ + "super-proof-docs/index", + { + type: "category", + collapsed: true, + label: "Introduction", + link: { + type: "doc", + id: "super-proof-docs/introduction/index", + }, + items: [ + "super-proof-docs/introduction/features", + "super-proof-docs/introduction/installation", + ], + }, + { + type: "category", + collapsed: true, + label: "run a node", + link: { + type: "doc", + id: "super-proof-docs/run-a-node/index", + }, + items: [ + "super-proof-docs/run-a-node/use_docker", + ], + }, + ], }; module.exports = sidebars; From 41184d7f5d48b4626752ac9c96993e12105cb22a Mon Sep 17 00:00:00 2001 From: zhouop0 <11733741+zhouop0@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:51:11 +0800 Subject: [PATCH 2/3] format --- .cspell.json | 4 +++- docs/super-proof-docs/introduction/installation.md | 2 +- docusaurus.config.js | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.cspell.json b/.cspell.json index 696090c..9d6abbf 100644 --- a/.cspell.json +++ b/.cspell.json @@ -66,6 +66,8 @@ "\\/img\\/socialCards\\/[\\w-]+\\.jpg" ], "ignoreWords": [ - "Hildr" + "Hildr", + "meili", + "Linea" ] } diff --git a/docs/super-proof-docs/introduction/installation.md b/docs/super-proof-docs/introduction/installation.md index 0d14c50..d902795 100644 --- a/docs/super-proof-docs/introduction/installation.md +++ b/docs/super-proof-docs/introduction/installation.md @@ -2,7 +2,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; # Installation -Super-proof is open source and you can run your own instance either locally or publically exposed on the Internet. +Super-proof is open source and you can run your own instance either locally or publicly exposed on the Internet. # Requirements diff --git a/docusaurus.config.js b/docusaurus.config.js index b6253e0..d431315 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -180,9 +180,7 @@ const config = { "python", ], }, - metadata: [ - { name: "twitter:card", content: "summary_large_image" } - ], + metadata: [{ name: "twitter:card", content: "summary_large_image" }], languageTabs: [ { highlight: "bash", From c504af379724500324ccec213cafbe798efcc0c8 Mon Sep 17 00:00:00 2001 From: zhouop0 <11733741+zhouop0@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:16:12 +0800 Subject: [PATCH 3/3] format --- docs/super-proof-docs/{run-a-node => deployment}/index.mdx | 0 .../{run-a-node => deployment}/use_docker.md | 0 docs/super-proof-docs/index.md | 4 ++-- sidebars.js | 6 +++--- 4 files changed, 5 insertions(+), 5 deletions(-) rename docs/super-proof-docs/{run-a-node => deployment}/index.mdx (100%) rename docs/super-proof-docs/{run-a-node => deployment}/use_docker.md (100%) diff --git a/docs/super-proof-docs/run-a-node/index.mdx b/docs/super-proof-docs/deployment/index.mdx similarity index 100% rename from docs/super-proof-docs/run-a-node/index.mdx rename to docs/super-proof-docs/deployment/index.mdx diff --git a/docs/super-proof-docs/run-a-node/use_docker.md b/docs/super-proof-docs/deployment/use_docker.md similarity index 100% rename from docs/super-proof-docs/run-a-node/use_docker.md rename to docs/super-proof-docs/deployment/use_docker.md diff --git a/docs/super-proof-docs/index.md b/docs/super-proof-docs/index.md index 8b76b90..90902a6 100644 --- a/docs/super-proof-docs/index.md +++ b/docs/super-proof-docs/index.md @@ -1,3 +1,3 @@ -# Dispute-explorer +# Super proof -[Dispute-explorer](https://github.com/optimism-java/dispute-explorer) This is a dispute explorer backend for collecting dispute games information who use [OP stack](https://stack.optimism.io/) +[Super proof](https://github.com/optimism-java/dispute-explorer) This is a Super proof backend for collecting dispute games information who use [OP stack](https://stack.optimism.io/) diff --git a/sidebars.js b/sidebars.js index 8c81147..cb36314 100644 --- a/sidebars.js +++ b/sidebars.js @@ -52,13 +52,13 @@ const sidebars = { { type: "category", collapsed: true, - label: "run a node", + label: "deployment", link: { type: "doc", - id: "super-proof-docs/run-a-node/index", + id: "super-proof-docs/deployment/index", }, items: [ - "super-proof-docs/run-a-node/use_docker", + "super-proof-docs/deployment/use_docker", ], }, ],