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

Move environment variables from js file to .env file #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,15 @@ We provide options to update presale mint time, public mint time, mint fee and w
### Create website
You need to have npm installed, we are using nextJS to build this simple website

change the values in `mint-site/helpers/candyMachineInfo.js` - can find those info in your config.json:
change the name `.env-example` to `.env` - can find those info in your config.json:

```txt
export const candyMachineAddress = "YOUR CM ADDRESS";
export const collectionName = "collection name(Case sensitive!)";
export const collectionCoverUrl = " THE COVER LINK eg: https://cloudflare-ipfs.com/ipfs/asjdhasjhd";
NEXT_PUBLIC_CANDY_MACHINE_ID="YOUR CM ADDRESS"
NEXT_PUBLIC_COLLECTION_NAME="collection name(Case sensitive!)"
NEXT_PUBLIC_COLLECTION_IMAGE_URI="THE COVER LINK eg: https://cloudflare-ipfs.com/ipfs/asjdhasjhd"

# dev | test | mainnet
NEXT_PUBLIC_APTOS_NETWORK=dev
```

open mint-site folder, run
Expand Down
6 changes: 6 additions & 0 deletions mint-site/.env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NEXT_PUBLIC_CANDY_MACHINE_ID=0x910d29c9605d6369edd2f895d4b93e1742819a63cf6c4535e3682701265f3149
NEXT_PUBLIC_COLLECTION_NAME=Test collection
NEXT_PUBLIC_COLLECTION_IMAGE_URI=https://cloudflare-ipfs.com/ipfs//QmVsudH4sHELLHfaw3mYsX55zMXa2vpPAEvPsdPAV9Kwfx

# dev | test | mainnet
NEXT_PUBLIC_APTOS_NETWORK=dev
24 changes: 13 additions & 11 deletions mint-site/helpers/candyMachineInfo.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
export const candyMachineAddress = "0x910d29c9605d6369edd2f895d4b93e1742819a63cf6c4535e3682701265f3149";
export const collectionName = "Test collection"; // Case sensitive!
export const collectionCoverUrl = "https://cloudflare-ipfs.com/ipfs//QmRRixSguSvkf39GozjygyiLcW47osNmzJ3c7uii4GDTTd";
export const mode = "dev"; // "dev" or "test" or "mainnet"
export const candyMachineAddress = process.env.NEXT_PUBLIC_CANDY_MACHINE_ID;
export const collectionName = process.env.NEXT_PUBLIC_COLLECTION_NAME;
export const collectionCoverUrl = process.env.NEXT_PUBLIC_COLLECTION_IMAGE_URI;
export const mode = process.env.NEXT_PUBLIC_APTOS_NETWORK;


export let NODE_URL;
let FAUCET_URL;
if (mode == "dev") {
NODE_URL = "https://fullnode.devnet.aptoslabs.com/v1";
FAUCET_URL = "https://faucet.devnet.aptoslabs.com";

if (mode === "dev") {
NODE_URL = "https://fullnode.devnet.aptoslabs.com/v1";
FAUCET_URL = "https://faucet.devnet.aptoslabs.com";
} else if (mode === "test") {
NODE_URL = "https://fullnode.testnet.aptoslabs.com/v1";
FAUCET_URL = "https://faucet.testnet.aptoslabs.com";
NODE_URL = "https://fullnode.testnet.aptoslabs.com/v1";
FAUCET_URL = "https://faucet.testnet.aptoslabs.com";
} else {
NODE_URL = "https://fullnode.mainnet.aptoslabs.com/v1";
FAUCET_URL = null;
NODE_URL = "https://fullnode.mainnet.aptoslabs.com/v1";
FAUCET_URL = null;
}