-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Adamant-im/dev
First live bot version
- Loading branch information
Showing
35 changed files
with
3,094 additions
and
2,609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Install EditorConfig Plugin on your IDE for one coding style | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
tab_width = 4 | ||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false | ||
# Install EditorConfig Plugin on your IDE for one coding style | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
tab_width = 4 | ||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
module.exports = { | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
quotes: ["error", "single"], | ||
"semi": "warn", // обязательно ; | ||
"semi-spacing": ["error", {"before": false, "after": true}], | ||
"indent": ["error", "tab"], | ||
"space-infix-ops": "error",// отступы вокруг + - * / = и тд | ||
"eqeqeq": "error", // обязательно === и !== (нельзя == и !=) | ||
// "no-eq-null": "error", // обязательно === и !== (нельзя == и !=) но тоько в отношении null | ||
"curly": "error", // проверка шаблонов `${name}` | ||
// "space-before-function-paren": [ // отступ до и после function | ||
// "error", { | ||
// "anonymous": "always", | ||
// "named": "always", | ||
// "asyncArrow": "ignore" | ||
// } | ||
// ], | ||
"key-spacing": ["error", { "mode": "strict" }], // оформление обЪекта | ||
"space-in-parens": ["error", "never"], // запрет отступов ( a,b) | ||
"computed-property-spacing": ["error", "never"], // запрет лишних отступов в выражениях a[ i] | ||
"array-bracket-spacing": ["error", "never"], | ||
"no-multi-spaces": "error", // запрет лишних пробелов var a = 2 | ||
"no-sparse-arrays": "warn", // предупреждение при дырке в массиве | ||
"no-mixed-spaces-and-tabs": "error", // нельзя миксовать табы и пробелы | ||
"keyword-spacing": ["error", { "after": true }], | ||
"comma-spacing": ["error", { "before": false, "after": true }], // отступ после запятой, а перед нельзя | ||
"no-undef":"error", | ||
"array-callback-return": "error" // коллбек методов массива типа arr.map arr.filter должны иметь return в коллбеке | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"Vue":true, | ||
"Symbol":true, | ||
"Promise":true, | ||
}, | ||
"plugins": [] | ||
} | ||
module.exports = { | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
quotes: ["error", "single"], | ||
"semi": "warn", // обязательно ; | ||
"semi-spacing": ["error", {"before": false, "after": true}], | ||
"indent": ["error", "tab"], | ||
"space-infix-ops": "error",// отступы вокруг + - * / = и тд | ||
"eqeqeq": "error", // обязательно === и !== (нельзя == и !=) | ||
// "no-eq-null": "error", // обязательно === и !== (нельзя == и !=) но тоько в отношении null | ||
"curly": "error", // проверка шаблонов `${name}` | ||
// "space-before-function-paren": [ // отступ до и после function | ||
// "error", { | ||
// "anonymous": "always", | ||
// "named": "always", | ||
// "asyncArrow": "ignore" | ||
// } | ||
// ], | ||
"key-spacing": ["error", { "mode": "strict" }], // оформление обЪекта | ||
"space-in-parens": ["error", "never"], // запрет отступов ( a,b) | ||
"computed-property-spacing": ["error", "never"], // запрет лишних отступов в выражениях a[ i] | ||
"array-bracket-spacing": ["error", "never"], | ||
"no-multi-spaces": "error", // запрет лишних пробелов var a = 2 | ||
"no-sparse-arrays": "warn", // предупреждение при дырке в массиве | ||
"no-mixed-spaces-and-tabs": "error", // нельзя миксовать табы и пробелы | ||
"keyword-spacing": ["error", { "after": true }], | ||
"comma-spacing": ["error", { "before": false, "after": true }], // отступ после запятой, а перед нельзя | ||
"no-undef":"error", | ||
"array-callback-return": "error" // коллбек методов массива типа arr.map arr.filter должны иметь return в коллбеке | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"Vue":true, | ||
"Symbol":true, | ||
"Promise":true, | ||
}, | ||
"plugins": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
node_modules/ | ||
logs/ | ||
.vscode/ | ||
package-lock.json | ||
tests.js | ||
config.test | ||
node_modules/ | ||
logs/ | ||
.vscode/ | ||
package-lock.json | ||
tests.js | ||
config.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,95 @@ | ||
ADAMANT Bounty Bot is a software that allows you to carry out bounty campaigns & crypto airdrops, with automatic task verifications and payouts. Bounty bots work in ADAMANT Messenger chats directly. | ||
|
||
The bot supports payouts in ADM, ETH and ERC-20 tokens. | ||
|
||
Read more: [Carry out a crypto Bounty campaign on ADAMANT platform](). | ||
|
||
# Installation | ||
|
||
## Requirements | ||
|
||
* Ubuntu 16 / Ubuntu 18 (other OS had not been tested) | ||
* NodeJS v 8+ (already installed if you have a node on your machine) | ||
* MongoDB ([installation instructions](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/)) | ||
|
||
## Setup | ||
|
||
``` | ||
su - adamant | ||
git clone https://github.com/Adamant-im/adamant-bountybot | ||
cd ./adamant-bountybot | ||
npm i | ||
``` | ||
|
||
## Pre-launch tuning | ||
|
||
``` | ||
nano config.json | ||
``` | ||
|
||
Parameters: | ||
|
||
* `passPhrase` <string> The exchange bot's secret phrase for concluding transactions. Obligatory. Bot's ADAMANT address will correspond this passPhrase. | ||
* `node_ADM` <string, array> List of nodes for API work, obligatorily | ||
* `node_ETH` <string, array> List of nodes for Ethereum API work, obligatorily | ||
* `infoservice` <string, array> List of [ADAMANT InfoServices](https://github.com/Adamant-im/adamant-currencyinfo-services) for catching exchange rates, obligatorily | ||
* `socket` <boolean> If to use WebSocket connection. Recommended for better user experience | ||
* `ws_type` <string> Choose socket connection, "ws" or "wss" depending on your server | ||
* `bot_name` <string> Bot's name for notifications | ||
* `slack` <string> Token for Slack alerts for the bot’s administrator. No alerts if not set | ||
* `adamant_notify` <string> ADM address for the bot’s administrator. Recommended | ||
* `known_crypto` <string, array> List of cryptocurrencies bot can work with. Obligatorily | ||
* `erc20` <string, array> List of cryptocurrencies of ERC-20 type. It is necessary to put all known ERC-20 tokens here. | ||
|
||
* `twitter_follow` <string, array> List of Twitter account user should follow | ||
* `twitter_retweet` <string, array> List of Twitter posts user should retweet | ||
* `twitter_api` <string, object> Your Twitter API credentials. Get on https://apps.twitter.com/app/new | ||
|
||
* `notifyTasksCompleted` <boolean> If you want to receive notifications when user completes Bounty tasks | ||
* `notifyRewardReceived` <boolean> If you want to receive notifications when user receives a Bounty reward | ||
* `rewards` <object, array> List rewards for a Bounty campaign: cryptos and amounts | ||
|
||
* `welcome_string` <string> How to reply user in-chat, if first unknown command received | ||
* `help_message` <string> How to reply to */help* command. Recommended to put Bounty rules here | ||
|
||
## Launching | ||
|
||
You can start the Bot with the `node app` command, but it is recommended to use the process manager for this purpose. | ||
|
||
``` | ||
pm2 start --name bountybot app.js | ||
``` | ||
|
||
## Add the Bot to cron | ||
|
||
``` | ||
crontab -e | ||
``` | ||
|
||
Add string: | ||
|
||
``` | ||
@reboot cd /home/adamant/adamant-bountybot && pm2 start --name bountybot app.js | ||
``` | ||
|
||
## Updating | ||
|
||
``` | ||
su - adamant | ||
cd ./adamant-bountybot | ||
pm2 stop bountybot | ||
mv config.json config_bup.json && git pull && mv config_bup.json config.json | ||
npm i | ||
pm2 start --name bountybot app.js | ||
``` | ||
ADAMANT Bounty Bot is a software that allows you to carry out bounty campaigns & crypto airdrops, with automatic task verifications and payouts. | ||
|
||
It is made for crypto projects and communities. | ||
|
||
The bounty bot: | ||
|
||
* Interactive and interesting for users. The bot talks to users in ADAMANT Messenger chat directly | ||
* Works with Twitter campaigns: follow & retweet with comment (quote). You can set up mentions and hashtags. | ||
* Supports ADAMANT campaigns: users will invite other users | ||
* Automatic task verifications and payouts | ||
* Supports payouts in ADM, ETH and ERC-20 tokens | ||
* Easy to install and configure | ||
* Free and open source | ||
* Stores statistics | ||
|
||
Read more: [Carry out a crypto Bounty campaign on ADAMANT platform](). | ||
|
||
# Installation | ||
|
||
## Requirements | ||
|
||
* Ubuntu 16 / Ubuntu 18 (other OS had not been tested) | ||
* NodeJS v 8+ (already installed if you have a node on your machine) | ||
* MongoDB ([installation instructions](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/)) | ||
|
||
## Setup | ||
|
||
``` | ||
su - adamant | ||
git clone https://github.com/Adamant-im/adamant-bountybot | ||
cd ./adamant-bountybot | ||
npm i | ||
``` | ||
|
||
## Pre-launch tuning | ||
|
||
``` | ||
nano config.json | ||
``` | ||
|
||
Parameters: | ||
|
||
* `passPhrase` <string> The exchange bot's secret phrase for concluding transactions. Obligatory. Bot's ADAMANT address will correspond this passPhrase. | ||
* `node_ADM` <string, array> List of nodes for API work, obligatorily | ||
* `node_ETH` <string, array> List of nodes for Ethereum API work, obligatorily | ||
* `infoservice` <string, array> List of [ADAMANT InfoServices](https://github.com/Adamant-im/adamant-currencyinfo-services) for catching exchange rates, obligatorily | ||
* `socket` <boolean> If to use WebSocket connection. Recommended for better user experience | ||
* `ws_type` <string> Choose socket connection, "ws" or "wss" depending on your server | ||
* `bot_name` <string> Bot's name for notifications | ||
* `slack` <string> Token for Slack alerts for the bot’s administrator. No alerts if not set | ||
* `adamant_notify` <string> ADM address for the bot’s administrator. Recommended | ||
* `known_crypto` <string, array> List of cryptocurrencies bot can work with. Obligatorily | ||
* `erc20` <string, array> List of cryptocurrencies of ERC-20 type. It is necessary to put all known ERC-20 tokens here. | ||
|
||
* `twitter_follow` <string, array> List of Twitter account user should follow | ||
* `twitter_retweet` <string, array> List of Twitter posts user should retweet | ||
* `twitter_api` <string, object> Your Twitter API credentials. Get on https://apps.twitter.com/app/new | ||
|
||
* `notifyTasksCompleted` <boolean> If you want to receive notifications when user completes Bounty tasks | ||
* `notifyRewardReceived` <boolean> If you want to receive notifications when user receives a Bounty reward | ||
* `rewards` <object, array> List rewards for a Bounty campaign: cryptos and amounts | ||
|
||
* `welcome_string` <string> How to reply user in-chat, if first unknown command received | ||
* `help_message` <string> How to reply to */help* command. Recommended to put Bounty rules here | ||
|
||
## Launching | ||
|
||
You can start the Bot with the `node app` command, but it is recommended to use the process manager for this purpose. | ||
|
||
``` | ||
pm2 start --name bountybot app.js | ||
``` | ||
|
||
## Add the Bot to cron | ||
|
||
``` | ||
crontab -e | ||
``` | ||
|
||
Add string: | ||
|
||
``` | ||
@reboot cd /home/adamant/adamant-bountybot && pm2 start --name bountybot app.js | ||
``` | ||
|
||
## Updating | ||
|
||
``` | ||
su - adamant | ||
cd ./adamant-bountybot | ||
pm2 stop bountybot | ||
mv config.json config_bup.json && git pull && mv config_bup.json config.json | ||
npm i | ||
pm2 start --name bountybot app.js | ||
``` |
Oops, something went wrong.