Author Topic: Building BTS 2.0 in Ubuntu from scratch  (Read 3779 times)

0 Members and 1 Guest are viewing this topic.

Offline kuro112

created a watchdog script and a set of scripts to automate the building, deployment and updating of bitshares-2

will post once testing is complete.
CTO @ Freebie, LLC

Offline davidpbrown

> later ill post a followup on how to install the js gui

That would be really useful.. I have less time atm and don't want to read a manual, I'm just keen to make the transition to 2.0. Why are there no repositories or binaries available for 32bit Linux??.. Why is it not made simple; expecting every user to build seems a bit ridiculous. Last time I looked there was a web wallet, is that useful for import of keys to a wallet that can then be simply saved? Also, where is MoonStone upto now?
฿://1CBxm54Ah5hiYxiUtD7JGYRXykT5Z6ZuMc

Offline svk

If all you want to do is run a local node (no witness) then no modification of config is necessary. In order to enable local rpc access you can just launch like this: ./witness_node --rpc-endpoint " 127.0.0.1:8090"
Worker: dev.bitsharesblocks

Offline kuro112

you know i tried running a witness node unconfigured and imports  / lookups didnt work, on the other hand when registering a witness it worked, so im confused there slightly.
CTO @ Freebie, LLC

Offline cube

  • Hero Member
  • *****
  • Posts: 1404
  • Bit by bit, we will get there!
    • View Profile
  • BitShares: bitcube
Hey Kuro, welcome!

Thanks for putting up a nice write up.  If you are running it as a normal user and not as a witness (ie the role of being a witness), you do not need modify the config.ini file, and leave out the following:

Code: [Select]
note the section:
# Tuple of [PublicKey, WIF private key] (may specify multiple times)
private-key = ["PUBLICKEYHERE","PRIVATEKEYHERE"]

this should be specified with the public and private wif key of the witness you wish to enable, why or how this works I have no idea. hope you do x.x
ID: bitcube
bitcube is a dedicated witness and committe member. Please vote for bitcube.

Offline kuro112

Hey guys, im posting this here because while github and the docs have all this information separately, the github is out of date and both are kind of missing steps...

so I'm gonna compile the information that got me working on this system from building the software until I imported my wallets.

this tutorial assumes your running ubuntu 14.4 64bit with at least 2 gb of ram and 40 gb hdd space.

for the record most of this is here:
http://docs.bitshares.eu/installation/Build.html
but not all of it

lets start with dependencies because we we have all been at that point in compilation where were like wait wtf is doxygen

Code: [Select]
sudo apt-get install cmake make \
                     libbz2-dev libdb++-dev libdb-dev \
                     libssl-dev openssl libreadline-dev \
                     autoconf libtool git doxygen

next up is boost,

Code: [Select]
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
# "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967"
tar xjf boost_1_57_0.tar.bz2
cd boost_1_57_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install

a really important step here, especially if your env times out or something,

Code: [Select]
BOOST_ROOT=$HOME/opt/boost_1_57_0

I started with downloading the github test version a few times by mistake, boy was this embarrassing haha, so to save you the trouble this is the version you want:

Code: [Select]
git clone https://github.com/bitshares/bitshares-2
cd bitshares-2
git submodule update --init --recursive

now your ready to install it:

Code: [Select]
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .
make
*get a cup of coffe or something ur gonna be here a while*
make install

from here the most important thing you can do is configure your witness node, i cant tell you how vital this is!

a sample witness config:

Code: [Select]
# Endpoint for P2P node to listen on
# p2p-endpoint =

# P2P nodes to connect to on startup (may specify multiple times)
# seed-node =

# JSON array of P2P nodes to connect to on startup
# seed-nodes =

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =

# Endpoint for websocket RPC to listen on
rpc-endpoint = 127.0.0.1:8090

# Endpoint for TLS websocket RPC to listen on
# rpc-tls-endpoint =

# The TLS certificate file for this server
# server-pem =

# Password for this certificate
# server-pem-password =

# File to read Genesis State from
# genesis-json =

