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 - kuro112

Pages: [1]
1
Technical Support / Bitshares RPC Issues
« on: February 02, 2016, 09:00:23 pm »
hey guys, were trying to get sharebits and our rpc back online, but were facing a weird issue with the new fork, hopefully some one like @xeroc will have some idea,

so we updated to the new fork, local wallet commands work fine;

Code: [Select]
unlocked >>> "get_committee_member" ebit
"get_committee_member" ebit
{
  "id": "1.5.23",
  "committee_member_account": "1.2.159",
  "vote_id": "0:112",
  "total_votes": 0,
  "url": "ebitrose.com"
}

however when we try to curl both locally and remotely, we get no response at all:

Code: [Select]
curl --data-binary '{\"jsonrpc\":\"2.0\",\"method\":\"call\",\"params\":[0,\"is_locked\",[]],\"id\":1337}'  http://127.0.0.1:8092/rpc
nothing has changed on our setup in terms of firewall, build method, etc - i use automated scripts to perform everything...

the only thing we can think of is that this may be a bug as a result of the most recent fork.... any insight anyone?

2
Technical Support / BTS Witness and CLI Watchdog
« on: January 08, 2016, 05:55:56 am »
Hey guys, im just posting some personal scripts i made here, they arent perfect, they will require you to adjust and to have set things up using my tutorial,

https://bitsharestalk.org/index.php/topic,19612.msg251784.html#msg251784

however if you run bts daemons like i do and are getting annoyed by the lack of any type of auto-update system, let this help!

note i will be altering it to pull git revisions automatically soon, and detect soft changes to the blockchain for syncing, for now its literally just a process watchdog.

if you have any additions or you want to fix my code (im obviously really bad with bash, so its welcome) please feel free to post them here, i wont take it personally, i know my bash is amateur at best.


Watchdog:

Code: [Select]
echo "Watching RPC";

while true
do
    while true
    do
        netstat -tuna | grep 8090
        if [ $? -ne 1 ]
        then
            UPDATE=0
        else
            break
        fi
    done

    netstat -tuna | grep 8090;
    while [ $? -ne 0 ]
    do
            echo "RPC Failed - Attempting to start"
            sh "/root/btsr"
            sleep 5
            netstat -tuna | grep 8090;
            if [ $? -ne 0 ]
            then
               if [ "$UPDATE" -eq 1 ]
               then
                  echo "RPC Start Failed, Updating"
                  UPDATE=1
                  sh /root/update
               fi
            fi

            netstat -tuna | grep 8090;
            if [ $? -ne 1 ]
            then
                break
            fi
    done

    sleep 1
done



Run Witness and Wallet

Code: [Select]
BOOST_ROOT=$HOME/opt/boost_1_57_0;
cd /root/witness-2;
screen -S witness -X stuff $'\003'`echo '\015'`

screen -S witness -X stuff "witness_node `echo '\015'`";
echo "Waiting for sync";
sleep 3;
netstat -tuna | grep 8090;
while [ $? -ne 0 ]
do
    netstat -tuna | grep 8090;
done

while [ $? -ne 1 ]
do
    screen -S wallet -X stuff $'\003'`echo '\015'`
    cd /root/testwallet;
    echo "BOOST_ROOT=$HOME/opt/boost_1_57_0"
    screen -S wallet -X stuff "cli_wallet -H 0.0.0.0:8092 -w `echo '\015'`"
    sleep 5;
    echo "Starting Wallet"
    break
done



Update System
Code: [Select]


rm -rf bitshares-2;
BOOST_ROOT=$HOME/opt/boost_1_57_0
git clone https://github.com/bitshares/bitshares-2;
cd bitshares-2;
git submodule update --init --recursive;
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .;
make;
make install



quick FAQ:

why the hell is it 3 bash scripts?


well simple answer is that i wanted to be able to run them independently.


wtf screens? and why are you stuffing them instead of running -dmS??


well i like to be able to manually manage them, and without a tmux wrapper to make it respond to screen commands, tmux is annoying to use.
the advantage of creating and stuffing a screen manually is repeated control when the application dies, you can still access the screen.



what is this actually doing?

it uses netstat to check if the wallet is running, if not, starts or updates it depending on the result.
it will be updated to use githubs version checking system soon, and other improvements.

can i just run this straight off?

You should probably edit some stuff like the directorates the script cd's to, ill make these variables later.

how do i actually use this??

make sure you followed my tutorial for building an rpc from scratch,

make sure you make screen instances of witness and wallet,
and that the wallet and witness are NOT running

Code: [Select]
screen -dmS wallet
screen -dmS witness

then your ready to run the watchdog (which will find your wallet and witness not running)

(i name mine just wd)

Code: [Select]
screen -dmS watchdog sh wd

and thats it, to check on it, which will give you annoying output, do
Code: [Select]
screen -x watchdog
please note that this is just my first attempt, while i run and manage servers for a living i do not spend a lot of time automating functions on them,
and my bash scripting skills are pretty minimal like i said before, any input is welcome and also many improvements will be made as time goes on.

let me know if this helps at all, and i hope it does.

3
Freebie / Thanks for having us
« on: November 06, 2015, 08:42:56 pm »
Just wanted to reach out to the community and say thanks for your support! we look forward to releasing some amazing software in the near future, and propelling bitshares to the place it belongs.

stick around for some news and updates, and look out for our brothers at beyond bitcoin to spread the brownie love.

seriously, thanks for having us guys, it means a lot to find a home here.

4
Openledger / BTS Chain sync
« on: November 06, 2015, 12:27:17 am »
Hey guys, just wanted to let you know that OL is out of sync as per the latest bts update,

https://github.com/bitshares/bitshares-2/releases

i conducted a few tx there to find my local node was not in sync with ol, sure enough its OL not me

please fix this asap  :)

5
Meta / Forum Section
« on: November 05, 2015, 09:52:13 pm »
Hey guys, freebie would like to have a partner forum section created,

Please call it Freebie, subtext "Software and business development firm dedicated to mass adoption of bitshares"

subform BtsTip please :)

6
Technical Support / Building BTS 2.0 in Ubuntu from scratch
« on: October 31, 2015, 05:27:47 am »
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



Pages: [1]