POCKET Day 10: How to run your own confirmation bot

in #pocket7 years ago


Total Supply update: 1,132 Genesis claims brings the total supply to 1,132,001,132 Pocket tokens. Claims are still trickling in!

How to run a confirmer bot

The setup is not extremely amateur-friendly, but I've seen worse. Two people have figured it out with minimal help from me. So it must not be that hard!

Here are basic instructions for Ubuntu 16.04, and I suspect they should work fine on most Linux distributions. I'm assuming you have the latest version of Python 3.5.

First, install the python steem library and clone the Pocket repo:

pip3 install steem
git clone https://github.com/biophil/pocket
cd pocket

(Here, if you're adventurous, you can switch to the develop branch and run that. As I'm writing this, Develop has the code which makes confirmer bots vote for valid confirmations, which will help improve the robustness of the system. I haven't fully tested that code, so it might give you surprising errors.)
Run the blockchain_reader.py script:

python3 blockchain_reader.py

The first time, it will exit with the error message FileNotFoundError: Please populate config.json file with relevant values.
So open config.json with your favorite text editor and fill in the following fields; I've included here @pocket-a's values:

"confirm_message": "Thanks for using POCKET! I am running [this confirmer code.](https://github.com/biophil/pocket)"
"confirmer_account": "pocket-a"
"confirmer_key": <your account's private Posting key>
"confirmation_active": true
"nodes": [""]

If you are running a local steemd node, the last one, nodes, should be set to ["localhost:8092"] (or whichever port you're running it on). Or, alternatively, you could give it a custom list of public nodes you want it to connect to; enclose each node in double quotes and separate by commas.

Once you've set up your config.json, you're ready to roll! Note: if you are not using a local steemd node, you may want to contact me for a recent snapshot of the Pocket database. Populating the database from scratch on public nodes probably takes a long time, since you have to scan the entire blockchain block-by-block. I'm running an experiment on that right now to see just how long.

Anyway, open a screen terminal and hit it:

screen [press Enter]
python3 blockchain_reader.py

How to see how the sync is going

Once you're running the blockchain_reader.py script, the code will scan through the entire Steem blockchain computing everybody's eligibility and looking for Pocket commands. To check its progress, run these python commands in another terminal window:

python3
>>> import util.db as db
>>> DB = db.Mist_DB()
>>> DB.last_parsed_block()
200

That tells us that it's gotten all the way up to Steem block 200! That's not very far; Steem has over 15,000,000 blocks as I'm writing this. If you want to check again later in that same Python session, run this:

>>> DB._load()
>>> DB.last_parsed_block()
200

Finally, once it gets to Genesis, you'll start seeing messages in your terminal about transactions coming through and if all is well, it'll start confirming for you.

Contact me here or on steemit.chat if you have any questions or if you need a database snapshot!

For more information

Sort:  

Thank you for posting

Thank you. :)

Thanks @biophil. Hoping to see more confirmer bots for pocket.

Me too! It hardly takes any resources at all to run one (couple MB of ram and an internet connection), and the more we have the better!

I'm running an experiment on that right now to see just how long.

Good, because I have to say pass. My daddy did some math and says our transfer limits could be too tight.

From now on, I will give free POCKET tokens to all those who make post related, quality comments on my posts!!! Of course that would be along with my upvotes. You can read more about it here: https://steemit.com/steemit/@siddartha/announcement-pocket-tokens-for-all-those-who-comment-on-my-posts
Enjoy!!

In the latest versions of the bot, the config.json should also have

"vote_on_valid_confs": true

Hey @biophil love the project.
I thought of "pocket watch".... 😉
Since i heard about it ive been trying to think of a case use. Heres an idea..... somehow attatch it to Dtube. If they can get it to run smoother. Since Dtube aims to be Steemit related. Maybe talk to dtube devolopers about adopting pocket token. Or attatching pocket on side of it. Kind of like a steem sub token...
Im not a coder but i do have a creative thought process. Good luck with the project. Keep it up and let me know if i can ever help in any way.

Heres a fun project i started using Pocket as the currency. https://steemit.com/sports/@jnjmarketing/new-sports-betting-on-steemit-first-of-it-s-kind
Sports betting. Any sport, any game, anytime.
Place your bet using pocket tokens.
Trying to help the cause!

I love Pocket Watch! It's fun for me to watch these projects get moving. Good luck with the sports betting thing!

Thanks. Just needs some case uses.
Im just happy to be a part of pocket.
Trying to do my little part in making your vision start walking. Amazing to be in such a positive community as steemit. And pocket is a prime example of what positive thoughts and energy can do when people combine talents and ideas on open source.
Hopefully more people will start using it and it will slowly start developing value. I think its going great. Still early. Another 2 weeks i think we will see more contests, giveaways, and use cases. Cant say thank you enough.

I am so green to the crypto world. Known about for years just never dove in till now.
So excuse my ignorance if this is plain dumb! Haha. After Pocket genesis is over and coin distribution is complete could we implement a stake program. I guess thats PoS.
Come to a consensus on numbers but lets say for example.... however many total coins were given at the end.... dbl that to give total max supply. Then lets say that half gets divied evenly based on token holdings of all pocket holders over a period of 5 years or something like that. Im familiar with finances and stocks, just not crypto language just yet. My crypto age coincides with my steem account. Which is only 31days old.

could we implement a stake program.

Hypothetically that would be possible, but what's the purpose? We'd need a good reason to turn on inflation.

The cool thing is that even if you can't convince me to do it, if you find a dev who's interested, you can just go fork pocket and create your own version that implements inflation.

Agreed. Im not the one to take that on. Just brainstorming. Would be a planned future. If we get everyone acknowledging it and using Pocket then kick in the stake to get people to accumulate creating demand. Obviously a long way away. Just like to discuss odd scenarios i guess.... thanks man!

Also. Conversation with those smarter than ones self can reward infinite wisdom.

Thank you! Maybe I'll try at my leisure to run my own bot.

What I've been waiting for
,,,,,Thanks so much

Regarding the pocket database, is each confirmation bot/person maintaining a full copy of the database, or just a subset (the transactions they personally confirmed)? Or is the database centrally stored somewhere? I haven't been able to work that out from the posts I've read so far.

Each bot has a full copy. Without the whole database, there's no way to be sure that a transaction is valid.

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 57740.57
ETH 3127.01
USDT 1.00
SBD 2.33