Skip to content

Commit 63b8cbf

Browse files
committed
Add deps and instructions
1 parent 927830e commit 63b8cbf

File tree

7 files changed

+889
-8
lines changed

7 files changed

+889
-8
lines changed

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
AUTHORITY_KEYPAIR=
2+
USER_KEYPAIR=
3+
ANCHOR_PROVIDER_URL=https://api.devnet.solana.com
4+
ANCHOR_WALLET=/your-homedir/.config/solana/id.json
5+
#PORT=80

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
node_modules
1+
node_modules
2+
build
3+
.env

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,22 @@
33
This is a repository showing how to mint an NFT collection using WNS.
44

55
Last update, using V0.0.1
6+
7+
# Instructions
8+
9+
1. Clone this repository
10+
2. Run `yarn install`
11+
3. Run `yarn build`
12+
3. Run `yarn start`
13+
14+
# Invoke endpoints
15+
16+
```shell
17+
curl -XPOST localhost/initializeCollection
18+
```
19+
20+
```shell
21+
curl -XPOST localhost/mintNftsToCollection -H 'content-type: application/json' --data '{ "collection":"7q1xiCjmoSb2BNCkYbf1tzQK5E7jd17C8LNZTW2oV2cA" }'
22+
```
23+
24+

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"express": "^4.18.2"
3232
},
3333
"devDependencies": {
34-
"@types/express": "^4.17.21"
34+
"@types/express": "^4.17.21",
35+
"dotenv": "^16.4.5",
36+
"npm-run-all": "^4.1.5",
37+
"typescript": "^5.4.3"
3538
}
3639
}

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ app.post("/fetchDistribution", async (req, res) => {
7575
app.get("/", async function (_, res) {
7676
res.send({ status: "true" });
7777
});
78-
79-
app.listen(80, async () => {
80-
console.log("The application is listening on port 80!");
78+
const port = process.env.PORT || 80;
79+
app.listen(port, async () => {
80+
console.log(`The application is listening on port ${port}!`);
8181
});

src/utils/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { PublicKey, Keypair } from "@solana/web3.js";
1+
import {Keypair, PublicKey} from "@solana/web3.js";
2+
import 'dotenv/config';
23

34
export const TOKEN_PROGRAM_ID = new PublicKey("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
45
export const DISTRIBUTION_PROGRAM_ID = new PublicKey("diste3nXmK7ddDTs1zb6uday6j4etCa9RChD8fJ1xay");

0 commit comments

Comments
 (0)