Quick Background: I have been on the crypto arena since 2013. A big fan of Peercoin and POS. I think we all have been waiting for a true decentralized exchange since creation of bitcoin technology. There is no doubt that PoW was a break through thinking in the early crypto stages I do not belive that is sustainable because of it's huge burden on the world's power grid (I believe currently equal to about 1/3 electricity consumption of Ireland). Recently I have decided to shift my focus to bitshares and since I like to support the crypto economy I would like to get involved with making the current infrastructure more stable.
Hopefully this short guide will enable more people to support the witness nodes.
COST: You have to be a lifetime member to run a witness node current cost:
17,612 BTS for a lifetime membership. And a cost to create a witness:
7,338 BTS, since you had to upgrade your node to a lifetime membership 5,870 BTS will be returned to you after 90 days and your final cost will be 1,468 BTS. You can check current fees at:
https://www.cryptofresh.com/feesHW Recommendation: There is no official recommendation. But what I found out is that ATM you should be OK with
8GB 16GB RAM and a reasonable CPU and with a current blockchain of about 7GB enough disk space to support it.
My Build: Ubuntu 16.04, 8 Cores at 3.6GHz, 16GB RAM and 1TB HDD
You will need a registered account in the network to get started.
Setup Steps:-Some basic steps to get your server secured before you install the node can be found here:
https://bitsharestalk.org/index.php/topic,24005.0.htmlOpen terminal window and navigate to the directory where you want bitshares to download to as an example:
$ cd /home/sahkan
Download your sources with git:
$ git clone https://github.com/bitshares/bitshares-2[10 APR 2017 Edit - On my production server I have changed this to reflect the latest bitshers github repo:]
$ git clone https://github.com/bitshares/bitshares-core
your sources are now downloaded to /bitshares-2 ; Since the repository makes use of so called submodules which are repositories on their own, you need to refresh those:
$ cd bitshares-2
$ git submodule update --init --recursive[10 APR 2017 Edit:]
$ cd bitshares-core
$ git submodule update --init --recursive
Install dependencies for your development toolbox:
$ sudo apt-get install gcc-4.9 g++-4.9 cmake make \
libbz2-dev libdb++-dev libdb-dev \
libssl-dev openssl libreadline-dev \
autoconf libtool git[10 APR 2017 Edit: I tested the install with the latest gcc (5.X) and it worked fine, so I adjusted the install of dependencies to reflect it:
$ sudo apt-get install gcc g++ cmake make \
libbz2-dev libdb++-dev libdb-dev \
libssl-dev openssl libreadline-dev \
autoconf libtool git
Now you can run cmake for configuration and compile with make: (Quick note here: I did not have to update boost, if you do, refer to bitshares docs)
$ cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release
$ make
Now you can test your install, run a full node to update the blockchain: (took me about 1.5 hrs or so...)
$./programs/witness_node/witness_node --rpc-endpoint="0.0.0.0:8090"Once your blockchain catches up CTRL-C to stop your node and you can move on to create a witness.
[10 APR 2017 Edit: On the production server I skipped this per
@rnglab 's below comments, the difference was the synch time to the blockchain - 12Hrs+]
Run your Full node without block production:
$ programs/witness_node/witness_node --rpc-endpoint 127.0.0.1:8090
Now
open a second terminal/SSH and and navigate to your bitshares directory:
$ cd bitshares-core
Run CLI wallet:
$ programs/cli_wallet/cli_wallet -s ws://127.0.0.1:8090
Your prompt will change to ">>>" indicating you are in CLI
Create password for your new CLI wallet:
>>> set_password <password>
null
Example:
>>> set_password G5rrzhZ6F
CLI Responds:
null
Now unlock the wallet:
>>> unlock G5rrzhZ6F
You can import the account name (owner and active keys) to be able to access your funds in BitShares 2.0:
>>> import_key <accountname> <owner wif key>(You can find your public and private keys in your light wallet under SETTINGS, ACCOUNTS, Click on the LOCK)
Example:
>>> import_key sahkan GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8
Now check your balances in CLI:
>>> list_account_balances <accountname>Eample:
>>> list_account_balances sahkan
If all done correctly It will list all your balances.
To become a witness and be able to produce blocks, you first need to create a witness object that can be voted in,
THE BELOW COMMAND WILL CHARGE YOUR ACCOUNT CURRENT WITNESS CREATION FEE:
>>> create_witness <accountname> "url-to-proposal" trueExample:
>>> create_witness sahkan "www. MyCoolBitshares .com" true
Now you need some votes for your new witness, so vote all your shares in:
>>> vote_for_witness <accountname> <accountname> true trueExample:
>>> vote_for_witness sahkan sahkan true true
You need to wait until the next maintenance interval until you can see your votes. Check the time left to the next maintenance here:
https://www.cryptofresh.com/ Once all the votes are tallied you can move on, check your witness id:
>>> get_witness <accountname>Example:
>>> get_witness sahkan
CLI responds with:
{
[...]
"id": "1.6.10",
"signing_key": "GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8",
[...]
}
Warning: dump_private_keys will display your keys unencrypted on the terminal, don’t do this with someone looking over your shoulder.
The id and the signing_key are the two important parameters, above. Let’s get the private key for that signing key with:
>>> dump_private_keys
CLI responds with:
[[
...
],[
"GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8",
"5JGi7DM7J8fSTizZ4D9roNgd8dUc5pirUe9taxYCUUsnvQ4zCaQ"
]
]
Now we need to start the witness, so shut down the wallet (ctrl-d), and shut down the witness (ctrl-c). Re-launch the witness, now mentioning the new witness 1.6.10 and its keypair:
$ ./witness_node \
--rpc-endpoint=127.0.0.1:8090 \
--witness-id '"1.6.10"' \
--private-key '["GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8", "5JGi7DM7J8fSTizZ4D9roNgd8dUc5pirUe9taxYCUUsnvQ4zCaQ"]'
Note: Make sure to use YOUR public/private keys instead of the once given above!
If you monitor the output of the witness_node, and get voted in to become an active node, you should see it generate blocks signed by your witness:
Witness 1.6.10 production slot has arrived; generating a block now...
Generated block #1500367 with timestamp 2017-03-05T20:46:30 at time 2017-03-05T20:46:30If you are not an active witness, you will simply see your node receiving transactions and blocks. And look for confirmation that you are running a witness node at start up:
1448052ms th_a witness.cpp:122 plugin_startup ] witness plugin: plugin_startup() begin
1448055ms th_a witness.cpp:127 plugin_startup ] Launching block production for 1 witnesses.
1448055ms th_a witness.cpp:138 plugin_startup ] witness plugin: plugin_startup() endHere are some notes on installing and running my witness:
sahkan-bitshares1. My 16GB RAM runs at 95% utilization, in comparison CPUs at 5% and Network around .5% [10 APR 2017, this now my seed node, witness runs on a 24 core 64GB dedicated server]
2. I am one of 56 witness nodes, only 19 are block producing (Active) I would say that it is extremely centralized ATM.
3. To vote yourself in as an active node as of today you need over 403mln votes, around $23MLN?
4. 11 Committee members control most of the votes and settings on the network, including voting in witness nodes.
My witness runs in NY (Dedicated server), See/backup/test node in Hawaii[10 APR 2017 Update],
if it ever goes active I will update this post with the MPA Price Feeds guide [10 APR 2017 Update - After working on this for few days and learning Bitshares I think I can write couple more guides without actually being an active witness, the setup should work it will just not publish any feeds until the witness becomes active].
Any feedback on fine tuning my witness will be appreciated and I will be grateful for any votes for witness
sahkan-bitshares!