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

Clearer IPFS env vars #113

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NEXT_PUBLIC_WEB3_URL_PREFIX=https://eth-sepolia.g.alchemy.com/v2/
NEXT_PUBLIC_ALCHEMY_API_KEY="ALCHEMY KEY"
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID="YOUR WALLET CONNECT PROJECT ID"
NEXT_PUBLIC_IPFS_ENDPOINT="https://..."
NEXT_PUBLIC_IPFS_API_KEY="..."
NEXT_PUBLIC_PINATA_JWT="..."
NEXT_PUBLIC_ETHERSCAN_API_KEY="OPTIONAL: ETHERSCAN API"

# PRIVATE (scripts)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/app-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
NEXT_PUBLIC_ALCHEMY_API_KEY: x
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: x
NEXT_PUBLIC_IPFS_ENDPOINT: https://ipfs/
NEXT_PUBLIC_IPFS_API_KEY: x
NEXT_PUBLIC_PINATA_JWT: x
NEXT_PUBLIC_ETHERSCAN_API_KEY: x
NODE_ENV: production
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PUB_ETHERSCAN_API_KEY = process.env.NEXT_PUBLIC_ETHERSCAN_API_KEY ?
export const PUB_WALLET_CONNECT_PROJECT_ID = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ?? "";

export const PUB_IPFS_ENDPOINT = process.env.NEXT_PUBLIC_IPFS_ENDPOINT ?? "";
export const PUB_IPFS_API_KEY = process.env.NEXT_PUBLIC_IPFS_API_KEY ?? "";
export const PUB_PINATA_JWT = process.env.NEXT_PUBLIC_PINATA_JWT ?? "";

// General
export const PUB_APP_NAME = "Aragonette";
Expand Down
4 changes: 2 additions & 2 deletions plugins/dualGovernance/pages/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getPlainText } from "@/utils/html";
import { useRouter } from "next/router";
import { Else, ElseIf, If, Then } from "@/components/if";
import { PleaseWaitSpinner } from "@/components/please-wait";
import { PUB_IPFS_ENDPOINT, PUB_IPFS_API_KEY, PUB_DUAL_GOVERNANCE_PLUGIN_ADDRESS, PUB_CHAIN } from "@/constants";
import { PUB_IPFS_ENDPOINT, PUB_PINATA_JWT, PUB_DUAL_GOVERNANCE_PLUGIN_ADDRESS, PUB_CHAIN } from "@/constants";
import { ActionCard } from "@/components/actions/action";

enum ActionType {
Expand All @@ -24,7 +24,7 @@ enum ActionType {

const ipfsClient = create({
url: PUB_IPFS_ENDPOINT,
headers: { "X-API-KEY": PUB_IPFS_API_KEY, Accept: "application/json" },
headers: { "X-API-KEY": PUB_PINATA_JWT, Accept: "application/json" },
});

export default function Create() {
Expand Down
4 changes: 2 additions & 2 deletions plugins/lockToVote/pages/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getPlainText } from "@/utils/html";
import { useRouter } from "next/router";
import { Else, ElseIf, If, Then } from "@/components/if";
import { PleaseWaitSpinner } from "@/components/please-wait";
import { PUB_IPFS_ENDPOINT, PUB_IPFS_API_KEY, PUB_CHAIN, PUB_LOCK_TO_VOTE_PLUGIN_ADDRESS } from "@/constants";
import { PUB_IPFS_ENDPOINT, PUB_PINATA_JWT, PUB_CHAIN, PUB_LOCK_TO_VOTE_PLUGIN_ADDRESS } from "@/constants";
import { ActionCard } from "@/components/actions/action";

enum ActionType {
Expand All @@ -24,7 +24,7 @@ enum ActionType {

const ipfsClient = create({
url: PUB_IPFS_ENDPOINT,
headers: { "X-API-KEY": PUB_IPFS_API_KEY, Accept: "application/json" },
headers: { "X-API-KEY": PUB_PINATA_JWT, Accept: "application/json" },
});

export default function Create() {
Expand Down
4 changes: 2 additions & 2 deletions plugins/tokenVoting/pages/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getPlainText } from "@/utils/html";
import { useRouter } from "next/router";
import { Else, ElseIf, If, Then } from "@/components/if";
import { PleaseWaitSpinner } from "@/components/please-wait";
import { PUB_CHAIN, PUB_IPFS_API_KEY, PUB_IPFS_ENDPOINT, PUB_TOKEN_VOTING_PLUGIN_ADDRESS } from "@/constants";
import { PUB_CHAIN, PUB_PINATA_JWT, PUB_IPFS_ENDPOINT, PUB_TOKEN_VOTING_PLUGIN_ADDRESS } from "@/constants";
import { ActionCard } from "@/components/actions/action";

enum ActionType {
Expand All @@ -24,7 +24,7 @@ enum ActionType {

const ipfsClient = create({
url: PUB_IPFS_ENDPOINT,
headers: { "X-API-KEY": PUB_IPFS_API_KEY, Accept: "application/json" },
headers: { "X-API-KEY": PUB_PINATA_JWT, Accept: "application/json" },
});

export default function Create() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ NEXT_PUBLIC_WEB3_URL_PREFIX=https://eth-${DEPLOYMENT_TARGET_CHAIN_ID}.g.alchemy.
NEXT_PUBLIC_ALCHEMY_API_KEY=<YOUR KEY GOES HERE>
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=<YOUR KEY GOES HERE>
NEXT_PUBLIC_IPFS_ENDPOINT=<YOUR IPFS API URL GOES HERE>
NEXT_PUBLIC_IPFS_API_KEY=<YOUR IPFS API KEY GOES HERE>
NEXT_PUBLIC_PINATA_JWT=<YOUR IPFS API KEY GOES HERE>
NEXT_PUBLIC_ETHERSCAN_API_KEY=<YOUR API KEY GOES HERE>
`;
console.log(summary);
Expand Down
4 changes: 2 additions & 2 deletions utils/ipfs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PUB_IPFS_ENDPOINT, PUB_IPFS_API_KEY } from "@/constants";
import { PUB_IPFS_ENDPOINT, PUB_PINATA_JWT } from "@/constants";
import { CID, IPFSHTTPClient } from "ipfs-http-client";
import { Hex, fromHex } from "viem";

Expand Down Expand Up @@ -27,7 +27,7 @@ async function fetchFromIPFS(ipfsUri: string): Promise<Response> {
const response = await fetch(`${PUB_IPFS_ENDPOINT}/cat?arg=${path}`, {
method: "POST",
headers: {
"X-API-KEY": PUB_IPFS_API_KEY,
"X-API-KEY": PUB_PINATA_JWT,
Accept: "application/json",
},
signal: controller.signal,
Expand Down
Loading