-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,184 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
debug: true | ||
plugins: | ||
- meilisync.plugin.Plugin | ||
progress: | ||
type: file | ||
source: | ||
type: mysql | ||
host: localhost | ||
port: 3366 | ||
user: root | ||
password: root | ||
database: dispute_explorer | ||
meilisearch: | ||
api_url: http://localhost:7700 | ||
api_key: 40185ac3f6804d9e0e08e158380b3f548b7c5b8a88bdb7b6608c82c0838a26d4 | ||
sync: | ||
- table: dispute_game | ||
index: disputegame | ||
plugins: | ||
- meilisync.plugin.Plugin | ||
full: true | ||
fields: | ||
id: | ||
sync_block_id: | ||
blockchain: | ||
block_time: | ||
block_number: | ||
block_hash: | ||
block_log_indexed: | ||
tx_index: | ||
tx_hash: | ||
contract_address: | ||
game_contract: | ||
game_type: | ||
l2_block_number: | ||
status: | ||
- table: game_claim_data | ||
index: gameclaim | ||
full: true | ||
fields: | ||
id: | ||
game_contract: | ||
data_index: | ||
parent_index: | ||
countered_by: | ||
claimant: | ||
bond: | ||
claim: | ||
position: | ||
clock: | ||
- table: game_credit | ||
index: gamecredit | ||
full: true | ||
fields: | ||
id: | ||
game_contract: | ||
address: | ||
credit: | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
Create Database If Not Exists dispute_explorer Character Set UTF8; | ||
USE dispute_explorer; | ||
|
||
SET NAMES utf8mb4; | ||
SET FOREIGN_KEY_CHECKS = 0; | ||
|
||
SET GLOBAL binlog_format = 'ROW'; | ||
|
||
-- ---------------------------- | ||
-- Table structure for sync_blocks | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS `sync_blocks`; | ||
CREATE TABLE `sync_blocks` | ||
( | ||
`id` bigint NOT NULL AUTO_INCREMENT, | ||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`blockchain` varchar(32) NOT NULL COMMENT ' chain name', | ||
`miner` varchar(42) NOT NULL COMMENT ' miner', | ||
`block_time` bigint NOT NULL COMMENT ' block_time', | ||
`block_number` bigint NOT NULL COMMENT ' block_number', | ||
`block_hash` varchar(66) NOT NULL COMMENT ' block hash', | ||
`tx_count` bigint NOT NULL COMMENT ' tx count', | ||
`event_count` bigint NOT NULL COMMENT ' event count', | ||
`parent_hash` varchar(66) NOT NULL COMMENT ' parent hash', | ||
`status` varchar(32) NOT NULL COMMENT ' status', | ||
`check_count` bigint NOT NULL COMMENT ' check count', | ||
PRIMARY KEY (`id`), | ||
KEY `status_index` (`status`), | ||
KEY `tx_count_index` (`tx_count`), | ||
KEY `check_count_index` (`check_count`) | ||
) ENGINE = InnoDB | ||
AUTO_INCREMENT = 2923365 | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
-- ---------------------------- | ||
-- Table structure for sync_events | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS `sync_events`; | ||
CREATE TABLE `sync_events` | ||
( | ||
`id` bigint NOT NULL AUTO_INCREMENT, | ||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`sync_block_id` bigint NOT NULL COMMENT ' sync_block_id', | ||
`blockchain` varchar(32) NOT NULL COMMENT ' blockchain', | ||
`block_time` bigint NOT NULL COMMENT ' block_time', | ||
`block_number` bigint NOT NULL COMMENT ' block_number', | ||
`block_hash` varchar(66) NOT NULL COMMENT ' block_hash', | ||
`block_log_indexed` bigint NOT NULL COMMENT ' block_log_indexed', | ||
`tx_index` bigint NOT NULL COMMENT ' tx_index', | ||
`tx_hash` varchar(66) NOT NULL COMMENT ' tx_hash', | ||
`event_name` varchar(32) NOT NULL COMMENT ' event_name', | ||
`event_hash` varchar(66) NOT NULL COMMENT ' event_hash', | ||
`contract_address` varchar(42) NOT NULL COMMENT ' contract_address', | ||
`data` json NOT NULL COMMENT ' data', | ||
`status` varchar(32) NOT NULL COMMENT ' status', | ||
`retry_count` bigint DEFAULT '0' COMMENT 'retry_count', | ||
PRIMARY KEY (`id`), | ||
KEY `status_index` (`status`) | ||
) ENGINE = InnoDB | ||
AUTO_INCREMENT = 1011299 | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
|
||
-- ---------------------------- | ||
-- Table structure for dispute_game | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS dispute_game; | ||
CREATE TABLE IF NOT EXISTS dispute_game | ||
( | ||
`id` bigint NOT NULL AUTO_INCREMENT, | ||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`sync_block_id` bigint NOT NULL COMMENT ' sync_block_id', | ||
`blockchain` varchar(32) NOT NULL COMMENT ' blockchain', | ||
`block_time` bigint NOT NULL COMMENT ' block_time', | ||
`block_number` bigint NOT NULL COMMENT ' block_number', | ||
`block_hash` varchar(66) NOT NULL COMMENT ' block_hash', | ||
`block_log_indexed` bigint NOT NULL COMMENT ' block_log_indexed', | ||
`tx_index` bigint NOT NULL COMMENT ' tx_index', | ||
`tx_hash` varchar(66) NOT NULL COMMENT ' tx_hash', | ||
`event_name` varchar(32) NOT NULL COMMENT ' event_name', | ||
`event_hash` varchar(66) NOT NULL COMMENT ' event_hash', | ||
`contract_address` varchar(42) NOT NULL COMMENT ' contract_address', | ||
`game_contract` varchar(42) NOT NULL, | ||
`game_type` int NOT NULL, | ||
`l2_block_number` bigint NOT NULL, | ||
`status` int NOT NULL, | ||
`computed` tinyint(1) NOT NULL DEFAULT 0 COMMENT ' 1-already get game credit 0- not yet', | ||
PRIMARY KEY (`id`), | ||
KEY `status_index` (`status`), | ||
KEY `dispute_game_index` (`contract_address`, `game_contract`) | ||
); | ||
|
||
-- ---------------------------- | ||
-- Table structure for game_claim_data | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS game_claim_data; | ||
CREATE TABLE IF NOT EXISTS game_claim_data | ||
( | ||
`id` bigint NOT NULL AUTO_INCREMENT, | ||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`game_contract` varchar(42) NOT NULL, | ||
`data_index` int NOT NULL, | ||
`parent_index` bigint NOT NULL, | ||
`countered_by` varchar(42) NOT NULL, | ||
`claimant` varchar(64) NOT NULL, | ||
`bond` bigint NOT NULL, | ||
`claim` varchar(64) NOT NULL, | ||
`position` bigint NOT NULL, | ||
`clock` bigint NOT NULL, | ||
PRIMARY KEY (`id`), | ||
KEY `credit_index` (`game_contract`, `data_index`) | ||
); | ||
|
||
-- ---------------------------- | ||
-- Table structure for game_credit | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS game_credit; | ||
CREATE TABLE IF NOT EXISTS game_credit | ||
( | ||
`id` bigint NOT NULL AUTO_INCREMENT, | ||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`game_contract` varchar(42) NOT NULL, | ||
`address` varchar(64) NOT NULL, | ||
`credit` numeric NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM postgres:15 | ||
|
||
RUN apt-get update &&\ | ||
apt-get -y install make && \ | ||
apt-get -y install gcc && \ | ||
apt-get -y install postgresql-15-wal2json && \ | ||
apt-get -y install postgresql-server-dev-15 wget && \ | ||
wget https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_2_6.tar.gz &&\ | ||
tar -zxf wal2json_2_6.tar.gz && \ | ||
cd wal2json-wal2json_2_6 && \ | ||
export PATH=/usr/lib/postgresql/14/bin:$PATH && \ | ||
make && make install |
Oops, something went wrong.