Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: OP Sepolia #98

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
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!}`,
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading