Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - sahkan

Pages: [1]
1
It has recently came to my attention that users have issues with their connection speed (latency) - https://bitsharestalk.org/index.php/topic,24056.0.html

Here are some steps that everyone can take to improve their wallets:

USERS

Using graphics by FAV:


In either Light Wallets (downloads) or web wallets go to SETTINGS, ACCESS and click ADD API, add the following two servers one at a time:
wss://dexnode.net/ws
wss://altcap.io/ws
wss://node.market.rudex.org


WEB WALLET HOSTS:

Edit file:
~/bitshares-ui/web/app/api/apiConfig.js

and add:
Code: [Select]
{url: "wss://dexnode.net/ws", location: "Dallas, USA"},
{url: "wss://altcap.io/ws", location: "Paris, France"},
(url: "wss://node.market.rudex.org", location: "Germany"},

Recompile your build.

DEVS
If you have a minute please add above to https://github.com/bitshares/bitshares-ui/blob/bitshares/web/app/api/apiConfig.js

If anyone else is running a full node with a secure websocket access please post here so we can get the list of access points growing.



2
Technical Support / Setting Up a Price Feed [BTS Tools]
« on: April 25, 2017, 11:23:17 pm »
Setup your Ubuntu server:
https://bitsharestalk.org/index.php/topic,24005.0.html

Setup your bitShares node:
https://bitsharestalk.org/index.php/topic,23925.0.html

I did some testing, reading and browsing through different price feed scripts and ended up picking wackou's BTS Tools.
Here are some of the options:
Latest by xeroc: https://github.com/xeroc/bitshares-pricefeed
This one by Alt: https://pypi.python.org/pypi/btsprice
And wackou's BTS Tools:  https://pypi.python.org/pypi/bts_tools/0.4.10

You will need to create an api access file for BTS Tools to interact with your node so let's start with that:

SSH to your server
You will need to get a hash for your witness' password:
Code: [Select]
$ python bitshares-core/programs/witness_node/saltpass.py
enter your password (for example: supersecret) and you will get your hash & salt, like so:
 {
            "password_hash_b64" : "9e9GF7ooXVb9k4BoSfNIPTelXeGOZ5DrgOYMj94elaY=",
            "password_salt_b64" : "INDdM6iCi/8="
  }


Now move back to the directory where you want your api access file to be at, for example your home directory:
Code: [Select]
$cd
Create your api access file:
Code: [Select]
$nano api_access.jsonEnter:
{
   "permission_map" :
   [
      [
         "YOUR_WITNESS_NAME",
         {
            "password_hash_b64" : "9e9GF7ooXVb9k4BoSfNIPTelXeGOZ5DrgOYMj94elaY=",
            "password_salt_b64" : "INDdM6iCi/8=",
            "allowed_apis" : ["database_api", "network_broadcast_api", "history_api", "network_node_api"]
         }
      ]
   ]
}


Save & Exit.

Edit the node config file and add the location for your api access file:
Code: [Select]
$nano bitshares-core/witness_node_data_dir/config.ini
find:
api-access =
and modify:
api-access = /home/muLinuxUser/api_access.json

Save & exit

Installing BTS Tools:
Install dependencies:
Code: [Select]
$sudo apt-get install build-essential libyaml-dev python3-dev python3-pip
Install tools:
Code: [Select]
$ pip3 install bts_tools
Verify installed version: (it should also create a default config.yaml file for you):
Code: [Select]
$bts - version
Edit your config.yaml file:
Code: [Select]
$nano .bts_tools/config.yaml# For a more detailed description of the format of this file, visit:
# https://bts-tools.readthedocs.io/en/latest/config_format.html
#

# (OPTIONAL) will show this hostname as the source of notification messages
hostname: <your-host-name>

# the logging levels for the different submodules
# can be any of DEBUG, INFO, WARNING, ERROR
logging:
    bts_tools.feeds: INFO

# flags to be passed to make; shared among all build environments
make_args: ['-j4']

