Auctionbot: vpatch and manifest

patch: logbot_command_router_python_auction.vpatch

signers: lobbes

This vpatch extends logbot command router to add auction functionality and builds upon the Keccak regrind of the botworks V tree. As I understand it, here is what that tree looks like today with the addition of this vpatch:


Press logbot_command_router_python_auction via your preferred V:

mkdir botworks; cd botworks; mkdir .wot

#You'll need the keys for both lobbes and spyked in .wot

vk.pl init http://lobbesblog.com/src/botworks/

vk.pl p v logbot_command_router_python_auction logbot_command_router_python_auction.vpatch

From the INSTALL:



After pressing and assuming you have already configured the command router (see the parent README), all you need to do is run the auctionbot.sql against the postgres database used by the command router. This will create all of the auction tables (they all will be prepended with "auct_"). From there, just start up the command router (i.e. ./main.py) and all of the auction commands should function (creating auctions, bidding, etc.)


su postgres -c 'psql -f auctionbot.sql postgres'



This bot does not have a SCHEDULER baked in (for e.g. listing auctions out in a channel every X hours). This was intentional, as I wanted to leave that portion up to the operator.

Nevertheless, it is CRUCIAL you schedule a recurring call of at least the 'resolve' command, as this will ensure all of the auctions are properly resolved and closed as they expire. I recommend calling this once every minute.

How I have personally handled this is I have a few cron jobs that run INSERT statements against the postgres database every X interval. Examples below.

-Example SQL to essentially call the 'list' command 'from' #lobbestest:

INSERT INTO log(target, message, source) VALUES ('#lobbestest','?Xlist','auct_cron');

What this does is insert a record into the log table used by the parent logbot. The command router sees this as the command 'list' coming from '#lobbestest' issued by the nick 'auct_cron', and responds by listing in that channel.

Some may see this as 'tainting' the log table with 'false' loglines, but if you are thoughtful about it you can make it so those records can be easily filtered out of, say, a logotron's display (a 'reporting' database ought to be separate from a 'production' database anyways, imho).

-Then I simply add these 'one-liner' sql scripts to run on a cron job. Here's one of my crontabs, for example:

* * * * * su postgres -c 'psql -f /home/lobbes/auctionbot/auct_schedule_cmd_resolve.sql postgres'

0 * * * * su postgres -c 'psql -f /home/lobbes/auctionbot/auct_schedule_cmd_list_lobbestest.sql postgres'

0 */5 * * * su postgres -c 'psql -f /home/lobbes/auctionbot/auct_schedule_cmd_list_eulora.sql postgres'

0 */5 * * * su postgres -c 'psql -f /home/lobbes/auctionbot/auct_schedule_cmd_list_pizarro.sql postgres'

0 */5 * * * su postgres -c 'psql -f /home/lobbes/auctionbot/auct_schedule_cmd_list_trilema-lobbes.sql postgres'

From the manifest:

424545 ircbot-genesis trinque ircbot genesis, http://trinque.org/2016/08/10/ircbot-genesis/
424689 logbot-genesis trinque logbot genesis, http://trinque.org/2016/08/11/logbot-genesis/
447104 ircbot-logbot-multiple-channels-corrected ben_bulpes multiple channel support for ircbot and logbot, http://cascadianhacker.com/correction-multiple-channel-patches-for-irclogbot
539566 logbot_command_router_python_genesis lobbes logbot command router for python, http://blog.lobbesblog.com/2018/09/logbot_command_router_python-genesis/
573368 logbot_command_router_python_auction lobbes auction commands for logbot command router, http://blog.lobbesblog.com/2019/04/auctionbot-vpatch-and-manifest/

Leave a Reply