Author Topic: Importing from OpenLedger to CLI  (Read 4950 times)

0 Members and 1 Guest are viewing this topic.

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
My blockchain is syncing so thats probably why I can't see it yet. I can see some other accounts but not mine. I was wondering what is the size of the current blockchain?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
if you have registerd your account pre bitshares2, you may try with a "bts-" prefix: bts-bitshares3030.

Offline svk

Yes the documentation is conflicted in more than one way ...

Anyhow I managed to setup the wallet and now bitshares-2 is syncing. When I do get_account bytemaster I can get the details so thats great. However I have an account registered for ex. bitshares3030 and it has a balance of 200+ BTS (account name is not real, just an example)

When I do get_account bitshares3030 account I can't see it. Should I upgrade my account to another type of membership to see it from my CLI and run my faucet on it? IF so how do I go about doing that? The account is accessible on openledger.info

Thanks again

If you're still syncing it could simply be because that account hasn't been created yet at the current state of your blockchain.
Worker: dev.bitsharesblocks

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
Yes the documentation is conflicted in more than one way ...

Anyhow I managed to setup the wallet and now bitshares-2 is syncing. When I do get_account bytemaster I can get the details so thats great. However I have an account registered for ex. bitshares3030 and it has a balance of 200+ BTS (account name is not real, just an example)

When I do get_account bitshares3030 account I can't see it. Should I upgrade my account to another type of membership to see it from my CLI and run my faucet on it? IF so how do I go about doing that? The account is accessible on openledger.info

Thanks again
« Last Edit: May 31, 2016, 10:54:40 am by bitsandtea »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
You should have a folder called bitshares-2 ... compile in there .. not in the graphene folder.
Make sure you have checked out the correct repository

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
Before I installed it I did a
Code: [Select]
rm-r graphene
Of the whole folder. If you mean start from scratch should I delete something else? Since it takes about an hour or more for it to compile I would like as much info as possible before I go and remake it.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
you should start over from scratch .. you'r binary still uses the graphene code (the pubkey in the second line starts with GPH)

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
I installed and compiled the binaries for the repository https://github.com/bitshares/bitshares-2

I added rpc-endpoint = 127.0.0.1:8090 to my config.ini
after that I launched the witness_node:

Code: [Select]
~/graphene/programs/witness_node$ ./witness_node
53723ms th_a       witness.cpp:89                plugin_initialize    ] witness plugin:  plugin_initialize() begin
53724ms th_a       witness.cpp:99                plugin_initialize    ] key_id_to_wif_pair: ["GPH6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
53724ms th_a       witness.cpp:117               plugin_initialize    ] witness plugin:  plugin_initialize() end
53724ms th_a       object_database.cpp:94        open                 ] Opening object database from /home/ubuntu/graphene/programs/witness_node/witness_node_data_dir/blockchain ...
53758ms th_a       object_database.cpp:100       open                 ] Done opening object database.
53758ms th_a       db_management.cpp:128         open                 ] last_block->id(): 000000016db057988d99b10fca98c7c437988003 last_block->block_num(): 1
53759ms th_a       thread.cpp:95                 thread               ] name:ntp tid:140116430878464
53759ms th_a       thread.cpp:95                 thread               ] name:p2p tid:140116411995904
53762ms th_a       application.cpp:143           reset_p2p_node       ] Configured p2p node to listen on 0.0.0.0:45374
53763ms th_a       witness.cpp:122               plugin_startup       ] witness plugin:  plugin_startup() begin
53763ms th_a       witness.cpp:139               plugin_startup       ] No witnesses configured! Please add witness IDs and private keys to configuration.
53763ms th_a       witness.cpp:140               plugin_startup       ] witness plugin:  plugin_startup() end
53764ms th_a       main.cpp:179                  main                 ] Started witness node on a chain with 1 blocks.
53764ms th_a       main.cpp:180                  main                 ] Chain ID is e2f8b7db0c551d82cd2930feaf0596506a956772d571b05f694b87891cee3a9c
53797ms ntp        ntp.cpp:177                   read_loop            ] ntp_delta_time updated to 14915031 us