#
# list of clients (witness accounts / seed nodes) that are being monitored
#
clients:
    bts:
        type: bts
        data_dir: ~/.BitShares2
        witness_host: localhost
        witness_port: 8090
        # api_access.json should be created according to:
        # https://github.com/BitShares/bitshares-2#accessing-restricted-apis
        witness_user: YOUR_WITNESS      # as in api_access.json
        witness_password: supersecret  # as in api_access.json
        wallet_host: localhost
        wallet_port: 8093
        wallet_password: changeme!  # only needed for feed publishing
        notification: email
        roles:
        -
            role: witness
            name: xxxxxxxxx
            witness_id: 1.6.xxxx
            signing_key: 5xxxxxxxx
        -
            role: feed_publisher
            name: xxxxxxxx
 
#
# configuration of the monitoring plugins
# global default when not overriden by a role's specific params
#
monitoring:
    seed:
        desired_number_of_connections: 200
        maximum_number_of_connections: 400

    feeds:
        enabled_assets: [RUBLE, BTWTY, ALTCAP]
        disabled_assets: [RUB, SEK, GRIDCOIN, TCNY, CASH.BTC]  # black swan
        check_time_interval: 300
        median_time_span: 1800
        #publish_time_interval: 2400         # use this to publish feeds at fixed time intervals (in seconds)
        #publish_time_slot: 0                # use this to publish every hour at a fixed number of minutes (in minutes)
        feed_providers: [Poloniex, Btc38, Yunbi,    # BTS valuation
                         Yahoo, Google, Bloomberg]  # market indices

#
# configuration of the notification channels
#
notification:
    email:
        smtp_server: smtp.example.com
        smtp_user: user
        smtp_password: secret-password
        identity: "BTS Monitor <[email protected]>"
        recipient: [email protected]

    boxcar:
        tokens: []

    telegram:
        token: 'xxxxxxxxxxxxxxxx'
        chat_id: 12341234


Save & exit
For production deployments, it is recommended to put it behind a WSGI server, in which case the entry point is bts_tools.wsgi:application
You can set it up according to wackou's docs:
https://bts-tools.readthedocs.io/en/latest/monitor.html

Start your witness node,
Start CLI, unlock it and import feed key for BTS Tools:
Code: [Select]
import_key "announce" 5KJJNfiSyzsbHoVb81WkHHjaX2vZVQ1Fqq5wE5ro8HWXe6qNFyQ
verify your signing key and witness info:
Code: [Select]
get_witness YOUR_WITNESS_NAME
run the BTS Tools monitor:
Code: [Select]
$bts monitor
and you are all set!

To update your BTS Tools to a new version:
Stop the monitor (CTRL-C) and upgrade:
Code: [Select]
$pip3 install --upgrade bts_tools
Edit config.yaml and adjust as required

Restart the monitor:
Code: [Select]
$bts monitor













3
General Discussion / Non Voting Accounts
« on: April 18, 2017, 05:19:33 am »
Can anyone explain how the non-voting accounts are selected?

For example poloniexcoldstorage is a non-voting exchange account but yunbi-cold-wallet is a voting account. I was trying to research that but can't seem to find any governance on the network for these.

4
General Discussion / Professional Price Feeds for DEX
« on: April 16, 2017, 12:37:29 am »
Team,

First off, Happy Easter everyone!

My witness got voted in to the active witnesses list recently and I started to pay more attention to the price feeds.
Clearly we should put some governance in place to get some consistency. For example:
1. What is the list of required asset feeds for the witnesses? (Some do 6 some 22, some in between)
2. What is the minimum frequency for posting the feeds (1 hour?)
3. What are the required sources? (If any)

I hope we can get the witnesses involved (both active and standby) and work this out with community's input.

I also see a need for a professional feed, I think it would be a positive thing for DEX. Since the price feed script was not originally developed with Graphene, there are few scripts out there that do the job.
I would be willing to pay for an Enterprise level subscription Plan from a provider like https://currencylayer.com/ and provide the feed to all active witnesses if everyone was willing to update their scripts and come up with a price feed schedule that would provide consistent price updates on DEX.

As far as the implementation timeline, early May would be a good target date as I know some of the guys are busy at work.

Also, since we have an international community here and some witnesses are not fluent in English, please have this translated for them if they are your friends. Let me know your thoughts!

5
The intend of this checklist/guide is to lay out basic steps in securing your Ubuntu server (fresh VPS or Dedicated server) and getting it ready for a BTS node (see, full or witness). Keep in mind that there is more than one way to get things done in Linux so just pick your favorite. I would also appreciate any comments/tweaks from other admins to improve this guide and increase security of our servers (especially any new findings that might come out after I post this).

