diff --git a/.env.mainnet b/.env.mainnet index d63719f..03d6a24 100644 --- a/.env.mainnet +++ b/.env.mainnet @@ -5,6 +5,4 @@ VITE_GRAPH_URI = https://api.thegraph.com/subgraphs/name/geo-web-project/geo-web VITE_ANNUALRATE = 0.1 VITE_IPFS_GATEWAY = https://ipfs.io VITE_IPFS_DELEGATE = "/dns4/ceramic.geoweb.network/tcp/443/https" -VITE_WS_RPC_URL=wss://opt.mainnet.g.alchemy.com/v2/Y4RuzHDAmcqDnO6iqLcfwDzmbTk4xHob -VITE_HTTP_RPC_URL=https://opt.mainnet.g.alchemy.com/v2/Y4RuzHDAmcqDnO6iqLcfwDzmbTk4xHob VITE_LIVEPEER_API_KEY=8cdf71bd-3f27-46e8-991b-411a0f75b91f diff --git a/.env.testnet b/.env.testnet index a3e1a2f..5693886 100644 --- a/.env.testnet +++ b/.env.testnet @@ -1,10 +1,7 @@ -VITE_NETWORK_ID = 420 -VITE_WORLD_ADDRESS = 0x3904285496739BF5030d79C0CF259A569806F759 -VITE_WORLD_BLOCK_NUMBER = 17280426 -VITE_GRAPH_URI = https://api.thegraph.com/subgraphs/name/geo-web-project/geo-web-testnet +VITE_NETWORK_ID = 11155420 +VITE_WORLD_ADDRESS = 0x943e0b3F1926008f2e1bEFCBc55FA2A75CeC2452 +VITE_WORLD_BLOCK_NUMBER = 6992231 VITE_ANNUALRATE = 0.1 VITE_IPFS_GATEWAY = https://ipfs.io VITE_IPFS_DELEGATE = "/dns4/ceramic-clay.geoweb.network/tcp/443/https" -VITE_WS_RPC_URL=wss://opt-goerli.g.alchemy.com/v2/Y4RuzHDAmcqDnO6iqLcfwDzmbTk4xHob -VITE_HTTP_RPC_URL=https://opt-goerli.g.alchemy.com/v2/Y4RuzHDAmcqDnO6iqLcfwDzmbTk4xHob VITE_LIVEPEER_API_KEY=8cdf71bd-3f27-46e8-991b-411a0f75b91f diff --git a/package.json b/package.json index 343d339..865adb5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@ensdomains/content-hash": "2.5.7", "@geo-web/mud-world-base-contracts": "0.1.0", "@geo-web/mud-world-base-setup": "0.1.2", - "@geo-web/sdk": "^4.3.3", + "@geo-web/sdk": "^4.4.0", "@geo-web/types": "^0.2.0", "@google/model-viewer": "^3.2.1", "@livepeer/react": "^2.8.3", diff --git a/src/container/GeoWebSystem/GWS.tsx b/src/container/GeoWebSystem/GWS.tsx index 5b48aef..59c5a67 100644 --- a/src/container/GeoWebSystem/GWS.tsx +++ b/src/container/GeoWebSystem/GWS.tsx @@ -4,8 +4,8 @@ import GWLoader from "../../components/common/Loader/Loader"; import GWAvail from "../../components/common/ContentFiller/Avail"; import GWContentView from "../GeoWebInterface/components/GeoWebContent/GWContent"; import { - HTTP_RPC_URL, - WS_RPC_URL, + RPC_URLS_HTTP, + RPC_URLS_WS, NETWORK_ID, IPFS_GATEWAY, WORLD, @@ -39,7 +39,7 @@ const mudChain: MUDChain = { ...optimismGoerli.rpcUrls, default: { http: optimismGoerli.rpcUrls.default.http, - webSocket: [WS_RPC_URL], + webSocket: [RPC_URLS_WS[NETWORK_ID]], }, }, }; @@ -99,7 +99,7 @@ export default function GWS() { try { const publicClient = createPublicClient({ chain: mudChain, - transport: http(HTTP_RPC_URL), + transport: http(RPC_URLS_HTTP[NETWORK_ID]), }); const registryContract = getContract({ address: getContractAddressesForChainOrThrow(NETWORK_ID) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index d62448a..008aa85 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -12,6 +12,17 @@ export const PINATA_API_ENDPOINT = "https://api.pinata.cloud/psa"; export const STORAGE_WORKER_ENDPOINT = "https://storage-workers.geo-web.workers.dev"; export const SECONDS_IN_YEAR = 60 * 60 * 24 * 365; -export const WS_RPC_URL = import.meta.env.VITE_WS_RPC_URL!; -export const HTTP_RPC_URL = import.meta.env.VITE_HTTP_RPC_URL!; export const LIVEPEER_API_KEY = import.meta.env.VITE_LIVEPEER_API_KEY!; + +export const RPC_URLS_HTTP: Record = { + 10: `https://opt-mainnet.g.alchemy.com/v2/${import.meta.env + .VITE_ALCHEMY_MAINNET_API_KEY!}`, + 11155420: `https://opt-sepolia.g.alchemy.com/v2/${import.meta.env + .VITE_ALCHEMY_TESTNET_API_KEY!}`, +}; +export const RPC_URLS_WS: Record = { + 10: `wss://opt-goerli.g.alchemy.com/v2/${import.meta.env + .VITE_ALCHEMY_MAINNET_API_KEY!}`, + 11155420: `wss://opt-sepolia.g.alchemy.com/v2/${import.meta.env + .VITE_ALCHEMY_TESTNET_API_KEY!}`, +}; diff --git a/yarn.lock b/yarn.lock index 7809681..12f4417 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2209,10 +2209,10 @@ rxjs "7.5.5" viem "1.14.0" -"@geo-web/sdk@^4.3.3": - version "4.3.3" - resolved "https://registry.yarnpkg.com/@geo-web/sdk/-/sdk-4.3.3.tgz#3189381e10fb43237f51f357602d0ea90d421ac1" - integrity sha512-cRuQr2FJddt0kv/HYvhKCrhuB3lCFqhWqoC2ap5mPmkFfX2W2y6eE86mK5fkb24BYuiiM6KQ5UKEt7xRETOqxg== +"@geo-web/sdk@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@geo-web/sdk/-/sdk-4.4.0.tgz#2b857726491146344f4106f8bf158d271c514138" + integrity sha512-E6pnvZ69yKherAivNZXv93DGTFJos2ifHpkPyYXeuiClGKbITyAGdNfR5G2woHUokJzeltsxnluVmfQnSo4vXA== dependencies: "@geo-web/contracts" "4.3.1" ethers ">=5.0.0 <6.0.0"