and launched the CLI (as instructed)

Code: [Select]
unlocked >>> get_account bytemaster
get_account bytemaster
10 assert_exception: Assert Exception
rec && rec->name == account_name_or_id:
    {}
    th_a  wallet.cpp:597 get_account

Still getting the same response. Any thoughts?


Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
OK, I am building bitshares-2 now will let you know how it went in a bit. Thanks for the help

Offline svk

Thanks for the help!

In the guide that xeroc posted it says that I should run this code

Code: [Select]
git clone https://github.com/cryptonomex/graphene
mv graphene/ graphene-testnet
cd graphene-testnet/
git branch testnet
git remote set-url origin https://github.com/BitSharesEurope/graphene-testnet
git push origin testnet

Is this the right one or should I continue with Bitshares-2.0? I have also compiled from bitshares-2.0 before and had the same issue.

That example is only for the graphene testnet, it's a different blockchain used only for test purposes. If you're looking to connect to the Bitshares blockchain, you need to use the bitshares-2 repo I linked.
Worker: dev.bitsharesblocks

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
Thanks for the help!

In the guide that xeroc posted it says that I should run this code

Code: [Select]
git clone https://github.com/cryptonomex/graphene
mv graphene/ graphene-testnet
cd graphene-testnet/
git branch testnet
git remote set-url origin https://github.com/BitSharesEurope/graphene-testnet
git push origin testnet

Is this the right one or should I continue with Bitshares-2.0? I have also compiled from bitshares-2.0 before and had the same issue.

Offline svk

For example even if I type:

Code: [Select]
unlocked >>> get_account bytemaster
get_account bytemaster
10 assert_exception: Assert Exception
rec && rec->name == account_name_or_id:
    {}
    th_a  wallet.cpp:597 get_account
unlocked >>>

Even though bytemaster is a valid account in the public blockchain. Any ideas?

Looks to me like you're not using the bitshares-2 code but either the graphene or graphene-testnet code.  You need to compile the binaries from this repo:

https://github.com/bitshares/bitshares-2
Worker: dev.bitsharesblocks

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
For example even if I type:

Code: [Select]
unlocked >>> get_account bytemaster
get_account bytemaster
10 assert_exception: Assert Exception
rec && rec->name == account_name_or_id:
    {}
    th_a  wallet.cpp:597 get_account
unlocked >>>

Even though bytemaster is a valid account in the public blockchain. Any ideas?

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
Yes I am providing the account name (registered in the blockchain can be seen at OpenLedger web wallet) and the correct wif key imported again from the web wallet.

The issue is the one that I initially stated, somehow my blockchain is not syncing with the main public testnet. Is there a way you can provide a config.inc and a genesis.json that make my blockchain connect with the main one?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
import_key requires an account name plus the wif key .. the account name needs to exist already on the chain .. you can check with get_account xxxx

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
Thanks xeroc for the quick reply.

I erased everything and went for the tutorial. I have managed to set up the witness client and the CLI wallet to connect to it however when I try to

Code: [Select]
>>> import_key <name> "<wifkey>"

I get the usual

Code: [Select]
10 assert_exception: Assert Exception
rec && rec->name == account_name_or_id:
    {}
    th_a  wallet.cpp:597 get_account

Here is the log from the start of my CLI Wallet:

