A stupid slack bot for printing fake very real money.
Buckaroo Banzai acts as the central bank for your very own crypto token. For
this document we'll use CRYPTICBUCK
, but you can name it whatever you like.
Buckaroo can create, transfer, withdraw, and deposit these tokens into your
"bank" account, which can be accessed via slack.
The tokens are printed from thin air, and are worth only what you believe they are (so, quite a lot!)
Buckaroo will listen in on all slack channels he's invited to, and everytime he sees an emoji reaction has been added to someone's message, he creates and gives that person one token.
Tokens can be transferred between slack users without involving the stellar blockchain.
Tokens are kept in the slack bank until a user decides to withdraw them. Upon doing so the tokens are removed from the bank and issued to the stellar address the user specified.
(This is that transaction.)
Once withdrawn, tokens can be deposited back into the slack bank by sending them to a federated stellar address.
Here's what it looks like when a deposit has been successful:
Clone the repo and go build ./cmd/buckaroo-banzai
, or use the
mediocregopher/buckaroo-banzai
docker image.
There's a bit of setup involved, you'll need:
-
One stellar address, and its seed, with a few lumens (XLM) already deposited. XLM is used to pay network fees when someone withdraws their tokens. The fees aren't very much, so a few XLM should last a while.
-
A redis instance (or two) set up.
-
A domain pointed at the IP address Buckaroo will be listening on. This will be your stellar federation domain.
-
A slack token for the bot.
-
An open heart.
Buckaroo is configured either via CLI or environment variables. Here are the options used for the bot we run:
./buckaroo-banzai \
--currency-name CRYPTICBUCK \
--currency-emoji ":crypticbuck:" \
--slack-token xxx \
--stellar-seed xxx \
--stellar-token-name CRYPTICBUCK \
--stellar-http-net-listen-addr :8000 \
--stellar-domain xxx.com \
--stellar-live-net
See the ./buckaroo-banzai -h
output for descriptions of the options, and more
available options as well.
Buckaroo Banzai needs at least one running redis instance to function, and by
default will try to connect to one over localhost. There are actually two
different configuration parameters for redis addresses, --bank-redis-addr
and
--stellar-redis-addr
, corresponding to the different components of Buckaroo
which need redis for independent purposes. You may create two separate redis
instances for these components, or have them use the same one, it's up to you.
Since stellar is a bit of a pain to work with, especially on linux where there's
currently no good clients which can connect to the test net, I developed a small
utility called stellar-cli
which can do most necessary stellar operations from
the command-line.
stellar-cli
stores no state locally, and is completely configured via
command-line or environment variables. It may be useful at least for generating
a new stellar seed for use with Buckaroo.
You can build stellar-cli
by cloning the repo and go build ./cmd/stellar-cli
.