diff --git a/contracts/.env.example b/contracts/.env.example index 66f5e7427..d34f7346b 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -19,6 +19,7 @@ LOGTAIL_TOKEN_RELAYER_BOT=41h8q5Z4gnz5yDx215eqcQ4r LOGTAIL_TOKEN_DISPUTOR_BOT=mSryyvYubviaMqKDWfBKAGsi HEARTBEAT_URL_KEEPER_BOT=https://uptime.betterstack.com/api/v1/heartbeat/jc23S8ZZzpf8KbzwxL1hoBp9 HEARTBEAT_URL_RELAYER_BOT=https://uptime.betterstack.com/api/v1/heartbeat/eT6Trk6CddJV6fFBbqZNzyqC +SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" DISPUTES_TO_SKIP= # Optionally for debugging diff --git a/contracts/scripts/shutter.ts b/contracts/scripts/shutter.ts index a1c05e1c3..18d68e48f 100644 --- a/contracts/scripts/shutter.ts +++ b/contracts/scripts/shutter.ts @@ -1,8 +1,10 @@ +import env from "./utils/env"; import { encryptData, decrypt as shutterDecrypt } from "@shutter-network/shutter-sdk"; import { Hex, stringToHex, hexToString } from "viem"; import crypto from "crypto"; import "isomorphic-fetch"; +const SHUTTER_API = env.optionalNoDefault("SHUTTER_API"); // Time in seconds to wait before the message can be decrypted export const DECRYPTION_DELAY = 5; @@ -38,7 +40,7 @@ async function fetchShutterData(decryptionTimestamp: number): Promise { console.log(`Fetching decryption key for identity: ${identity}`); - const response = await fetch(`https://shutter-api.shutter.network/api/get_decryption_key?identity=${identity}`, { + const response = await fetch(`${SHUTTER_API}/get_decryption_key?identity=${identity}`, { method: "GET", headers: { accept: "application/json", diff --git a/web/.env.devnet-neo.public b/web/.env.devnet-neo.public index 0883348ef..c668f6cea 100644 --- a/web/.env.devnet-neo.public +++ b/web/.env.devnet-neo.public @@ -9,3 +9,4 @@ export REACT_APP_ATLAS_URI=http://localhost:3000 export WALLETCONNECT_PROJECT_ID= export ALCHEMY_API_KEY= export NODE_OPTIONS='--max-old-space-size=7680' +export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" diff --git a/web/.env.devnet-university.public b/web/.env.devnet-university.public index f1cf57f76..3eccb65f7 100644 --- a/web/.env.devnet-university.public +++ b/web/.env.devnet-university.public @@ -8,6 +8,7 @@ export REACT_APP_ATLAS_URI=http://localhost:3000 export WALLETCONNECT_PROJECT_ID= export ALCHEMY_API_KEY= export NODE_OPTIONS='--max-old-space-size=7680' +export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" # devtools export REACT_APP_GRAPH_API_KEY= \ No newline at end of file diff --git a/web/.env.devnet.public b/web/.env.devnet.public index 15cb7c81b..975ffa68b 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -7,5 +7,6 @@ export REACT_APP_ATLAS_URI=http://localhost:3000 export REACT_APP_DEVTOOLS_URL=https://dev--kleros-v2-testnet-devtools.netlify.app export NODE_OPTIONS='--max-old-space-size=7680' export REACT_APP_SPAM_EVIDENCES_IDS="0-2,3-1" +export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" # devtools export REACT_APP_GRAPH_API_KEY= diff --git a/web/.env.local.public b/web/.env.local.public index a41935879..e1c15b8bc 100644 --- a/web/.env.local.public +++ b/web/.env.local.public @@ -6,6 +6,7 @@ export REACT_APP_ATLAS_URI=http://localhost:3000 export WALLETCONNECT_PROJECT_ID= export ALCHEMY_API_KEY= export NODE_OPTIONS='--max-old-space-size=7680' +export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" # devtools export REACT_APP_GRAPH_API_KEY= \ No newline at end of file diff --git a/web/.env.mainnet-neo.public b/web/.env.mainnet-neo.public index a2aa0f93f..c3028e2d5 100644 --- a/web/.env.mainnet-neo.public +++ b/web/.env.mainnet-neo.public @@ -8,4 +8,5 @@ export REACT_APP_ARBITRATOR_TYPE=neo export REACT_APP_ATLAS_URI=http://localhost:3000 export WALLETCONNECT_PROJECT_ID= export ALCHEMY_API_KEY= -export NODE_OPTIONS='--max-old-space-size=7680' \ No newline at end of file +export NODE_OPTIONS='--max-old-space-size=7680' +export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" \ No newline at end of file diff --git a/web/.env.testnet.public b/web/.env.testnet.public index 96e7381ec..4d19e7c2a 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -8,5 +8,6 @@ export REACT_APP_DEVTOOLS_URL=https://devtools.v2-testnet.kleros.builders export WALLETCONNECT_PROJECT_ID= export ALCHEMY_API_KEY= export NODE_OPTIONS='--max-old-space-size=7680' +export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api" # devtools export REACT_APP_GRAPH_API_KEY= \ No newline at end of file diff --git a/web/src/utils/shutter.ts b/web/src/utils/shutter.ts index 8d8611481..52238739c 100644 --- a/web/src/utils/shutter.ts +++ b/web/src/utils/shutter.ts @@ -30,7 +30,7 @@ async function fetchShutterData(decryptionTimestamp: number): Promise { - const response = await fetch(`https://shutter-api.shutter.network/api/get_decryption_key?identity=${identity}`, { + const response = await fetch(`${import.meta.env.REACT_APP_SHUTTER_API}/get_decryption_key?identity=${identity}`, { method: "GET", headers: { accept: "application/json",