Repository
https://github.com/quochuy/pocketjs
What is the project about?
POCKET stands for Proof Of Concept Electronic Token (the K is silent).
POCKET is a project by @biophil. In a nutshell, it is a cryptocurrency that uses the STEEM blockchain as a base. It uses STEEM comments to execute commands such as sending tokens and confirming them.
The distribution of POCKET tokens has already stopped but many people still own some tokens and distributing them as tips via comments.
I started this project after seeing @sn0n asking @biophil if the project exists in Javascript on the following post:
https://steemit.com/pocket/@biophil/pocket-announcement#@sn0n/re-biophil-pocket-announcement-20180112t011307004z
The original implementation of the POCKET confirmer was developed with Python.
Screenshots
Here is a screenshot of @pode sending some POCKET to @dmaniabot via a comment. The transaction was then confirmed by @pocketjs
Here is the activity logs from the bot:
Here is a recent activity logs from https://steemd.com/@pocketjs:
Technology Stack
- Javascript
- NodeJS
- dsteem
- JSON format for the file-based database
- Docker + Docker Compose
Installation
Using GIT, clone the repository: git clone https://github.com/quochuy/pocketjs.git
Customizing the config file
- make a copy of
bot/config/config.distrib.json
and name itconfig.json
- edit the file and update set
confirmer_account
to your bot's Steem account username andconfirmer_key
to your bot's Steem private posting key - you might want to also set
mode.test
to true andmode.debug
to1
or2
to increase log verbosity.
Once the confirmer is caught up with the head of the blockchain, you can set confirmation_active
to true.
Running with NodeJS
You need to install NodeJS and then run the bot:
cd /path/to/project/bot
node confirmer.js
Running with Docker
You will need to install Docker and Docker Compose first then build the bot:
cd /path/to/project/bot
docker-compose build
Once the build is successful, you can run the bot with: docker-compose up -d
Check the logs with: tail -f bot/logs/bot.log
Generating a DB snapshot from an existing running Python confirmer
If you are already running @biophil's original confirmer written in Python and would like to help test this project, you can generate your own DB snapshot by copying the following file under the same directory as the blockchain_reader.py file:
https://github.com/quochuy/pocketjs/blob/master/bot/utils/convertDb.py
Then just run: python3 convertDb.py
and this will generate a db.json
file that you can just move into the bot/database/
directory of the POCKET-JS project.
Roadmap
The current version has been running fine for a couple of weeks already under @pocketjs but there are still few missing features:
- replaying from block #1
- replaying from Genesis
- upvoting confirmation comments from other confirmers
- rotate RPC nodes in case of connection issue
- don't upvote or send confirmation comment until the replay reaches the head of the blockchain to prevent upvote/comment spamming
To run this script, it requires a post-genesis snapshot of the database. The GIT repository is currently hosting a DB snapshot as of 2018-07-06 at 6:00 pm AEST.
Ideas for extra features:
- add an extra command (not part of the protocol) to allow requesting for an account balance:
pocketbalance@user
- create a simple blockchain explorer for POCKET
How to contribute?
Please contact me on Discord, my username is QuocHuy [witness]#4676
It's nice to revive project and not let them decay!
Let's hope it will be used :p
Let's go for the review:
Since the account doesn't have much Steems on it I'll write it: https://github.com/quochuy/pocketjs/commit/aefd1a49738bf72c926201b7da04e735ec25e42d#diff-e22b50e740e102c8de5e858dbcd7753dL6 => Never ever post your private keep! Github archives everything :p. You better change it now :D
https://github.com/quochuy/pocketjs/blob/master/bot/confirmer.js#L56 => Any particular reason for not using
&&
since you don't have anyelses
?https://github.com/quochuy/pocketjs/tree/master/bot/test => You have a lot of tests and there are not useless this is awesome !
https://github.com/quochuy/pocketjs/commit/92f21722b6b30d12fdff588407789f55cf3a1a66 => Try to do a better job about your commits ha ha,
can't remember... :-P
,misc
this is not serious, or havingValidator
orAdd config
twice. You can be more precise. Good comments are free!It's nice to add a docker config. Really cool.
This a great job overall!
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
@gregory.latinier ARG! I thought I filtered out that from the history already! Thanks for letting me know!
And thanks for the very thorough review!
That was fast. Congrats @quochuy <3
To answer the other questions:
Thanks again @gregory.latinier
Hey @quochuy
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by QuocHuy [witness] from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.
@quochuy
Thanks for the information
Thx for this article! really interesting.
that follow the projects that make us grow more on the platform
pocketsend:11@steemulant,test
Successful Send of 11
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1024
New receiving account balance: 438
Fee: 1
Steem trxid: f31af5cd19747f24748861cef6aac54dc9c23be2
Thanks for using POCKET! I am running this confirmer code.
Successful Send of 11
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1024
New receiving account balance: 438
Fee: 1
Steem trxid: f31af5cd19747f24748861cef6aac54dc9c23be2
Someone sent you some POCKET tokens. POCKET is an experimental sub-token system which operates on the Steem blockchain. It's like having a custom token without SMT. You can also send some to someone else by just commenting on a post with the following command:
pocketsend:number_of_token@recipient_name,memo
for example to send 10 tokens to @pocketjs, make a comment starting with:pocketsend:10@pocketjs,This is a gift
I am running Pocket-JS confirmer code. by Steem Witness @quochuy
pocketsend:11@steemulant,test
Successful Send of 11
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1013
New receiving account balance: 448
Fee: 1
Steem trxid: edd1a6886e132bcfce806a5fc9fffdfb60b49fd3
Thanks for using POCKET! I am running this confirmer code.
Successful Send of 11
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1013
New receiving account balance: 448
Fee: 1
Steem trxid: edd1a6886e132bcfce806a5fc9fffdfb60b49fd3
Someone sent you some POCKET tokens. POCKET is an experimental sub-token system which operates on the Steem blockchain. It's like having a custom token without SMT. You can also send some to someone else by just commenting on a post with the following command:
pocketsend:number_of_token@recipient_name,memo
for example to send 10 tokens to @pocketjs, make a comment starting with:pocketsend:10@pocketjs,This is a gift
I am running Pocket-JS confirmer code. by Steem Witness @quochuy
pocketsend:2@steemulant,test
Successful Send of 2
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1011
New receiving account balance: 449
Fee: 1
Steem trxid: 727c155978762036bb2913858b9ed211582133c0
Thanks for using POCKET! I am running this confirmer code.
Successful Send of 2
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1011
New receiving account balance: 449
Fee: 1
Steem trxid: 727c155978762036bb2913858b9ed211582133c0
Someone sent you some POCKET tokens. POCKET is an experimental sub-token system which operates on the Steem blockchain. It's like having a custom token without SMT. You can also send some to someone else by just commenting on a post with the following command:
pocketsend:number_of_token@recipient_name,memo
for example to send 10 tokens to @pocketjs, make a comment starting with:pocketsend:10@pocketjs,This is a gift
I am running Pocket-JS confirmer code. by Steem Witness @quochuy
pocketsend:2@steemulant,test
Successful Send of 2
Sending Account: quochuy
Receiving Account: steemulant
New sending account balance: 1009
New receiving account balance: 450
Fee: 1
Steem trxid: 5637ac529890d3a8ddcdd44cd2fd7b803e91a678
Someone sent you some POCKET tokens. POCKET is an experimental sub-token system which operates on the Steem blockchain. It's like having a custom token without SMT. You can also send some to someone else by just commenting on a post with the following command:
pocketsend:number_of_token@recipient_name,memo
for example to send 10 tokens to @pocketjs, make a comment starting with:pocketsend:10@pocketjs,This is a gift
I am running Pocket-JS confirmer code. by Steem Witness @quochuy
pocketsend:400@quochuy
Successful Send of 400
Sending Account: steemulant
Receiving Account: quochuy
New sending account balance: 50
New receiving account balance: 1408
Fee: 1
Steem trxid: 8c01de2469c409ab1093ad02fdcdae58f514fe19
Someone sent you some POCKET tokens. POCKET is an experimental sub-token system which operates on the Steem blockchain. It's like having a custom token without SMT. You can also send some to someone else by just commenting on a post with the following command:
pocketsend:number_of_token@recipient_name,memo
for example to send 10 tokens to @pocketjs, make a comment starting with:pocketsend:10@pocketjs,This is a gift
I am running Pocket-JS confirmer code. by Steem Witness @quochuy
pocketsend:750@quochuy
Successful Send of 750
Sending Account: pocketjs
Receiving Account: quochuy
New sending account balance: 44
New receiving account balance: 2157
Fee: 1
Steem trxid: 270299ff3460d07fb4358077e8dcff5a175681ef
Someone sent you some POCKET tokens. POCKET is an experimental sub-token system which operates on the Steem blockchain. It's like having a custom token without SMT. You can also send some to someone else by just commenting on a post with the following command:
pocketsend:number_of_token@recipient_name,memo
for example to send 10 tokens to @pocketjs, make a comment starting with:pocketsend:10@pocketjs,This is a gift
I am running Pocket-JS confirmer code. by Steem Witness @quochuy