Code: [Select]
ubuntu@ip-172-31-6-75:~/graphene-testnet$ programs/cli_wallet/cli_wallet --wallet-file my-wallet.json -s ws://127.0.0.1:11011 -H 127.0.0.1:8090 -r 127.0.0.1:8099
Logging RPC to file: logs/rpc/rpc.log
2697730ms th_a       main.cpp:120                  main                 ] key_to_wif( committee_private_key ): 5KCBDTcyDqzsqehcb52tW5nU6pXife6V2rX9Yf7c3saYSzbDZ5W
2697730ms th_a       main.cpp:124                  main                 ] nathan_pub_key: TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
2697730ms th_a       main.cpp:125                  main                 ] key_to_wif( nathan_private_key ): 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
Starting a new wallet with chain ID 4c47711041b79fe91ffe56cf5a7ae3d7ab7cdcd48bd04fa1714690e72afc058a (from egenesis)
2697730ms th_a       main.cpp:172                  main                 ] wdata.ws_server: ws://127.0.0.1:11011
2697731ms th_a       main.cpp:177                  main                 ] wdata.ws_user:  wdata.ws_password: 
Please use the set_password method to initialize a new wallet before continuing
2697733ms th_a       main.cpp:218                  main                 ] Listening for incoming RPC requests on 127.0.0.1:8099
2697733ms th_a       main.cpp:243                  main                 ] Listening for incoming HTTP RPC requests on 127.0.0.1:8090
2697734ms th_a       thread.cpp:95                 thread               ] name:getline tid:139793365006080
new >>> set_password supersecret
set_password supersecret
null
locked >>> unlock supersecret
unlock supersecret
null


Here is the terminal output from witness node launch

Code: [Select]
ubuntu@ip-1X-X-X-X:~/graphene-testnet/programs/witness_node$ ./witness_node --enable-stale-production \ --data-dir data/testnet
2686398ms th_a       witness.cpp:89                plugin_initialize    ] witness plugin:  plugin_initialize() begin
2686398ms th_a       witness.cpp:99                plugin_initialize    ] key_id_to_wif_pair: ["TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
2686398ms th_a       witness.cpp:117               plugin_initialize    ] witness plugin:  plugin_initialize() end
2686398ms th_a       object_database.cpp:94        open                 ] Opening object database from /home/ubuntu/graphene-testnet/programs/witness_node/witness_node_data_dir/blockchain ...
2686408ms th_a       object_database.cpp:100       open                 ] Done opening object database.
2686408ms th_a       thread.cpp:95                 thread               ] name:ntp tid:140358732707584
2686408ms th_a       thread.cpp:95                 thread               ] name:p2p tid:140358715922176
2686555ms th_a       application.cpp:147           reset_p2p_node       ] Adding seed node 46.101.188.80:11010
2686555ms th_a       application.cpp:158           reset_p2p_node       ] Configured p2p node to listen on 0.0.0.0:11010
2686556ms th_a       application.cpp:210           reset_websocket_serv ] Configured websocket rpc to listen on 0.0.0.0:11011
2686556ms th_a       witness.cpp:122               plugin_startup       ] witness plugin:  plugin_startup() begin
2686556ms th_a       witness.cpp:139               plugin_startup       ] No witnesses configured! Please add witness IDs and private keys to configuration.
2686556ms th_a       witness.cpp:140               plugin_startup       ] witness plugin:  plugin_startup() end
2686556ms th_a       main.cpp:179                  main                 ] Started witness node on a chain with 0 blocks.
2686556ms th_a       main.cpp:180                  main                 ] Chain ID is 4c47711041b79fe91ffe56cf5a7ae3d7ab7cdcd48bd04fa1714690e72afc058a
2697731ms th_a       database_api.cpp:199          database_api_impl    ] creating database api 58474896
2697731ms th_a       database_api.cpp:199          database_api_impl    ] creating database api 58498816


Let me know if there is anything else I can try

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Take a look at these docs:
http://docs.bitshares.eu/testnet/public-testnet-howto.html
Some steps can be omitted as they show how to deploy a new blockchain, but the docs also show how to deploy a new faucet and web wallet.

Offline bitsandtea

  • Newbie
  • *
  • Posts: 12
    • View Profile
Hello,

I am ultimately trying to setup a faucet for the main bitshares blockchain.

In order to do that I have created and funded an account using https://bitshares.openledger.info and shapeshift to fund it with BTS.
When I am trying to import it using private key into my CLI wallet it is saying that it cannot find the account name. In the CLI wallet I have set up, when I list all assets it only shows one, and getting accounts is impossible which is making me believe that my witness node and CLI wallet are not synced with the actual blockchain.

What would be the best course of action for me to be able to

1. Sync my CLI Client with the latest state of the blockchain

Thanks,