excelsia / pyvee

A python wrapper for vee api
MIT No Attribution
0 stars 0 forks source link

Create account failed when use mainnet or user my node #10

Open lvshuang opened 5 years ago

lvshuang commented 5 years ago

Env

ubuntu16.04
python version 3.5.2

code

#chain = pv.testnet_chain() # this works
#chain = pv.default_chain(api_wrapper=Wrapper(nodeConfig["host"]))  #failed like chain = pv.default_chain()
chain = chain = pv.default_chain()
accountGenaretor = Account(chain=chain)
account = accountGenaretor.get_info()

return

Failed to get balance detail. (Expecting value: line 1 column 1 (char 0))
SheldonYS commented 5 years ago

Because if you use default node, you should set Mainnet node address in DEFAULT_NODE of setting.py For example, modify the Line 32 in setting.py

DEFAULT_NODE = 'https://wallet.vee.tech/api'

And

chain = chain = pv.default_chain()

should change to

chain = pv.default_chain()
lvshuang commented 5 years ago

Because if you use default node, you should set Mainnet node address in DEFAULT_NODE of setting.py For example, modify the Line 32 in setting.py

DEFAULT_NODE = 'https://wallet.vee.tech/api'

And

chain = chain = pv.default_chain()

should change to

chain = pv.default_chain()

If want't use myself node, how to set this! And I install the sdk from pip, not source

SheldonYS commented 5 years ago

You could modify the code like this:

    node = pv.create_api_wrapper('https://wallet.vee.tech/api', api_key='')
    chain = pv.Chain(chain_name='mainnet', chain_id='M', address_version=5, api_wrapper=node)
    accountGenaretor = Account(chain=chain)
    account = accountGenaretor.get_info()