Skip to content

Commit 23d0281

Browse files
authored
Revert "improvments for GG (#662)" for assesing index 24h (#690)
Revert "improvments for GG (#662)" This reverts commit 311400f.
1 parent 43ff8de commit 23d0281

File tree

12 files changed

+88
-638
lines changed

12 files changed

+88
-638
lines changed

.env.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ DD_ENV=development
4747
#GNOSIS_RPC_URL
4848

4949
#COINGECKO_API_KEY=
50-
#IPFS_GATEWAYs=[]
51-
#WHITELISTED_ADDRESSES=["0x123..","0x456.."]
50+
#IPFS_GATEWAY=
5251

5352
# optional, enable the Postgraphile Pro plugin: https://www.npmjs.com/package/@graphile/pro
5453
#GRAPHILE_LICENSE

docs/reindexing.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ When deploying changes to the indexer, it's important to clarify the results you
1212
- The indexer will create a new schema in Postgres named `chain_data_${version}`. If this schema does not exist, it will be created, all necessary tables will be set up, and indexing will start from scratch.
1313
- If the schema already exists, the indexer will resume indexing from the last indexed block unless the `--drop-db` flag is specified via the CLI. This will drop the existing database and start fresh.
1414

15-
### Dropping Schemas in Development
15+
### Using `--drop-db` in Development
1616

17-
- During development, you can use the `--drop-db` flag to ensure the indexer always deletes all existing schema and migrates from scratch. This can be useful for testing schema changes and event handler modifications without retaining old data.
18-
19-
- During development, you can use the `--drop-chain-db` flag to ensure the indexer always deletes chain schema and migrates from scratch.
20-
21-
- During development, you can use the `--drop-ipfs-db` flag to ensure the indexer always deletes ipfs schema and migrates from scratch.
22-
23-
- During development, you can use the `--drop-price-db` flag to ensure the indexer always deletes price schema and migrates from scratch.
17+
- During development, you can use the `--drop-db` flag to ensure the indexer always deletes the existing schema and migrates from scratch. This can be useful for testing schema changes and event handler modifications without retaining old data.
2418

2519
### Important Notes
2620

indexer-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
ENABLE_RESOURCE_MONITOR: ${ENABLE_RESOURCE_MONITOR}
2121
ESTIMATES_LINEARQF_WORKER_POOL_SIZE: ${ESTIMATES_LINEARQF_WORKER_POOL_SIZE}
2222
PINO_PRETTY: ${PINO_PRETTY}
23-
IPFS_GATEWAYS: ${IPFS_GATEWAYS}
23+
IPFS_GATEWAY: ${IPFS_GATEWAY}
2424
COINGECKO_API_KEY: ${COINGECKO_API_KEY}
2525
GRAPHILE_LICENSE: ${GRAPHILE_LICENSE}
2626
SEPOLIA_RPC_URL: ${SEPOLIA_RPC_URL}
@@ -62,7 +62,7 @@ services:
6262
ENABLE_RESOURCE_MONITOR: ${ENABLE_RESOURCE_MONITOR}
6363
ESTIMATES_LINEARQF_WORKER_POOL_SIZE: ${ESTIMATES_LINEARQF_WORKER_POOL_SIZE}
6464
PINO_PRETTY: ${PINO_PRETTY}
65-
IPFS_GATEWAYS: ${IPFS_GATEWAYS}
65+
IPFS_GATEWAY: ${IPFS_GATEWAY}
6666
COINGECKO_API_KEY: ${COINGECKO_API_KEY}
6767
GRAPHILE_LICENSE: ${GRAPHILE_LICENSE}
6868
SEPOLIA_RPC_URL: ${SEPOLIA_RPC_URL}

src/config.ts

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

24-
const CHAIN_DATA_VERSION = "86";
25-
const IPFS_DATA_VERSION = "1";
26-
const PRICE_DATA_VERSION = "1";
24+
const CHAIN_DATA_VERSION = "000999";
2725

2826
export type Token = {
2927
code: string;
@@ -1883,7 +1881,7 @@ export type Config = {
18831881
httpServerWaitForSync: boolean;
18841882
httpServerEnabled: boolean;
18851883
indexerEnabled: boolean;
1886-
ipfsGateways: string[];
1884+
ipfsGateway: string;
18871885
coingeckoApiKey: string | null;
18881886
coingeckoApiUrl: string;
18891887
chains: Chain[];
@@ -1894,18 +1892,11 @@ export type Config = {
18941892
readOnlyDatabaseUrl: string;
18951893
dataVersion: string;
18961894
databaseSchemaName: string;
1897-
ipfsDataVersion: string;
1898-
ipfsDatabaseSchemaName: string;
1899-
priceDataVersion: string;
1900-
priceDatabaseSchemaName: string;
19011895
hostname: string;
19021896
pinoPretty: boolean;
19031897
deploymentEnvironment: "local" | "development" | "staging" | "production";
19041898
enableResourceMonitor: boolean;
19051899
dropDb: boolean;
1906-
dropChainDb: boolean;
1907-
dropIpfsDb: boolean;
1908-
dropPriceDb: boolean;
19091900
removeCache: boolean;
19101901
estimatesLinearQfWorkerPoolSize: number | null;
19111902
};
@@ -1919,18 +1910,9 @@ export function getConfig(): Config {
19191910
"from-block": {
19201911
type: "string",
19211912
},
1922-
"drop-chain-db": {
1923-
type: "boolean",
1924-
},
1925-
"drop-ipfs-db": {
1926-
type: "boolean",
1927-
},
19281913
"drop-db": {
19291914
type: "boolean",
19301915
},
1931-
"drop-price-db": {
1932-
type: "boolean",
1933-
},
19341916
"rm-cache": {
19351917
type: "boolean",
19361918
},
@@ -2062,11 +2044,10 @@ export function getConfig(): Config {
20622044

20632045
const runOnce = z.boolean().default(false).parse(args["run-once"]);
20642046

2065-
const ipfsGateways = z
2047+
const ipfsGateway = z
20662048
.string()
2067-
.array()
2068-
.default(["https://ipfs.io"])
2069-
.parse(JSON.parse(process.env.IPFS_GATEWAYS!));
2049+
.default("https://ipfs.io")
2050+
.parse(process.env.IPFS_GATEWAY);
20702051

20712052
const sentryDsn = z
20722053
.union([z.string(), z.null()])
@@ -2083,16 +2064,7 @@ export function getConfig(): Config {
20832064
const dataVersion = CHAIN_DATA_VERSION;
20842065
const databaseSchemaName = `chain_data_${dataVersion}`;
20852066

2086-
const ipfsDataVersion = IPFS_DATA_VERSION;
2087-
const ipfsDatabaseSchemaName = `ipfs_data_${ipfsDataVersion}`;
2088-
2089-
const priceDataVersion = PRICE_DATA_VERSION;
2090-
const priceDatabaseSchemaName = `price_data_${priceDataVersion}`;
2091-
20922067
const dropDb = z.boolean().default(false).parse(args["drop-db"]);
2093-
const dropChainDb = z.boolean().default(false).parse(args["drop-chain-db"]);
2094-
const dropIpfsDb = z.boolean().default(false).parse(args["drop-ipfs-db"]);
2095-
const dropPriceDb = z.boolean().default(false).parse(args["drop-price-db"]);
20962068

20972069
const removeCache = z.boolean().default(false).parse(args["rm-cache"]);
20982070

@@ -2132,7 +2104,7 @@ export function getConfig(): Config {
21322104
cacheDir,
21332105
logLevel,
21342106
runOnce,
2135-
ipfsGateways,
2107+
ipfsGateway,
21362108
passportScorerId,
21372109
apiHttpPort,
21382110
pinoPretty,
@@ -2141,16 +2113,9 @@ export function getConfig(): Config {
21412113
databaseUrl,
21422114
readOnlyDatabaseUrl,
21432115
dropDb,
2144-
dropChainDb,
2145-
dropIpfsDb,
2146-
dropPriceDb,
21472116
removeCache,
21482117
dataVersion,
21492118
databaseSchemaName,
2150-
ipfsDataVersion,
2151-
ipfsDatabaseSchemaName,
2152-
priceDataVersion,
2153-
priceDatabaseSchemaName,
21542119
httpServerWaitForSync,
21552120
httpServerEnabled,
21562121
indexerEnabled,

src/database/changeset.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
NewPrice,
1717
NewLegacyProject,
1818
NewApplicationPayout,
19-
NewIpfsData,
2019
NewAttestationData,
2120
} from "./schema.js";
2221

@@ -143,10 +142,6 @@ export type DataChange =
143142
type: "InsertApplicationPayout";
144143
payout: NewApplicationPayout;
145144
}
146-
| {
147-
type: "InsertIpfsData";
148-
ipfs: NewIpfsData;
149-
}
150145
| {
151146
type: "InsertAttestation";
152147
attestation: NewAttestationData;

0 commit comments

Comments
 (0)