Dockerized + Pistonized version of clayop/steemfeed for Witnesses

https://blog.docker.com/wp-content/uploads/2013/08/KuDr42X_ITXghJhSInDZekNEF0jLt3NeVxtRye3tqco.png

As a brand new witness, I was having one hell of a time getting everything setup for my publish_feedscript. Everything I found needed a cliwallet running and serving a http rpc with my key in it. Unlocking and locking wallets felt a little insecure and I figured there had to be a better way. I started doing research on how we could do away with the cliwallet instance as a requirement and make it a standalone application.

After a half day of research, I forked clayop/steemfeed and creating a new version that no longer uses the cliwallet, but instead uses @xeroc's piston. It creates the signed publish_feed transactions and broadcasts them via the databaseapi rather than the wallet_api. I also wrapped it in a docker configuration for easier management. Special thanks to everyone (including @clayop) who worked on this project previously.

You can find my fork of this steemfeed publishing tool here: https://github.com/aaroncox/steemfeed

You can also view all of the changes I've made in this single commit.

Running

Installing Docker

I'm not going to go into detail about installing docker, there's plenty of documentation for that already. Just make sure docker works from your command line, docker info is a good command to see if you're connected properly.

Clone the Repository

Clone down the repository to the desired location:

git clone git@github.com:aaroncox/steemfeed.git

Configuration

The entire configuration is now controlled through a .env file that you'll create inside of the project. I've placed a template file, .example.env, in the root of the project that you can copy as a default. Copy the example to the proper place:

cp .example.env .env

Then open this file in your favorite editor. There are only 2 values you need to fill out:

  • feed_account: The account name of the witness account.
  • feed_wif: The WIF ACTIVE Private Key for the witness account. This is used to sign transactions.

There are plenty of other adjustable configuration options, all of which already have default values.

Run it

There are two ways to run this in docker:

Run in the foreground

If you'd like for this to be an active process on your machine, run this command:

docker-compose up

The output of the application will be displayed on your terminal window. To stop the process, use CTRL+C.

Run in the background (daemon)

If you'd like for this to be a background process on your machine, run this command:

docker-compose up -d

If you'd like to view it's logs, you should be able to just run:

docker logs -f steemfeed_app_1

To stop the background process:

docker stop steemfeed_app_1

Rebuilding the Docker image due to Code Changes

Since this is docker, the code has been copied in place during your first build. If you are modifying the code itself and need to rebuild the docker image, you can run:

docker-compose build

If you're actively developing and want to rebuild and run, just run:

docker-compose build && docker-compose up

That's it!

You've got a price feed updater running now. Feel free to suggest changes, fork my code, or submit some pull requests!

I'm pretty thrilled with how this all worked out, though there are still a few things that need to be done:

  • The two classes I added, Exchange_rate and Feed_publish will need to be implemented eventually (and properly) into the libraries provided by @xeroc.
  • Default values should probably be defined if the environmental variables are unset.
  • I cleaned up the dependancies as best I could, but there may still be some strays. I'm still relatively new to python.

Good luck witnessing!

$ 199.367 SBD
8