Skip to content

Commit 011d302

Browse files
committed
add super-proof
1 parent 52a9c25 commit 011d302

File tree

8 files changed

+255
-0
lines changed

8 files changed

+255
-0
lines changed

docs/super-proof-docs/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Dispute-explorer
2+
3+
[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/)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Features
2+
3+
* **Game Search Capabilities** - look up dispute game by their dispute game contract address
4+
5+
6+
* **Dashboard** - Learn more about the metrics of dispute games and the challenge path of a particular game.View diverse charts and metrics.
7+
8+
9+
* **Dispute Game API** - dispute explorer API facilitates queries on games, their associated blocks and transactions, and relevant statistics and metrics.
10+
11+
12+
* **Open source** - dispute explorer is open-source and available to everyone. This project fit layer2 block chain which used dispute game with op stack.
13+
14+
15+
* **Easy deployment** - Check out our installation guide for a step-by-step walkthrough.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Run a Super proof node
2+
3+
import DocCardList from "@theme/DocCardList";
4+
5+
<DocCardList />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
2+
3+
# Installation
4+
5+
Super-proof is open source and you can run your own instance either locally or publically exposed on the Internet.
6+
7+
# Requirements
8+
9+
In order to run Super-proof you need a virtual machine with these minimum specs:
10+
11+
* 2 vCPU
12+
* 4 GB RAM
13+
* 100 GB Hard disk
14+
15+
Additionally you need to connect to an Ethereum node.
16+
17+
# Use docker to launch a backend node
18+
19+
You can refer to Super-proof [README.md](https://github.com/optimism-java/dispute-explorer/blob/main/README.md)
20+
21+
22+
23+
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Run a Super proof node
2+
3+
import DocCardList from "@theme/DocCardList";
4+
5+
<DocCardList />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
2+
3+
# Use docker
4+
5+
You can use Docker to run dispute explorer backend service [Dispute-explorer](https://github.com/optimism-java/dispute-explorer).
6+
7+
## Prerequisites
8+
9+
Download and install [Docker](https://www.docker.com/products/docker-desktop).
10+
11+
# Run Super-proof backend Step-by-Step
12+
13+
# Step 1. Config Environment file
14+
15+
```
16+
mv .env.template .evn
17+
```
18+
19+
```
20+
#log_format you can use console or json
21+
LOG_FORMAT=console
22+
23+
# config your mysql data source
24+
MYSQL_DATA_SOURCE=<data-source>
25+
26+
# config chain name to tag your block chain name
27+
BLOCKCHAIN=<block-chain-name>
28+
29+
# l1 rpc url example: eth json rpc url
30+
L1_RPC_URL=<l1-rpc>
31+
32+
RPC_RATE_LIMIT=15
33+
RPC_RATE_BURST=5
34+
35+
# the block number which before the first game has been created to make sure can not missing any game
36+
FROM_BLOCK_NUMBER=6034337
37+
38+
# FROM_BLOCK_NUMBER block hash
39+
FROM_BLOCK_HASH=0xafc3e42c5899591501d29649ffef0bfdec68f8d77e6d44ee00ef88cfb1a2f163
40+
41+
# the contract address of dispute game factory proxy
42+
DISPUTE_GAME_PROXY_CONTRACT=0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1
43+
44+
API_PORT=8080
45+
```
46+
47+
# Step 2. Start Dispute Game Explorer backend service
48+
49+
use docker-compose to run this service
50+
51+
```
52+
cd deploy
53+
docker-compose -f docker-compose.yml up -d
54+
```
55+
56+
Now, this project is running now.
57+
58+
Tip: if you just need a backend service to collect all data, Run Step 1 and Step 2.
59+
60+
# Step 3. Run meiliSearch
61+
62+
Run a meiliSearch service to sync MySql data for front service to search quickly
63+
64+
```
65+
cd deploy
66+
docker-compose -f docker-compose-meiliSearch.yml up -d meiliSearch
67+
```
68+
69+
Now, meiliSearch is running.
70+
71+
# Step 4. Run meiliSync
72+
73+
first, we need to find the api_key of meiliSearch
74+
75+
```
76+
curl -H "Authorization: Bearer <Token>" http://localhost:port/keys
77+
```
78+
79+
You should get a result, similar to :
80+
81+
```json
82+
{
83+
"results": [{
84+
"name": "Default Search API Key",
85+
"description": "Use it to search from the frontend",
86+
"key": "d09536ef1e2742b4792c607465dc169f659f1b2dcb0107bfdce2542b602ed534",
87+
"uid": "675ff658-9e73-460c-a3be-c6fcee624edf",
88+
"actions": ["search"],
89+
"indexes": ["*"],
90+
"expiresAt": null,
91+
"createdAt": "2024-08-06T08:47:38.225365511Z",
92+
"updatedAt": "2024-08-06T08:47:38.225365511Z"
93+
}, {
94+
"name": "Default Admin API Key",
95+
"description": "Use it for anything that is not a search operation. Caution! Do not expose it on a public frontend",
96+
"key": "abc40e8457b32aa86d20ab0db0b42a86298b253209c4c31d9936b378e686d132",
97+
"uid": "db1499f6-59a1-42c7-a13a-e18e191f456c",
98+
"actions": ["*"],
99+
"indexes": ["*"],
100+
"expiresAt": null,
101+
"createdAt": "2024-08-06T08:47:38.225052792Z",
102+
"updatedAt": "2024-08-06T08:47:38.225052792Z"
103+
}],
104+
"offset": 0,
105+
"limit": 20,
106+
"total": 2
107+
}
108+
```
109+
110+
And, use `Default Admin API Key`, `key` to update config.yml
111+
112+
```
113+
meilisearch:
114+
api_url: http://localhost:7701
115+
api_key: abc40e8457b32aa86d20ab0db0b42a86298b253209c4c31d9936b378e686d132
116+
```
117+
118+
launch the meiliSync service
119+
120+
```
121+
cd deploy
122+
docker-compose -f docker-compose-meiliSearch up -d meiliSync
123+
```
124+
125+
# Step 5. Validate meiliSync Service
126+
127+
We can visit meiliSearch api to validate meiliSync service. more [meiliSearch docs](https://www.meilisearch.com/docs/reference/api/overview)
128+
129+
```
130+
curl -H "Authorization: Bearer <Token>" http://localhost:port/indexes
131+
```
132+
133+
You should get a result, similar to :
134+
135+
```json
136+
{
137+
"results": [
138+
{
139+
"uid": "disputegame",
140+
"createdAt": "2024-08-06T09:24:24.640693956Z",
141+
"updatedAt": "2024-08-07T07:02:32.402360903Z",
142+
"primaryKey": "id"
143+
},
144+
{
145+
"uid": "gameclaim",
146+
"createdAt": "2024-08-06T09:24:24.670117944Z",
147+
"updatedAt": "2024-08-07T07:02:28.94487306Z",
148+
"primaryKey": "id"
149+
},
150+
{
151+
"uid": "gamecredit",
152+
"createdAt": "2024-08-06T10:37:42.013472322Z",
153+
"updatedAt": "2024-08-07T07:02:32.379350451Z",
154+
"primaryKey": "id"
155+
},
156+
{
157+
"uid": "syncevents",
158+
"createdAt": "2024-08-06T09:24:24.696318772Z",
159+
"updatedAt": "2024-08-07T07:02:30.382386632Z",
160+
"primaryKey": "id"
161+
}
162+
],
163+
"offset": 0,
164+
"limit": 20,
165+
"total": 4
166+
}
167+
```
168+
169+
If you get information like this, it means our deploy it`s success.

docusaurus.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ const config = {
108108
position: "left",
109109
label: "Op-Besu",
110110
},
111+
{
112+
type: "doc",
113+
docId: "super-proof-docs/index",
114+
position: "left",
115+
label: "Super-proof",
116+
},
111117
{
112118
href: "https://discord.gg/qHK3Vj4j",
113119
className: "header-discord-link",

sidebars.js

+28
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,34 @@ const sidebars = {
3434
],
3535
},
3636
],
37+
superProofSidebar: [
38+
"super-proof-docs/index",
39+
{
40+
type: "category",
41+
collapsed: true,
42+
label: "Introduction",
43+
link: {
44+
type: "doc",
45+
id: "super-proof-docs/introduction/index",
46+
},
47+
items: [
48+
"super-proof-docs/introduction/features",
49+
"super-proof-docs/introduction/installation",
50+
],
51+
},
52+
{
53+
type: "category",
54+
collapsed: true,
55+
label: "run a node",
56+
link: {
57+
type: "doc",
58+
id: "super-proof-docs/run-a-node/index",
59+
},
60+
items: [
61+
"super-proof-docs/run-a-node/use_docker",
62+
],
63+
},
64+
],
3765
};
3866

3967
module.exports = sidebars;

0 commit comments

Comments
 (0)