Introducing conductor, a simple Steem Witness Toolkit

in #steem8 years ago (edited)

conductor - Steem Witness Toolkit

conductor is a user friendly, KISS utility for creating, updating and management of your witness.

Install

Requirements:

  • Python 3.5 or higher
pip install -U git+https://github.com/Netherdrake/conductor

First Steps

conductor is built on top of steem-python, and leverages it's BIP38 encrypted wallet to store our witness Active key. This key is required for price feed updates.

To create the wallet, and add our key to it, simply run:

steempy addkey

Creating or importing your witness

conductor init

conductor will ask you for your witness (Steem account) name. If the witness already exists, it will import its current settings from the blockchain.

Otherwise, it will guide you trough the setup wizard, and create the witness for you.

Updating your witness

If you wish to change one or more of your witness properties, such as witness url, interest rate, block size, etc., you can do so using conductor update command.

~ % conductor update
What should be your witness URL? [https://steemdb.com/@furion/witness]:
How much should be account creation fee? [0.500 STEEM]:
What should be the maximum block size? [65536]:
What should be the SBD interest rate? [0]: 10

Configuration:
---------------
{'props': {'account_creation_fee': '0.500 STEEM',
           'maximum_block_size': 65536,
           'sbd_interest_rate': 10},
 'witness': {'name': 'furion', 'url': 'https://steemdb.com/@furion/witness'}}

Do you want to commit the updated values? [y/N]: n
Aborted!
~ %

Enabling your witness

Enabling your witness is as simple as setting a public signing key. This command can also be used for key rotation (for example, if you're falling back to a backup witness node).

To set a public signing key on your witness run:

conductor enable <PUBLIC_SIGNING_KEY>

Disabling a witness

Sometimes you might want to disable your witness yourself. For example, if you're upgrading your witness server, and don't want to miss any blocks.

To disable your witness run:

conductor disable

Kill Switch

Kill Switch is a witness monitoring utility, that tracks block misses. If your witness server bugs out, and stops producing blocks, this tool will automatically disable your witness to avoid further misses.

To run a killswitch, simply run:

conductor kill-switch

Optionally, we can provide number of blocks number of blocks we are allowed to miss before kill-switch disables our witness. We can achieve this by providing -n argument, like so: conductor kill-switch -n 25. By default -n is 10.

Price Feeds

Price feeds are a vital component of STEEM ecosystem, as they power SBD->STEEM conversions, as well as rewards estimates. Witnesses act as an oracle between the blockchain and real-world, by providing honest input on what the implied price of STEEM is. Furthermore, the prices may contain bias to loosely support the SBD stablecoin's peg to USD.

conductor ships with markets module from SteemData. This module interfaces with 3rd party exchanges to fetch VWAP (volume weighted average prices) mean (average of VWAP's from all exchanges) prices.

Exchanges Used:

  • Bitstamp, Bitfinex, Kraken, OKCoin, BTC-E for BTC/USD
  • Poloniex, Bittrex for STEEM/BTC and SBD/BTC

To run pricefeeds, simply run:

conductor feed

Usage

~ % conductor
Usage: conductor [OPTIONS] COMMAND [ARGS]...

  Steem Witness Toolkit.

Options:
  -h, --help  Show this message and exit.

Commands:
  disable      Disable a witness.
  enable       Enable a witness, or change key.
  feed         Update Price Feeds.
  init         Add your witness account.
  kill-switch  Monitor for misses w/ disable.
  status       Print basic witness info.
  tickers      Print Tickers.
  update       Update witness properties.

There are two additional, read only commands we haven't covered yet. status and tickers. They simply print some info for us.

Status

~ % conductor status
+---------+--------+-------------------------------------------------------+
| Enabled | Misses | Key                                                   |
+---------+--------+-------------------------------------------------------+
| True    | 105    | STM7WDG2QpThdkRa3G2PYXM7gH9UksoGm4xqoFBrNet6GH7ToNUYx |
+---------+--------+-------------------------------------------------------+

Tickers

~ % conductor tickers
| Symbol    |   Price |
|-----------+---------|
| BTC/USD   | 2444.31 |
| SBD/USD   |   1.804 |
| STEEM/USD |    1.19 |

License

MIT.

Pull requests are welcome.

Source: https://github.com/Netherdrake/conductor

DQmeBtkDw9J3evsQdzL4MNFepWxkdn55QUpvxz5dCGkzgWY_1680x8400.png

Sort:  

Impressive! Congrats! Seems like your last witness interruption led to something really good.

Yeah, I really had to invest some time into better infrastructure.

This is amazing. I've held off on running my own witness because I'm more of a programer than an OPS guy, but this is really tempting me to try it out.

Can you recommend a solid host for your witness? Roughly how much do you spend on hosting/bandwidth costs each month to keep your Witness up?

Thanks again for this fantastic resource. When it's this easy to get going, I think we'll always have plenty of witnesses in the Steemit ecosystem.

vultr.com Vitrual Private Server (vps). $40/mth for an 8gig ram system. I think that might work. Still figuring it out myself.

I use hetzner.de, I'm pretty happy with them.

Thanks for replying.

My company @privex offers a small 8GB VPS, perfect for witnesses, for just $30/mo - unlike other hosts, we guarantee you won't miss any blocks (assuming your witness is configured correctly, which we can help you with).

If you miss a block on our network, we'll refund you $2 for each block.

We also take STEEM, LTC, and BTC, unlike most big hosts :)

PM me on STEEMIT.CHAT if you're interested

Thanks, I may give that a shot! I like the idea of supporting a fellow Steemian and paying in STEEM currency.

I highly recommend contabo.com

Note that @furion did not mention: do not run these scripts on a machine you don't have physical control of, setting price feeds requires your active key.

i'm trying on contabo to install a witness node, without success. i can non update_witness in the wallet.

It's a complicated process. First you have to create a password for the wallet. Then you have to import a key.

By the way, not advisable to run the wallet on the contabo server, for security reasons, especially if you are relatively new to linux systems administration. You should build a docker image or run in a virtual machine, but only build the cli_wallet (the steemit github will at least get you that far.

After you import the key, then you have to generate the brain key, save that somewhere safe, the pubic key goes into the update_witness command and the private key goes into the config.ini.

But I'm not going to be able to help you any further than that, I'm too busy, and also, I am draining the blood out of l0k1 and feeding it to elfspice, and this account will be intentionally abandoned in the future. My life has started a new phase and it's back to the roots.

appreciable comment. going to follow you too :)

you could try omkhost.com

I've been up and running for just under two months as @lukestokes.mhth using @privex and I'm quite happy so far with it.

Nice! I'm gonna try it out!

So, I'm trying to do this as a non-programmer. I've run into a couple of issues. I setup a ubuntu 16.04 server with 8g of ram. I tried running the command you mention. It tells me I need pip. So, I installed pip, then it said I need to upgrade pip, so I upgraded pip, then it said I need setup tools. So, I used sude apt-get install python3-setuptools. Then I reran your code and it tells me-
"Could not import setuptools which is required to install from a source distribution. Please install setuptools."

What am I missing?

I don't recommend using OS Python for end user applications.

2 alternatives:
1.) Run in Docker
2.) Use Anaconda.

Anaconda is probably the easiest if you don't know Docker.

I keep forgetting :(
I have a few more goodies coming out soon, hopefully I get #steemdev into muscle memory.

Kind of late... but trying to set this to use. Looks very useful.

Working! =) nice tool. Now I need to create a docker for it. I have noticed that if the spread is too high... it kind of hangs no?

EDIT: Fixing my comment above. It does not hang. I was using it against a node that did not have the right API. And to be fair it actually does the other way around, which is, it only updates if the spread starts to increase.

This is awesome work, again! Thanks a bunch for sharing with us all! All for one and one for all. Namaste :)

All witnesses would have to agree on that interest rate though? Good tool; paging @klye.

Good page! I've actually got a few scripts similar to this I use to do my price feeds and failover to backup. :)

You can set any interest rate you like. In the end, the average of all witnesses input is taken.

Great work. For security, have you thought about a read only hard drive for the OS, Server, and data separate? Great work my friend @furion

nice :D I don't know what a witness is. Noob 101

We run the servers all over the world that produce the STEEM blockchain blocks which this site runs on top of. :)

Coin Marketplace

STEEM 0.21
TRX 0.25
JST 0.038
BTC 98320.57
ETH 3439.18
USDT 1.00
SBD 3.12