From 41a6e2f83ac4d48a9dccf52d933c15074b9a724e Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Wed, 16 Oct 2024 16:16:09 +0100 Subject: [PATCH] feat(common): add rhodolite chain (#3295) --- .changeset/hip-turkeys-cheat.md | 5 ++++ .../client-vanilla/src/mud/supportedChains.ts | 6 ++--- .../client/src/mud/supportedChains.ts | 20 ++------------- .../client-phaser/src/mud/supportedChains.ts | 6 ++--- .../client-react/src/mud/supportedChains.ts | 6 ++--- .../client-vanilla/src/mud/supportedChains.ts | 6 ++--- .../client/src/mud/getNetworkConfig.ts | 2 -- .../client/src/mud/supportedChains.ts | 8 ++---- packages/common/src/chains/index.ts | 4 +-- packages/common/src/chains/latticeTestnet.ts | 25 ------------------- packages/common/src/chains/rhodolite.ts | 20 +++++++++++++++ 11 files changed, 43 insertions(+), 65 deletions(-) create mode 100644 .changeset/hip-turkeys-cheat.md delete mode 100644 packages/common/src/chains/latticeTestnet.ts create mode 100644 packages/common/src/chains/rhodolite.ts diff --git a/.changeset/hip-turkeys-cheat.md b/.changeset/hip-turkeys-cheat.md new file mode 100644 index 0000000000..fcce2b2482 --- /dev/null +++ b/.changeset/hip-turkeys-cheat.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/common": patch +--- + +Added Rhodolite devnet chain config and removed the old and now-defunct Lattice testnet chain config. diff --git a/e2e/packages/client-vanilla/src/mud/supportedChains.ts b/e2e/packages/client-vanilla/src/mud/supportedChains.ts index 4b5bc43250..86a0d5eaaa 100644 --- a/e2e/packages/client-vanilla/src/mud/supportedChains.ts +++ b/e2e/packages/client-vanilla/src/mud/supportedChains.ts @@ -1,4 +1,4 @@ -import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains"; +import { MUDChain, mudFoundry } from "@latticexyz/common/chains"; -// If you are deploying to chains other than anvil or Lattice testnet, add them here -export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet]; +// If you are deploying to chains other than anvil, add them here +export const supportedChains: MUDChain[] = [mudFoundry]; diff --git a/examples/local-explorer/packages/client/src/mud/supportedChains.ts b/examples/local-explorer/packages/client/src/mud/supportedChains.ts index 03cefdf77f..f3e79b39f4 100644 --- a/examples/local-explorer/packages/client/src/mud/supportedChains.ts +++ b/examples/local-explorer/packages/client/src/mud/supportedChains.ts @@ -1,19 +1,3 @@ -/* - * The supported chains. - * By default, there are only two chains here: - * - * - mudFoundry, the chain running on anvil that pnpm dev - * starts by default. It is similar to the viem anvil chain - * (see https://viem.sh/docs/clients/test.html), but with the - * basefee set to zero to avoid transaction fees. - * - latticeTestnet, our public test network. - * - */ +import { MUDChain, mudFoundry, redstone, garnet, rhodolite } from "@latticexyz/common/chains"; -import { MUDChain, mudFoundry, redstone, garnet } from "@latticexyz/common/chains"; - -/* - * See https://mud.dev/tutorials/minimal/deploy#run-the-user-interface - * for instructions on how to add networks. - */ -export const supportedChains: MUDChain[] = [mudFoundry, redstone, garnet]; +export const supportedChains: MUDChain[] = [mudFoundry, redstone, garnet, rhodolite]; diff --git a/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts b/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts index 4b5bc43250..86a0d5eaaa 100644 --- a/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts +++ b/examples/minimal/packages/client-phaser/src/mud/supportedChains.ts @@ -1,4 +1,4 @@ -import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains"; +import { MUDChain, mudFoundry } from "@latticexyz/common/chains"; -// If you are deploying to chains other than anvil or Lattice testnet, add them here -export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet]; +// If you are deploying to chains other than anvil, add them here +export const supportedChains: MUDChain[] = [mudFoundry]; diff --git a/examples/minimal/packages/client-react/src/mud/supportedChains.ts b/examples/minimal/packages/client-react/src/mud/supportedChains.ts index 4b5bc43250..86a0d5eaaa 100644 --- a/examples/minimal/packages/client-react/src/mud/supportedChains.ts +++ b/examples/minimal/packages/client-react/src/mud/supportedChains.ts @@ -1,4 +1,4 @@ -import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains"; +import { MUDChain, mudFoundry } from "@latticexyz/common/chains"; -// If you are deploying to chains other than anvil or Lattice testnet, add them here -export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet]; +// If you are deploying to chains other than anvil, add them here +export const supportedChains: MUDChain[] = [mudFoundry]; diff --git a/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts b/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts index 4b5bc43250..86a0d5eaaa 100644 --- a/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts +++ b/examples/minimal/packages/client-vanilla/src/mud/supportedChains.ts @@ -1,4 +1,4 @@ -import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains"; +import { MUDChain, mudFoundry } from "@latticexyz/common/chains"; -// If you are deploying to chains other than anvil or Lattice testnet, add them here -export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet]; +// If you are deploying to chains other than anvil, add them here +export const supportedChains: MUDChain[] = [mudFoundry]; diff --git a/examples/multiple-accounts/packages/client/src/mud/getNetworkConfig.ts b/examples/multiple-accounts/packages/client/src/mud/getNetworkConfig.ts index 2794583cca..a9cfa5cf13 100644 --- a/examples/multiple-accounts/packages/client/src/mud/getNetworkConfig.ts +++ b/examples/multiple-accounts/packages/client/src/mud/getNetworkConfig.ts @@ -22,13 +22,11 @@ import worlds from "contracts/worlds.json"; /* * The supported chains. - * By default, there are only two chains here: * * - mudFoundry, the chain running on anvil that pnpm dev * starts by default. It is similar to the viem anvil chain * (see https://viem.sh/docs/clients/test.html), but with the * basefee set to zero to avoid transaction fees. - * - latticeTestnet, our public test network. * * See https://mud.dev/tutorials/minimal/deploy#run-the-user-interface * for instructions on how to add networks. diff --git a/examples/multiple-accounts/packages/client/src/mud/supportedChains.ts b/examples/multiple-accounts/packages/client/src/mud/supportedChains.ts index 614412500e..b6df78d089 100644 --- a/examples/multiple-accounts/packages/client/src/mud/supportedChains.ts +++ b/examples/multiple-accounts/packages/client/src/mud/supportedChains.ts @@ -1,20 +1,16 @@ /* * The supported chains. - * By default, there are only two chains here: * * - mudFoundry, the chain running on anvil that pnpm dev * starts by default. It is similar to the viem anvil chain * (see https://viem.sh/docs/clients/test.html), but with the * basefee set to zero to avoid transaction fees. - * - latticeTestnet, our public test network. - * - */ -import { MUDChain, latticeTestnet, mudFoundry } from "@latticexyz/common/chains"; +import { MUDChain, mudFoundry } from "@latticexyz/common/chains"; /* * See https://mud.dev/tutorials/minimal/deploy#run-the-user-interface * for instructions on how to add networks. */ -export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet]; +export const supportedChains: MUDChain[] = [mudFoundry]; diff --git a/packages/common/src/chains/index.ts b/packages/common/src/chains/index.ts index 85632970c6..6f7e42a440 100644 --- a/packages/common/src/chains/index.ts +++ b/packages/common/src/chains/index.ts @@ -1,5 +1,5 @@ export type { MUDChain } from "./types"; export { mudFoundry } from "./mudFoundry"; -export { latticeTestnet } from "./latticeTestnet"; -export { garnet } from "./garnet"; export { redstone } from "./redstone"; +export { garnet } from "./garnet"; +export { rhodolite } from "./rhodolite"; diff --git a/packages/common/src/chains/latticeTestnet.ts b/packages/common/src/chains/latticeTestnet.ts deleted file mode 100644 index 16a95934be..0000000000 --- a/packages/common/src/chains/latticeTestnet.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { MUDChain } from "./types"; - -/** @deprecated This chain is deprecated and will be going offline soon. Please switch to Garnet! */ -export const latticeTestnet = { - name: "Lattice Testnet", - id: 4242, - nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" }, - rpcUrls: { - default: { - http: ["https://follower.testnet-chain.linfra.xyz"], - webSocket: ["wss://follower.testnet-chain.linfra.xyz"], - }, - public: { - http: ["https://follower.testnet-chain.linfra.xyz"], - webSocket: ["wss://follower.testnet-chain.linfra.xyz"], - }, - }, - blockExplorers: { - default: { - name: "Otterscan", - url: "https://explorer.testnet-chain.linfra.xyz", - }, - }, - faucetUrl: "https://faucet.testnet-mud-services.linfra.xyz", -} as const satisfies MUDChain; diff --git a/packages/common/src/chains/rhodolite.ts b/packages/common/src/chains/rhodolite.ts new file mode 100644 index 0000000000..c74286c927 --- /dev/null +++ b/packages/common/src/chains/rhodolite.ts @@ -0,0 +1,20 @@ +import { chainConfig } from "viem/op-stack"; +import { MUDChain } from "./types"; + +const sourceId = 17001; + +export const rhodolite = { + ...chainConfig, + name: "Rhodolite Devnet", + testnet: true, + id: 17420, + sourceId, + nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, + rpcUrls: { + default: { + http: ["https://rpc.rhodolitechain.com"], + }, + }, + iconUrls: ["https://redstone.xyz/chain-icons/rhodolite.png"], + indexerUrl: "https://indexer.mud.rhodolitechain.com", +} as const satisfies MUDChain;