Repository
https://github.com/nirvanaitsolutions/promo-bot
New Projects
What is the project about?
The Swapsteem promo bot is a service designed for promotion of the Swapsteem platform to steem users, however it can be forked and used by anyone willing to promote their account/application/service on the steem blockchain. The related task request by can be found here.
As shown in the below code from this commit,The promo-bot, listens to incoming and outgoing transfers for certain target accounts(Competitors) and sends promotional message to the party using the target accounts' services with a transfer of 0.001 STEEM/SBD and predefined memo.
// stream transactions from the blockchain
const stream = client.blockchain.getOperationsStream({mode: dsteem.BlockchainMode.Latest})
console.log(`Following ${ TARGET_ACCOUNT } For New Transfers`)
// the stream will emit one data event for every operation that happens on the steemit blockchain
stream.on('data', (operation) => {
// we only care about transfer operations made to and from the user we follow
if (operation.op[0] == 'transfer') {
let transfer = operation.op[1]
if (transfer.to === TARGET_ACCOUNT) {
console.log(`${ transfer.from } sent money to ${ transfer.to }`)
//TODO - Check for Transfers from other exchange accounts and skip promotion
// broadcast the promotional transfer to the network
client.broadcast.transfer({
amount:'0.001 SBD',
from:PROMOTER,
to:transfer.from,
memo:TRANSFER_MEMO
},key).then(
console.log("promoted to "+transfer.from)
).catch((error) => {
console.warn('transfer failed', error)
})
}
if (transfer.from === TARGET_ACCOUNT) {
console.log(`${ transfer.from } sent money to ${ transfer.to }`)
//TODO - Check for Transfers to other exchange accounts and skip promotion
// finally broadcast the vote to the network
client.broadcast.transfer({
amount:'0.001 SBD',
from:PROMOTER,
to:transfer.from,
memo:TRANSFER_MEMO
},key).then(
console.log("promoted to "+transfer.from)
).catch((error) => {
console.warn('transfer failed', error)
})
}
}
})
Technology Stack
This bot uses Node.JS as the server and Dsteem library for communication with the steem blockchain.
Roadmap
Currently, the bot is designed specifically for Swapsteem, but I am planning to make it more generalized and configurable for different promotion strategies. The roadmap for next releases is
- Add feature to follow multiple target accounts
- Add feature to skip balcklisted accounts
- Add feature to store promoted accounts in database
- Add filter to only promote to an account only once a week
- Add check for Promotion balance and budget.
How to use and contribute?
- Create an .env file in the root of the project
- Define the env varaibles with help of example.env
- Run npm start
- Add features to existing code
- Create a PR