Skip to content

Commit

Permalink
Merge pull request #151 from nation3/139-improve-env-variables
Browse files Browse the repository at this point in the history
Improve env variables (#139)
  • Loading branch information
TTNguyenDev authored Mar 3, 2024
2 parents cda3a8f + 44e545a commit 4ce9bbb
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ui-components-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/web-app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ node_modules/
lcov.info
coverage

.env**
.env
.env.local

# dependencies
/node_modules
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions packages/web-app/.env.sepolia
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 10 additions & 6 deletions packages/web-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,33 @@ 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
```

---

##### 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/).
5 changes: 1 addition & 4 deletions packages/web-app/lib/connectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ type FallbackProviderConfig = Omit<providers.FallbackProviderConfig, "provider">

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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app/lib/constants/sepolia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");

0 comments on commit 4ce9bbb

Please sign in to comment.