diff --git a/README.md b/README.md index d3dfec8..cc4b23c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/mint-site/.env-example b/mint-site/.env-example new file mode 100644 index 0000000..d6bb898 --- /dev/null +++ b/mint-site/.env-example @@ -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 \ No newline at end of file diff --git a/mint-site/helpers/candyMachineInfo.js b/mint-site/helpers/candyMachineInfo.js index b7a3daa..8b34b1e 100644 --- a/mint-site/helpers/candyMachineInfo.js +++ b/mint-site/helpers/candyMachineInfo.js @@ -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; }