- Install Ubuntu Server 16.04 (or have it installed and get root access)

-Log in to your server as the root user.
Code: [Select]
$ssh [email protected]_ip_addressor use PuTTy or other SSH client of your choice

- Check your server installation:
Code: [Select]
# lsb_release -a
-Check what was installed:
Code: [Select]
#apt list --installed
- Update:
Code: [Select]
#apt update
- Take a look at your sources list:
Code: [Select]
#cat /etc/apt/sources.list
Now head over to:
https://repogen.simplylinux.ch/
Fill in your information and have it generate the official Ubuntu Repos for you

Here is an example:

#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS            #
#------------------------------------------------------------------------------#


###### Ubuntu Main Repos
deb http://01.archive.ubuntu.com/ubuntu/ xenial main universe
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial main universe

###### Ubuntu Update Repos
deb http://01.archive.ubuntu.com/ubuntu/ xenial-security main universe
deb http://01.archive.ubuntu.com/ubuntu/ xenial-updates main universe
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial-security main universe
deb-src http://01.archive.ubuntu.com/ubuntu/ xenial-updates main universe


Now if needed added the sources to your source list:
Code: [Select]
#nano /etc/apt/sources.list
(Note: To save in nano use CTRL-O, Enter and CTRL-X to exit - there are plenty of other editors there, I like nano)

-Now lets update and upgrade as required:
Code: [Select]
#apt-get update
#apt-get upgrade

- Change root password (You should change the password to something complex for the root)
Code: [Select]
#passwdThen enter your password at each prompt requesting it. Done.

-Now lets create a new Sudo user:
Use the adduser command to add a new user to your system.
Code: [Select]
#adduser username(for example: adduser sahkan)
Set and confirm the new user's password at the prompt. A strong password is highly recommended!

Set password prompts:
Enter new UNIX password:
Retype new UNIX password
:
passwd: password updated successfully
Follow the prompts to set the new user's information. It is fine to accept the defaults to leave all of this information blank.

User information prompts:
Changing the user information for username
Enter the new value, or press ENTER for the default
    Full Name []:
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
Is the information correct? [Y/n]


- Now lets add our new user to the sudo group:
Code: [Select]
#usermod -aG sudo username
By default, on Ubuntu, members of the sudo group have sudo privileges.

- Test sudo access on new user account - use the su command to switch to the new user account.
Code: [Select]
#su  username
As the new user, verify that you can use sudo by prepending "sudo" to the command that you want to run with superuser privileges. For example, you can list the contents of the /root directory, which is normally only accessible to the root user.
Code: [Select]
$sudo ls -la /rootThe first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.

[sudo] password for username:
If your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.

If all went well, logout from the server and ssh back in as your new user

-Now you want to prevent root logins to SSH, which can leave your computer vulnerable to brute force login attempts to the root account.
Code: [Select]
$sudo nano /etc/ssh/sshd_config
Scroll down (with your keyboard down arrow key) until you see "PermitRootLogin yes", or hit "Page Down" once to get there.
Replace the "yes" with "no". No quotes.
PermitRootLogin no

Save & exit.

Now restart SSH with:
Code: [Select]
$sudo service ssh restart
- Change the SUDO configuration to require the root password
Code: [Select]
$sudo visudoThis will open the "/etc/sudoers" file.
In /etc/sudoers, add this line:
Defaults rootpw

Now follow this guide and pick what you require:
https://www.thefanclub.co.za/how-to/how-secure-ubuntu-1604-lts-server-part-1-basics

NOTE: #5. Protect su by limiting access only to admin group (from the link above) Will restrict your use of su. To reverse it (if you want to use su) execute the following:
Code: [Select]
$sudo dpkg-statoverride --remove /bin/su
$sudo chmod 4755 /bin/su

- Now to get ready for the node install, install boost (from your home directory in this case):
Code: [Select]
$export BOOST_ROOT=$HOME/opt/boost_1_57_0
$sudo apt-get update
$sudo apt-get install autotools-dev build-essential \
                     g++ libbz2-dev libicu-dev python-dev
$wget -c 'http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.bz2/download'\
     -O boost_1_57_0.tar.bz2
$sha256sum boost_1_57_0.tar.bz2

Check for the correct hash:
# "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967"

