Skip to content

Commit f94b0c6

Browse files
committed
add readme
1 parent 9c429a2 commit f94b0c6

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

READ_REINDEX_SINGLE_CHAIN.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Overview
2+
3+
This guide provides instructions on how to clone a source PostgreSQL schema to a target schema, delete specific data for a given chain ID, and subsequently restart the indexer to reindex the removed chain.
4+
5+
## Prerequisites
6+
7+
1. **Node.js and npm installed** (to run the script and manage packages).
8+
2. **PostgreSQL installed and configured**.
9+
10+
## Configuration
11+
12+
Before running the script, ensure you have the following configurations in place:
13+
14+
**Database URL** in the `.env` file:
15+
16+
```
17+
DATABASE_URL=postgres://user:password@localhost:5432/your_database?sslmode=no-verify
18+
```
19+
20+
## Running the Script
21+
22+
1. **Make the script executable**:
23+
```bash
24+
chmod +x cloneSchemaAndCleanChain.sh
25+
```
26+
27+
2. **Run the script**:
28+
```bash
29+
./cloneSchemaAndCleanChain.sh
30+
```
31+
32+
You will be prompted to enter:
33+
- Source schema number
34+
- Target schema number
35+
- Chain ID to delete data for
36+
37+
Example:
38+
```bash
39+
Enter source schema number: 1
40+
Enter target schema number: 2
41+
Enter chain ID to delete data for: 1329
42+
```
43+
44+
## Reindexing the Chain
45+
46+
- Open `config.ts` and modify the configuration for the chain data to point to the new target schema.
47+
48+
- After the script has successfully cloned the schema and deleted the data for the specified chain ID, you can start the indexer as usual. The indexer will detect the missing data for the chain ID and begin reindexing it.

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type CoingeckoSupportedChainId =
2121
| 42220
2222
| 1088;
2323

24-
const CHAIN_DATA_VERSION = "91";
24+
const CHAIN_DATA_VERSION = "92";
2525
const IPFS_DATA_VERSION = "1";
2626
const PRICE_DATA_VERSION = "1";
2727

@@ -1502,7 +1502,7 @@ const CHAINS: Chain[] = [
15021502
.default("https://evm-rpc.sei-apis.com")
15031503
.parse(process.env.SEI_MAINNET_RPC_URL),
15041504
pricesFromTimestamp: Date.UTC(2024, 0, 1, 0, 0, 0),
1505-
maxGetLogsRange: 10000,
1505+
maxGetLogsRange: 1000,
15061506
tokens: [
15071507
{
15081508
code: "SEI",

0 commit comments

Comments
 (0)