diff --git a/.github/workflows/ui-components-ci.yml b/.github/workflows/ui-components-ci.yml index 462a4300..1bbb3aec 100644 --- a/.github/workflows/ui-components-ci.yml +++ b/.github/workflows/ui-components-ci.yml @@ -30,8 +30,8 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest] - node-version: [16.x] + os: [ubuntu-latest, windows-latest] + node-version: [18.x, 20.x] runs-on: ${{ matrix.os }} defaults: run: @@ -50,8 +50,8 @@ jobs: test: strategy: matrix: - os: [ubuntu-latest] - node-version: [16.x] + os: [ubuntu-latest, windows-latest] + node-version: [18.x, 20.x] runs-on: ${{ matrix.os }} defaults: run: diff --git a/.github/workflows/web-app-ci.yml b/.github/workflows/web-app-ci.yml index ee5134e1..2533bd84 100644 --- a/.github/workflows/web-app-ci.yml +++ b/.github/workflows/web-app-ci.yml @@ -30,8 +30,8 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest] - node-version: [16.x] + os: [ubuntu-latest, windows-latest] + node-version: [18.x, 20.x] runs-on: ${{ matrix.os }} defaults: run: diff --git a/.gitignore b/.gitignore index edf5db12..c58d02e9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,8 @@ node_modules/ lcov.info coverage -.env** +.env +.env.local # dependencies /node_modules diff --git a/packages/web-app/.env.sample b/packages/web-app/.env.mainnet similarity index 73% rename from packages/web-app/.env.sample rename to packages/web-app/.env.mainnet index 83859178..0a298062 100644 --- a/packages/web-app/.env.sample +++ b/packages/web-app/.env.mainnet @@ -1,5 +1,4 @@ NEXT_PUBLIC_CHAIN="mainnet" NEXT_PUBLIC_NFTSTORAGE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDI2NmFCZGE3QWNmODc0NTlBRTJEOTg5RjM4OWU1N0I0MmJCNkNkNzYiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTcwOTIwOTQwNDM3MiwibmFtZSI6IkRhbyJ9.YsuBC1iXGJ7Ip_VkFjsZSzHQSOkKRMyaCw4eq_j5f-4 NEXT_PUBLIC_GRAPH_API_URL=https://api.thegraph.com/subgraphs/name/nation3/nation3-agreements-mainnet -NEXT_PUBLIC_GRAPH_API_URL_SEPOLIA=https://api.thegraph.com/subgraphs/name/nation3/nation3-agreements-sepolia -NEXT_PUBLIC_ALCHEMY_API_KEY="" +NEXT_PUBLIC_ALCHEMY_API_KEY="6E06msPMRDva4egUiK0j4sNpEbFkXE6w" diff --git a/packages/web-app/.env.sepolia b/packages/web-app/.env.sepolia new file mode 100644 index 00000000..a56fee25 --- /dev/null +++ b/packages/web-app/.env.sepolia @@ -0,0 +1,4 @@ +NEXT_PUBLIC_CHAIN="sepolia" +NEXT_PUBLIC_NFTSTORAGE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDI2NmFCZGE3QWNmODc0NTlBRTJEOTg5RjM4OWU1N0I0MmJCNkNkNzYiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTcwOTIwOTQwNDM3MiwibmFtZSI6IkRhbyJ9.YsuBC1iXGJ7Ip_VkFjsZSzHQSOkKRMyaCw4eq_j5f-4 +NEXT_PUBLIC_GRAPH_API_URL=https://api.thegraph.com/subgraphs/name/nation3/nation3-agreements-sepolia +NEXT_PUBLIC_ALCHEMY_API_KEY="6E06msPMRDva4egUiK0j4sNpEbFkXE6w" diff --git a/packages/web-app/README.md b/packages/web-app/README.md index 403899b4..1960f07b 100644 --- a/packages/web-app/README.md +++ b/packages/web-app/README.md @@ -4,17 +4,23 @@ Human-centric UI to create and manage agreements in the Nation3 Legal system. ## Development -##### 1. Build dependencies. +### Set Environment Variables + +``` +cp .env.mainnet .env +``` + +### Build dependencies. This app depends on the `@nation3/ui-components` package found [here](../ui-components/). (packages/ui-components.) -If you want to see changes to the components reflected in real-time on the web app you should run the builder in the `ui-components` directory using: +If you want to see changes to the components reflected in real-time on the web app you should run the builder in the `ui-components` directory using: ``` yarn build:dependencies ``` -##### 2. Run a local development environment with yarn: +### Run a local development environment with yarn: ``` yarn dev @@ -22,11 +28,9 @@ yarn dev --- -##### Running the app: +### Run the app: ``` yarn start ``` - -If you want to be able to create new agreements, you will need to upload metadata to IPFS, so you will need to add your own `IPFS_API_TOKEN` to your environment. Check [how to generate web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/). diff --git a/packages/web-app/lib/connectors.tsx b/packages/web-app/lib/connectors.tsx index d34e1c1c..fce7880a 100644 --- a/packages/web-app/lib/connectors.tsx +++ b/packages/web-app/lib/connectors.tsx @@ -8,10 +8,7 @@ type FallbackProviderConfig = Omit const customAlchemyProvider = ({ priority, stallTimeout, weight }: FallbackProviderConfig) => { return (chain: Chain) => { - let apiKey = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY; - if (chain?.id == 11155111) { - apiKey = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY_SEPOLIA; - } + const apiKey = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY; if (!apiKey || !chain.rpcUrls.alchemy) return null; return { diff --git a/packages/web-app/lib/constants/sepolia.tsx b/packages/web-app/lib/constants/sepolia.tsx index da9c6a97..64aff9a4 100644 --- a/packages/web-app/lib/constants/sepolia.tsx +++ b/packages/web-app/lib/constants/sepolia.tsx @@ -6,5 +6,5 @@ export const frameworkAddress = "0xD96aA6e2568f4e9632D2A5234Bb8410ca7609a27"; export const arbitratorAddress = "0xBe67cEdCD1FE38aac8a5781A51250FDeFB344E6C"; export const cohortAddress = "0x2F957C3D949b4e3967E1ddF646614b77BF46057e"; //GnosisSafeProxy export const safeTxServiceUrl = "https://safe-transaction-sepolia.safe.global"; -export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL_SEPOLIA; +export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL; export const appealCost = BigNumber.from("1000000000000000000");