-Install it:
Code: [Select]
$tar xjf boost_1_57_0.tar.bz2
$cd boost_1_57_0/
$./bootstrap.sh "--prefix=$BOOST_ROOT"
$./b2 install


- And now you can use my other guide to build your node:
https://bitsharestalk.org/index.php/topic,23925.0.html

6
Stakeholder Proposals / [Witness Proposal] sahkan-bitshares
« on: April 13, 2017, 11:28:39 pm »
Witness proposal for: sahkan-bitshares


Dedicated Production Server with my Witness runs in New York:



Hardware:
Dell PowerEdge Dual Dual Xeon X5650 Hexa-Core CPUs  - 24 Cores @ 2.66 GHz
64 GB of RAM
240 GB SSD

Data Center:
1 Gbit (GigE) Network Port - Unmetered Bandwith
Network Uptime Guarantee: 100%
Power Uptime Guarantee:   100%
100% GREEN data center

Current Performance Snapshot:



Targeted Lifecycle: 2 years (12 months already paid for)

Seed/Backup/Test node runs in Hawaii:
Currently 8 Core, 16GB RAM, 2TB HDD


Price Feed: BTS Tools v 4.9.0 (Thanks to [member=6601]wackou[/member] )
                    I have disabled Yanubi feeds based on some conversations on the forum. If this needs to be enabled I need an active witness to confirm this for me.

A fair amount of work has been done in the past few weeks learning Bitshares (graphene)  and getting everything aligned properly to launch my witness proposal. It’s extremely important to provide a great service for the DEX users and continue to improve upon those services. I understand the responsibility to the Bitshares community and I am providing my Hardware to exclusively support DEX (I have no plans to run steem, muse or any other graphene nodes on my servers). I believe that we need to continue to build a robust platform infrastructure capable of handling heavy loads at a moment's notice.

Transparency:
- I am not affiliated with any other accounts on Bitshares (not running any other witnesses).
- Emergencies might happen (node upgrades due to bugs etc.) therefore I will provide my name, email, phone number and WhatsApp contact information to the following individuals if they ask for it:
1. Anyone with +100MLN votes for my witnesses
2. Key Developers and Committee Members
3. [member=31]fav[/member] because fav has strict roll calls and I don't want to miss them ;)
4. [member=37127]JonnyBitcoin[/member]
5. Or as required by future developments.

While it's a common fact that we have many highly qualified witnesses running for the (currently) 21 active witness spots it has got to be mentioned that not all witnesses are active, some of them run node versions that are +50 weeks old and are set up on dated VPS platforms. I am not asking for anyone to be voted down, I am just offering capable services to sustain DEX for the months to come either as a standby or active witness.

If you decide to vote on my witness please check my position at:
https://www.cryptofresh.com/witnesses and if your vote makes me an active witness please send me a PM so I can monitor it after the next maintenance window.
[Edit 14 APR 17: I got voted in last night, Thank you! All issues fixed]

I encourage others to get involved. I will put together some guides to hopefuly make it easier. Here is my first one:
https://bitsharestalk.org/index.php/topic,23925.0.html

7
Technical Support / Setting Up a New Witness Node
« on: March 26, 2017, 04:30:58 am »
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/fees

HW 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.html

Open terminal window and navigate to the directory where you want bitshares to download to as an example:
Code: [Select]
$ 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:]
Code: [Select]
$ 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:]
Code: [Select]
$ 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:
Code: [Select]
$ 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)
Code: [Select]
$ 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 [member=34707]rnglab[/member] 's below comments, the difference was the synch time to the blockchain - 12Hrs+]

Run your Full node without block production:
Code: [Select]
$ 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:
Code: [Select]
$ cd bitshares-core
Run CLI wallet:
Code: [Select]
$ 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:
Code: [Select]
>>> set_password G5rrzhZ6FCLI Responds:
null

Now unlock the wallet:
Code: [Select]
>>> 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:
Code: [Select]
>>> import_key sahkan GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8
Now check your balances in CLI:
>>> list_account_balances <accountname>

Eample:
Code: [Select]
>>> 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" true

Example:
Code: [Select]
>>> 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 true

Example:
Code: [Select]
>>> 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:
Code: [Select]
>>> 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:
Code: [Select]
>>> 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:
Code: [Select]
$ ./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:30


If 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() end



Here are some notes on installing and running my witness:  sahkan-bitshares

1. 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!

Pages: [1]