Author SHA1 Message Date
IshaVenikar 842bfab1fd Update port mapping for multisig app 2025-05-29 17:13:37 +05:30
6 changed files with 13 additions and 55 deletions
+1 -2
View File
@@ -1,13 +1,12 @@
{
"name": "cosmos-multisig-ui",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"test": "jest --watch",
"test:ci": "jest",
"build": "next build",
"start": "next start",
"start": "next start -p 7000",
"format": "prettier --write --log-level warn \"./**/*.{js,jsx,mjs,ts,tsx}\"",
"lint": "eslint --max-warnings 0 \"./**/*.{js,jsx,mjs,ts,tsx}\"",
"lint:fix": "eslint --max-warnings 0 \"./**/*.{js,jsx,mjs,ts,tsx}\" --fix"
+1 -7
View File
@@ -2,17 +2,11 @@ import Header from "@/components/Header";
import { Toaster } from "@/components/ui/sonner";
import { TooltipProvider } from "@/components/ui/tooltip";
import ThemeProvider from "@/context/ThemesContext";
import { suggestChainToKeplr } from "@/utils/keplr";
import "@/styles/globals.css";
import type { AppProps } from "next/app";
import { useEffect } from "react";
import { ChainsProvider } from "../context/ChainsContext";
import "@/styles/globals.css";
export default function MultisigApp({ Component, pageProps }: AppProps) {
useEffect(() => {
suggestChainToKeplr();
}, []);
return (
<ChainsProvider>
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
@@ -4,8 +4,9 @@ services:
restart: unless-stopped
depends_on:
- alpha
network_mode: "host" # For local testing, to allow the container to directly access host machine ports from container
environment:
DGRAPH_URL: ${DGRAPH_URL:-http://alpha:8080/graphql}
DGRAPH_URL: ${DGRAPH_URL:-http://localhost:8080/graphql}
NEXT_PUBLIC_MULTICHAIN: ${NEXT_PUBLIC_MULTICHAIN}
NEXT_PUBLIC_REGISTRY_NAME: ${NEXT_PUBLIC_REGISTRY_NAME}
NEXT_PUBLIC_LOGO: ${NEXT_PUBLIC_LOGO}
@@ -19,18 +20,14 @@ services:
NEXT_PUBLIC_GAS_PRICE: ${NEXT_PUBLIC_GAS_PRICE}
NEXT_PUBLIC_ADDRESS_PREFIX: ${NEXT_PUBLIC_ADDRESS_PREFIX}
NEXT_PUBLIC_IS_HTTP_ENABLED: ${NEXT_PUBLIC_IS_HTTP_ENABLED:-false}
CHAIN_CONFIG_PATH: ${CHAIN_CONFIG_PATH}
USE_HOST_NETWORK: ${USE_HOST_NETWORK}
network_mode: "${USE_HOST_NETWORK:-}"
command: ["bash", "/cosmos-script/run.sh"]
volumes:
- ../config/cosmos-multisig-ui/run.sh:/cosmos-script/run.sh
- ../config/cosmos-multisig-ui/db-schema.graphql:/cosmos-script/db-schema.graphql
- ${CHAIN_CONFIG_PATH:-../config/cosmos-multisig-ui/network.json}:/app/public/assets/network.json
ports:
- "3000"
- "7000"
healthcheck:
test: ["CMD", "nc", "-vz", "127.0.0.1", "3000"]
test: ["CMD", "nc", "-vz", "127.0.0.1", "7000"]
interval: 20s
timeout: 5s
retries: 15
@@ -38,4 +38,4 @@ COPY . .
# Install app dependencies
RUN npm install --legacy-peer-deps
EXPOSE 3000
EXPOSE 7000
@@ -35,8 +35,14 @@ Instructions for running the `cosmos-multisig-ui` using [laconic-so](https://git
ports:
cosmos-multisig-ui:
- 3000:3000
zero:
- 5080
- 6080
alpha:
- 8080:8080
- 9080
ratel:
- 8000
...
```
-38
View File
@@ -1,38 +0,0 @@
import { Keplr, ChainInfo } from "@keplr-wallet/types";
declare global {
interface Window {
keplr: Keplr & {
experimentalSuggestChain: (chainConfig: ChainInfo) => Promise<void>;
};
}
}
export const suggestChainToKeplr = async () => {
try {
if (typeof window === 'undefined') {
console.error('Method experimentalSuggestChain must be run in a browser environment.');
return;
}
if (!window.keplr) {
console.error('Keplr wallet not found. Please install the Keplr browser extension: https://www.keplr.app/');
return;
}
const response = await fetch('/assets/network.json');
let chainConfig;
try {
chainConfig = await response.json();
} catch (err: unknown) {
console.log('Valid chain config file not found.', err);
return;
}
await window.keplr.experimentalSuggestChain(chainConfig);
console.log('Successfully suggested chain to Keplr');
} catch (error) {
console.error('Error suggesting chain to Keplr:', error);
}
};