From d5e65762b4333b47e5f91651b4ba4b3fa2ac7936 Mon Sep 17 00:00:00 2001 From: Momodu Afegbua Date: Sat, 24 Feb 2024 17:50:54 +0100 Subject: [PATCH] Update manifest file to include snapshots, change default ipfs gateway to pinata --- .env.example | 2 +- .gitignore | 1 + manifest.json | 34 ++++++++++++++++++++++------------ package.json | 2 +- scripts/manageSnapshots.sh | 3 +++ src/config/configuration.js | 4 ++-- 6 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.env.example b/.env.example index 4b010937..235ae2b8 100644 --- a/.env.example +++ b/.env.example @@ -25,7 +25,7 @@ HTTP_RPC_NODE= ## You can set the gateway URL of your own IPFS node in order to have data integrity verified ## (see https://docs.ipfs.io/concepts/content-addressing/) or use a public gateway you trust. ## If you have an IPFS node running locally, you may want to set this URL: http://localhost:8080/ipfs/ -#IPFS_GATEWAY="https://cloudflare-ipfs.com/ipfs/" +#IPFS_GATEWAY="https://gateway.pinata.cloud/ipfs//ipfs/" ## When syncing, the sentinel makes range queries to the RPC node in order to get all relevant log events. ## A larger value here results in fewer queries, but RPC nodes have varying max limits set. If this value exceeds that, queries will fail. diff --git a/.gitignore b/.gitignore index 1230487b..836ea2a6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ datadir/ .idea/ .vscode snapshots/ +logs/ coverage typechain networks diff --git a/manifest.json b/manifest.json index 189b65ac..413de36d 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,8 @@ "networks": { "1": { "name": "Ethereum", - "network_type": "evm" + "network_type": "evm", + "cid": "QmXTaEcw7sg72SYQP1g5obw3zC5YTHktPAyQCxt5VuWmCJ" }, "5": { "name": "Goerli Testnet", @@ -13,22 +14,26 @@ "10": { "name": "Optimism", "network_type": "evm-l2", - "batch_contract" : "0x84956C84c33c38AcE22C9324F1f92028AF2215ce" + "batch_contract": "0x84956C84c33c38AcE22C9324F1f92028AF2215ce", + "cid": "QmXS83mPhBuyPXQcX7ivfHeZ4BoNddMcHVySatUdU9TjWv" }, "56": { "name": "Binance Smart Chain", "network_type": "evm", - "batch_contract": "0x27636F8E129cdd4ccA0F30E2b4C116DDaC773bE5" + "batch_contract": "0x27636F8E129cdd4ccA0F30E2b4C116DDaC773bE5", + "cid": "QmeVZW3W93s1gSdPtohbWPiA244MmNaPUuaHyfSNWEbYMQ" }, "100": { "name": "Gnosis Chain", "network_type": "evm", - "batch_contract": "0x96C3C2d23d143301cF363a02cB7fe3596d2834d7" + "batch_contract": "0x96C3C2d23d143301cF363a02cB7fe3596d2834d7", + "cid": "QmTZ5XhAvKsJ8XW14hMKikKkpHFu1sxA5Cgi7zDpxo9Xub" }, "137": { "name": "Polygon", "network_type": "evm", - "batch_contract": "0xA7afDc46999076C295cfC6812dd73d103cF64e19" + "batch_contract": "0xA7afDc46999076C295cfC6812dd73d103cF64e19", + "cid": "Qmch2Bn1tdZ8JCA3Ss3EohyEMGqVK2JCq1zALHz3i9PMrs" }, "420": { "name": "Optimism Goerli Testnet", @@ -37,21 +42,24 @@ "8453": { "name": "Base Mainnet", "network_type": "evm-l2", - "batch_contract" : "0x6b008BAc0e5846cB5d9Ca02ca0e801fCbF88B6f9" + "batch_contract": "0x6b008BAc0e5846cB5d9Ca02ca0e801fCbF88B6f9" }, "42161": { "name": "Arbitrum One", "network_type": "evm-l2", - "batch_contract" : "0x9224413b9177E6c1D5721B4a4D1D00eC84B07Ce7" + "batch_contract": "0x9224413b9177E6c1D5721B4a4D1D00eC84B07Ce7", + "cid": "QmZ1WE2iBBj8WoSgPQmvMyPPuyR8pErhnvgNuqUuwWCjkX" }, "42220": { "name": "Celo", "network_type": "evm", - "batch_contract": "0xCb0Ff4D0cA186f0Fc0301258066Fe3fA258417a6" + "batch_contract": "0xCb0Ff4D0cA186f0Fc0301258066Fe3fA258417a6", + "cid": "QmewQVkxGLTcCLx6zuP4Q5q9QEywuzgoMLhKQANPSVaq2R" }, "43113": { "name": "Avalanche Fuji Testnet", - "network_type": "evm" + "network_type": "evm", + "cid": "QmWbR31s7dkZ3zoVGCMKm8nZxdgupdT45sUmRhXhj4CvCU" }, "43114": { "name": "Avalanche C-Chain", @@ -60,7 +68,8 @@ }, "80001": { "name": "Polygon Mumbai Testnet", - "network_type": "evm" + "network_type": "evm", + "cid": "QmV1MCLREr2DWczA6nvajxe1EfiGmTgT9PH2h2Qo1Zvfo7" }, "84531": { "name": "Base Goerli Testnet", @@ -76,11 +85,12 @@ }, "534352": { "name": "Scroll", - "network_type": "evm-l2" + "network_type": "evm-l2", + "cid": "QmfMKdvQagt9EJNx7rRy8XY3PyhAdcgyettpDMuAdYSF5q" }, "11155420": { "name": "Optimism Sepolia Testnet", "network_type": "evm-l2" } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index e5ce7c54..1bf8ecf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superfluid-sentinel", - "version": "1.0.0", + "version": "1.0.1", "description": "Superfluid Sentinel", "main": "main.js", "scripts": { diff --git a/scripts/manageSnapshots.sh b/scripts/manageSnapshots.sh index 556a7684..139c2185 100755 --- a/scripts/manageSnapshots.sh +++ b/scripts/manageSnapshots.sh @@ -27,6 +27,9 @@ generate_snapshot() { upload_snapshot() { echo "Uploading snapshots..." + if [ ! -d "logs" ]; then + mkdir logs + fi ipfs_logfile="logs/ipfs_$(date '+%Y-%m-%d').txt" rm -f -- "$ipfs_logfile" for file in ./snapshots/*.sqlite.gz; do diff --git a/src/config/configuration.js b/src/config/configuration.js index 702544fa..ded72f07 100644 --- a/src/config/configuration.js +++ b/src/config/configuration.js @@ -63,7 +63,7 @@ class Config { this.ONLY_LISTED_TOKENS = this._parseToBool(config.only_listed_tokens); this.TOGA_CONTRACT = config.toga_contract; this.FASTSYNC = config.fastsync !== "false"; - this.IPFS_GATEWAY = process.env.IPFS_GATEWAY || "https://cloudflare-ipfs.com/ipfs/" + this.IPFS_GATEWAY = process.env.IPFS_GATEWAY || "https://gateway.pinata.cloud/ipfs/" this.PIRATE = this._parseToBool(config.pirate); this.INSTANCE_NAME = config.INSTANCE_NAME || "Sentinel"; this.RPC_STUCK_THRESHOLD = config.rpc_stuck_threshold; @@ -90,7 +90,7 @@ class Config { this.METRICS = this._parseToBool(process.env.METRICS, true); this.METRICS_PORT = process.env.METRICS_PORT || 9100; this.FASTSYNC = this._parseToBool(process.env.FASTSYNC, true); - this.IPFS_GATEWAY = process.env.IPFS_GATEWAY || "https://cloudflare-ipfs.com/ipfs/"; + this.IPFS_GATEWAY = process.env.IPFS_GATEWAY || "https://gateway.pinata.cloud/ipfs/"; this.PIRATE = this._parseToBool(process.env.PIRATE, false); this.SLACK_WEBHOOK_URL = process.env.SLACK_WEBHOOK_URL; this.TELEGRAM_BOT_TOKEN = process.env.TELEGRAM_BOT_TOKEN;