# Block signing key to use for init witnesses, overrides genesis file
# dbg-init-key =

# JSON file specifying API permissions
# api-access =

# Enable block production, even if the chain is stale.
enable-stale-production = false

# Percent of witnesses (0-99) that must be participating in order to produce blocks
required-participation = false

# ID of witness controlled by this node (e.g. "1.6.5", quotes are required, may specify multiple times)
# witness-id =

# Tuple of [PublicKey, WIF private key] (may specify multiple times)
private-key = ["PUBLICKEYHERE","PRIVATEKEYHERE"]

# Account ID to track history for (may specify multiple times)
# track-account =

# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
bucket-size = [15,60,300,3600,86400]

# How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000)
history-per-size = 1000

# declare an appender named "stderr" that writes messages to the console
[log.console_appender.stderr]
stream=std_error

# declare an appender named "p2p" that writes messages to p2p.log
[log.file_appender.p2p]
filename=logs/p2p/p2p.log
# filename can be absolute or relative to this config file

# route any messages logged to the default logger to the "stderr" logger we
# declared above, if they are info level are higher
[logger.default]
level=info
appenders=stderr

# route messages sent to the "p2p" logger to the p2p appender declared above
[logger.p2p]
level=debug
appenders=p2p


note the section:
# Tuple of [PublicKey, WIF private key] (may specify multiple times)
private-key = ["PUBLICKEYHERE","PRIVATEKEYHERE"]

this should be specified with the public and private wif key of the witness you wish to enable, why or how this works I have no idea. hope you do x.x

create this with vim or nano or whatever and place it in a directory of chosing, for example 'mynode'

then start your witness, I recomend using a screen rather than its silent feature for debugging:

Code: [Select]
screen -dmS witness witness_node --data-dir="mynode"
and let it do its magic, screen -x witness to watch, ctrl +a, then d to detach.

next you have to start the cli wallet to control it,

Code: [Select]
screen -dmS wallet cli_wallet
screen -x wallet

it will prompt you for a password, enter the following commands

Code: [Select]
set_password yourpassword
unlock yourpassword

next your ready to import from the past or open ledger, this tutorial will assume your new to bts and using open ledger.

hop over to open ledger and make an account type in an 8 char password and unique username, click permissions on the left,

once here click the little key

be sure to repeate this process for each key

you will get a popup showing your WIF import key.

next go back to your wallet and type the following commands:

Code: [Select]
import_key btsact yourkey truewhere 'btsact' and 'yourkey' are the values you pulled from open ledger

you should see a report of success (or not faulure) and you can now use

Code: [Select]
list_my_accounts
and see a return of your accounts!

Code: [Select]
    "whitelisting_accounts": [],
    "blacklisting_accounts": [],
    "blacklisted_accounts": []
  },{
    "id": "1.2.96555",
    "membership_expiration_date": "1970-01-01T00:00:00",
    "registrar": "1.2.90713",
    "referrer": "1.2.90713",
    "lifetime_referrer": "1.2.90713",
    "network_fee_percentage": 2000,
    "lifetime_referrer_fee_percentage": 3000,
    "referrer_rewards_percentage": 0,
    "name": "btstip-io",
    "owner": {
      "weight_threshold": 1,
      "account_auths": [],
      "key_auths": [[
          "",
          1
        ]
      ],
      "address_auths": []
    },
    "active": {
      "weight_threshold": 1,
      "account_auths": [],
      "key_auths": [[
          "",
          1
        ]
      ],
      "address_auths": []
    },
    "options": {
      "memo_key": "",
      "voting_account": "1.2.5",
      "num_witness": 0,
      "num_committee": 0,
      "votes": [],
      "extensions": []
    },
    "statistics": "2.6.96555",
    "whitelisting_accounts": [],
    "blacklisting_accounts": [],
    "blacklisted_accounts": []
  }
]


hope i helped, ill try to monitor this thread and respond to questions.

later ill post a followup on how to install the js gui


« Last Edit: October 31, 2015, 05:31:37 am by kuro112 »
CTO @ Freebie, LLC