Skip to content

Commit 6cd8b93

Browse files
committedOct 31, 2021
Improve instructions on running Solana nft bot
1 parent 60ae426 commit 6cd8b93

File tree

3 files changed

+43
-17
lines changed

3 files changed

+43
-17
lines changed
 

‎README.md

+37-10
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,49 @@ Solana NFT bot is a helpful bot for your Solana NFT projects.
66
- [x] Notify discord channel on each purchase in marketplaces.
77
- [x] [Support major marketplaces](#marketplace-support)
88

9-
## Running locally
9+
## Running in development
1010
### Requirement
1111
* Node >= 16.6
1212
* Yarn
1313

1414
### Instructions
1515

16-
1. Install dependencies
16+
#### 1. Install dependencies
1717
```
1818
yarn install
1919
```
2020

21-
2. Update .env with your secrets
21+
#### 2. Update .env with your secrets
22+
23+
Follow the instructions [here](#configurable-environments)
24+
25+
#### 3. Run the server
26+
```
27+
yarn dev
28+
```
29+
30+
## Running using docker
31+
32+
### Requirement
33+
* [docker](https://www.docker.com/products/docker-desktop) >= v20.10
34+
35+
### Instructions
36+
37+
#### 1. Update .env with your secrets
38+
39+
Follow the instructions [here](#configurable-environments)
40+
41+
#### 2. Run bot using docker compose in the terminal
42+
In the terminal run the follow command in the repo directory:
43+
44+
```
45+
docker-compose up bot
46+
```
47+
48+
## Configurable environments
49+
50+
Here are a list of environments you need to configure before running the NFT bot.
51+
2252
```sh
2353
# Replace this with your RPC
2454
SOLANA_RPC=https://explorer-api.mainnet-beta.solana.com/
@@ -29,9 +59,12 @@ SUBSCRIPTION_DISCORD_CHANNEL_ID=
2959
# Mint address to watch for sales
3060
SUBSCRIPTION_MINT_ADDRESS=
3161
```
62+
https://github.com/milktoastlab/SolanaNFTBot/blob/main/.env
63+
64+
### Variable breakdowns
3265

3366
#### DISCORD_BOT_TOKEN
34-
This is your discord bot secret.
67+
This is your discord bot secret.
3568
If you don't have a discord bot yet, you can create one following the instructions here:
3669
https://discordpy.readthedocs.io/en/stable/discord.html
3770

@@ -56,12 +89,6 @@ Ideally, it's the "Update Authority" address.
5689
<img width="587" alt="Screen Shot 2021-10-31 at 9 30 56 am" src="https://user-images.githubusercontent.com/90617759/139560515-efd2f584-8f98-4337-a9ad-704b18581b22.png">
5790

5891

59-
3. Run the server
60-
```
61-
yarn dev
62-
```
63-
64-
6592
## Marketplace support
6693

6794
- [x] [Magic Eden](https://magiceden.io/)

‎docker-compose.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
version: "3.9"
22
services:
33
bot:
4-
build: .
4+
image: milktoastlab/solananftbot
55
ports:
66
- "4000:4000"
7-
environment:
8-
- SOLANA_RPC=https://explorer-api.mainnet-beta.solana.com/
9-
- DISCORD_BOT_TOKEN=
10-
- SUBSCRIPTION_DISCORD_CHANNEL_ID=
11-
- SUBSCRIPTION_MINT_ADDRESS=
7+
env_file:
8+
- .env

‎src/server.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ const port = process.env.PORT || 3000;
3636

3737
server.listen(port, (err?: any) => {
3838
if (err) throw err;
39-
console.log(`> Ready on localhost:${port} - env ${process.env.NODE_ENV}`);
39+
console.log(
40+
`> Ready on http://localhost:${port} - env ${process.env.NODE_ENV}`
41+
);
4042
});
4143

4244
const discordClient = await initDiscordClient();

0 commit comments

Comments
 (0)
Please sign in to comment.