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:
@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