Skip to content

Commit

Permalink
feat: move to op-sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
codynhat committed Jan 25, 2024
1 parent ab47118 commit 125c9a1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .env.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions .env.testnet
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions src/container/GeoWebSystem/GWS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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]],
},
},
};
Expand Down Expand Up @@ -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)
Expand Down
15 changes: 13 additions & 2 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number, string> = {
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<number, string> = {
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!}`,
};

0 comments on commit 125c9a1

Please sign in to comment.