Open outlier89 opened 6 years ago
it seems you have an error on the url of your nodeos, you only need to provide your base url https://eos.greymass.com
.
this is an example:
eos = Eos({
'http_address': 'http://localhost:8888',
'key_provider': 'your secret key here'
})
eos.get_currency_balance('eosio.token', 'ACCOUNTNAME', 'SYMBOL')
I first tried base url (https://eos.greymass.com) but that was also not working. Traceback below:
GetBalanceException Traceback (most recent call last)
can you share your code snippet? I don't understand why your nodeosd link is broken ?
Below is the code snippet: from eosjs_python import Eos eos = Eos({'http_address': 'http://eos.greymass.com'}) eos.get_currency_balance('eosio.token', 'eoscanadacom', 'EOS')
you need to add you the private key when you initiate your Eos class . like this
eos = Eos({
'http_address': 'http://localhost:8888',
'key_provider': '973rhkldfnwdfeyt3ugddjkbfdkjfdif'
})```
also, make sure to update eosjs_python version to latest one (0.1.61)
Thank you very much for the quick replies. However, I added my private key everytime. Just that I didn't disclose it. Maybe I should have pasted the below code snippet:
from eosjs_python import Eos eos = Eos({'http_address': 'http://eos.greymass.com','key_provider': 'private key'}) eos.get_currency_balance('eosio.token', 'eoscanadacom', 'EOS')
Also, I upgraded the eosjs_python to 0.1.61 after you corrected the json parsing error some 10 hours back. But the exact same error is showing up. I guess it's because somewhere in the code, its adding \ to the node URL. Also its adding "/n", "/t" everywhere. Thanks
very wired issue, can you run nodejs script directly :
go to js folder and then run this
node GetCurrencyBalance.js 'http://127.0.0.1:8888' 'privatekey' 'eosio.token' 'accountName' 'symbol'
note: the arguments need to follow the same order provided in the exemple . I've run a test on my end, it works without the private key:
I just tried running nodejs script directly and finally it ran with some minor changes (URL without quotes and double quotes everywhere instead of single) in your script:
node GetCurrencyBalance.js http://eos.greymass.com "" "eosio.token" "eoscanadacom" "EOS"
But could you please help me with the python script?
Same problem here...does anyone know where is a problem?
GetBalanceException Traceback (most recent call last)