BUG: uptick + pybitshares dosen't work with testnet / keys not starting with 5

Started by runestone, March 03, 2018, 01:29:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xeroc

The BitShares() instance is not supposed to connect to the CLI-wallet.
If you need your node added, you need to get your own copy of pybitshares and modify/extend the chains.py file in bitsharesbase/.

runestone

In this case specifically, I'm just playing around with pybitshares, to get a better understanding on how BitShares and the python lib works. To solve the issue below, I decided to setup a private testnet instead, which will solve the issue with WIF keys starting with 6.

But, then I got another issue when connecting to my testnet using uptick/pybitshares:
Connecting to unknown network!

My best guess here was that its because uptick/pybitshares is not using the correct chain-id. To solve this, I did this:
./cli_wallet --wallet-file=my-wallet.json --chain-id=e08d...12c0 --server-rpc-endpoint=ws://127.0.0.1:8090 --rpc-endpoint=0.0.0.0:8092 --rpc-http-endpoint=0.0.0.0:8093 -d

Now, I'm able to reach the rpc-endpoint through cli_wallet (without specifying the chain-id). But, then my code returned another error:
from bitshares import BitShares
bitshares = BitShares("ws://testnet:8092", nobroadcast=False, debug=True)

raise exceptions.UnhandledRPCError(msg)
    bitsharesapi.exceptions.UnhandledRPCError: Assert Exception: _local_apis.size() > api_id:


What's going wrong here?
Br, Rune
~ Please vote on blockbasis-witness
~ [url="https://www.blockbasis.com"]https://www.blockbasis.com[/url]

xeroc

The reason for this limitation is that the bitshares backend only knows keys in that particular format.
Even though there is only a version flag different, I don't know if those keys would actually help you in any way.

What are you trying to do with pybitshares/uptick with that "key"?

clockwork

Bitshares doesn't make a distinction for keys between testnet and mainnet...."6P..." is the bitcoin testnet format

Bitshares uses normal WIF keys for testnet as well

runestone

Uptick is only working with WIF keys pre-fixed with 5.
uptick --node wss://node.testnet.bitshares.eu addkey 6PR...
Current Wallet Passphrase:
Invalid Private Key Format. Please use WIF!

uptick --node wss://node.testnet.bitshares.eu addkey 5JV...
Current Wallet Passphrase:


Similarly, pybitshares will also fail here:

from bitshares import BitShares
bitshares = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=False)
bitshares.wallet.unlock("wallet-password")
accName = bitshares.wallet.getAccountFromPrivateKey("6PR...")


Where should a bug like this be reported?
Br, Rune
~ Please vote on blockbasis-witness
~ [url="https://www.blockbasis.com"]https://www.blockbasis.com[/url]