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

Support local network #380

Merged
merged 75 commits into from
Jun 28, 2023
Merged

Support local network #380

merged 75 commits into from
Jun 28, 2023

Conversation

evilpeach
Copy link
Collaborator

@evilpeach evilpeach commented Jun 8, 2023

Describe your changes

  • Move all constants, API, indexer, and configures to the config file that can be accessed by chainId.
  • Getting supported chains by retrieving from NEXT_PUBLIC_SUPPORTED_CHAIN_IDS as follows
NEXT_PUBLIC_SUPPORTED_CHAIN_IDS=osmosis-1,osmo-test-4,osmo-test-5
  • Update app context to support this
  • Remove all isMainnet, isTestnet concept.

How to add your network

  1. add your network config here config/index.ts like this
"osmosis-1": {
    chain: "osmosis",
    registryChainName: "osmosis",
    prettyName: "Osmosis",
    lcd: "https://lcd.osmosis.zone",
    rpc: "https://rpc.osmosis.zone",
    indexer: "https://osmosis-mainnet-graphql.alleslabs.dev/v1/graphql",
    api: "https://celatone-api.alleslabs.dev",
    features: {
      faucet: {
        enabled: false,
      },
      wasm: {
        enabled: true,
        storeCodeMaxFileSize: 800_000,
        clearAdminGas: 50_000,
      },
      pool: {
        enabled: true,
      },
    },
    gas: {
      gasPrice: {
        tokenPerGas: 0.025,
        denom: "uosmo",
      },
      gasAdjustment: 1.5,
      maxGasLimit: 25_000_000,
    },
    exampleAddresses: {
      user: "osmo14wk9zecqam9jsac7xwtf8e349ckquzzlx9k8c3" as HumanAddr,
      contract:
        "osmo1p0pxllmqjgl2tefy7grypt34jdpdltg3ka98n8unnl322wqps7lqtu576h" as ContractAddr,
      validator:
        "osmovaloper1hh0g5xf23e5zekg45cmerc97hs4n2004dy2t26" as ValidatorAddr,
    },
    explorerLink: {
      validator: "https://www.mintscan.io/osmosis/validators",
      proposal: "https://www.mintscan.io/osmosis/proposals",
    },
  }
  1. append your chain id in NEXT_PUBLIC_SUPPORTED_CHAIN_IDS

@vercel
Copy link

vercel bot commented Jun 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
beeb-celatone-frontend 🔄 Building (Inspect) Jun 28, 2023 9:52am
neutron-celatone-frontend-staging 🔄 Building (Inspect) Jun 28, 2023 9:52am
osmosis-celatone-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2023 9:52am
sei-celatone-frontend-staging 🔄 Building (Inspect) Jun 28, 2023 9:52am
stargaze-celatone-frontend-staging 🔄 Building (Inspect) Jun 28, 2023 9:52am
support-local-testing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2023 9:52am
6 Ignored Deployments
Name Status Preview Comments Updated (UTC)
mitosis-celatone-frontend-staging ⬜️ Ignored (Inspect) Jun 28, 2023 9:52am
osmosis-celatone-frontend ⬜️ Ignored (Inspect) Jun 28, 2023 9:52am
sei-mobile-celatone ⬜️ Ignored (Inspect) Jun 28, 2023 9:52am
sei-testnet-celatone-frontend ⬜️ Ignored (Inspect) Jun 28, 2023 9:52am
terra-celatone-frontend ⬜️ Ignored (Inspect) Jun 28, 2023 9:52am
terra-celatone-frontend-staging ⬜️ Ignored (Inspect) Jun 28, 2023 9:52am

@@ -128,7 +125,7 @@
</AppLink>
) : (
<a
href={isInternal ? `/${network}${hrefLink}` : hrefLink}
href={isInternal ? `/${currentChainId}${hrefLink}` : hrefLink}

Check warning

Code scanning / CodeQL

Client-side cross-site scripting

Cross-site scripting vulnerability due to [user-provided value](1).
: `/mainnet${componentHref}`
}
>
<Link {...linkProps} href={`/${network}${componentHref}`}>

Check warning

Code scanning / CodeQL

Client-side URL redirect

Untrusted URL redirection depends on a [user-provided value](1).
@@ -128,7 +125,7 @@
</AppLink>
) : (
<a
href={isInternal ? `/${network}${hrefLink}` : hrefLink}
href={isInternal ? `/${currentChainId}${hrefLink}` : hrefLink}

Check warning

Code scanning / CodeQL

Client-side URL redirect

Untrusted URL redirection depends on a [user-provided value](1).
chainName
)}/${chainId}/${walletAddr}`
);
const { data } = await axios.get<Balance[]>(`${baseApiRoute}/${walletAddr}`);

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on a [user-provided value](2).
Copy link
Contributor

@poomthiti poomthiti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Overall

poomthiti and others added 2 commits June 28, 2023 14:41
Fix/fallback explorer link and gov params token symbol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants