Blockcert on testnet

I am trying to execute cert issuer however getting insufficient balance error.

however I have verified that the address has balance
https://testnet.blockexplorer.com/address/mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs

INFO - Processing 2 certificates under work path=/etc/cert-issuer/work
INFO - Processing 2 certificates under work path=/etc/cert-issuer/work
WARNING - address mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs has a balance of 0
WARNING - address mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs has a balance of 0
INFO - Total cost will be 133500 satoshis
INFO - Total cost will be 133500 satoshis
ERROR - Please add 133500 satoshis to the address mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs
ERROR - Please add 133500 satoshis to the address mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs
Traceback (most recent call last):
File “/usr/bin/cert-issuer”, line 11, in
load_entry_point(‘cert-issuer==2.0.9’, ‘console_scripts’, ‘cert-issuer’)()
File “/usr/lib/python3.5/site-packages/cert_issuer/main.py”, line 17, in cert_issuer_main
issue_certificates.main(parsed_config)
File “/usr/lib/python3.5/site-packages/cert_issuer/issue_certificates.py”, line 68, in main
return issue(app_config, certificate_batch_handler, transaction_handler)
File “/usr/lib/python3.5/site-packages/cert_issuer/issue_certificates.py”, line 35, in issue
transaction_handler.ensure_balance()
File “/usr/lib/python3.5/site-packages/cert_issuer/transaction_handler.py”, line 94, in ensure_balance
raise InsufficientFundsError(error_message)
cert_issuer.errors.InsufficientFundsError: Please add 133500 satoshis to the address mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs

Please see https://github.com/blockchain-certificates/cert-issuer#obtaining-testnet-coins

Dear @kim,

Thanks for your response.

I have balance in testnet for the address : mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs

But still I am getting zero balance issue.

Based on below statement I am assuming that docker will not be looking at the local node.
By default, cert-issuer does not assume you have a bitcoin/ethereum node running locally, and it uses APIs to look up and broadcast transactions. There is API support for both testnet and mainnet chains.

Although I dont understand python but looking at code I noticed that api that are used are
https://tbtc.blockr.io/api/v1
or
https://testnet.blockexplorer.com/api

when I open first url it redirects me to coinbase,com
I there any way I can directly call the api to check if its returning wrong data?

Regards,
Danish

https: // tbtc.blockr.io/api/v1 is the one that redirect to coinbase

one possibility: what are the contents of your conf.ini? I am wondering which blockchain this is issuing to, so I’d like you check the config.

below are the configuration settings

issuing_address = mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs

chain=bitcoin_testnet
bitcoind

usb_name=/etc/cert-issuer/
key_file=pk_issuer_testnet.txt

unsigned_certificates_dir=/etc/cert-issuer/data/unsigned_certificates
blockchain_certificates_dir=/etc/cert-issuer/data/blockchain_certificates
work_dir=/etc/cert-issuer/work

no_safe_mo

I’m wondering if there is a regression with one of the endpoints we are using. I will debug into this. I should have an answer/fix by tomorrow morning (PST)

Also I have highlight one configuration “bitcoind”… does this setting means that it will look for local node?

issuing_address = mmsyB5TbdphHD2gGAfRq3osLbdSmceERYs

chain=bitcoin_testnet
bitcoind

usb_name=/etc/cert-issuer/
key_file=pk_issuer_testnet.txt

unsigned_certificates_dir=/etc/cert-issuer/data/unsigned_certificates
blockchain_certificates_dir=/etc/cert-issuer/data/blockchain_certificates
work_dir=/etc/cert-issuer/work

no_safe_mode

Dear @kim,

I have an update,

I placed below hard coded statement in
bitcoind = False
in connectors.py => get_providers_for_chain function
and the issue get resolved.

This mean that it is for sure related to configuration, btw before applying this temporary fix I tried
removing bitcoind and also tried setting bitcoind=False in configration and both of them didnt worked for me.

So, for time being I will be using this hardcoded fix.

Regards,
Danish

I see; bitcoind is a flag, so if you omit the line, it will have the same behavior. But if you have the following, it will set bitcoind to true:

bitcoind

Dear Kim,

I tried removing "bitcoind " from configuration and still it is not working. so I guess there is some problem.
I have a workaround but looks like this is an issue.

Thanks,
Danish

Is there a way of doing this without bitcoind?

I’m facing a similar issue:

HI Hussain! And Kim!
Im getting better at this, and still crashing but against new walls. I have as you did @d.hussain, and completed my conf.ini file with bitcoind=false, but I do not understand what you mean by this

Can you elaborate a little bit further??
Thanks in advanced

Dear @Julian,

bitcoind = False was not working for us. So as a workaround we modified the code to ignore the parameter. That was just a workaround to keep moving…

Now in our configuration we have completely removed this parameter and added another one as below
no_bitcoind

Above is working fine with us.

Regards,
Danish

1 Like

Thanks for your response @d.hussain!
Im a beginer/amateur programer, so everything requires a lot of hard work. I managed to ““publish”” on the regtest version of the cert-issuer ussing the docker version.

Im trying to do this workaround also but im having a hard time to implement. I tried to see your “connectors.py” but I get an error and can not acces, is it a downloadable version?
I also tried to modify the Code, but I think I did not do it right, from the connectors.py from github lines 144 through 147:
“def spendables_for_address(self, bitcoin_address):
for m in service_provider_methods(‘spendables_for_address’,
get_providers_for_chain(self.bitcoin_chain, self.bitcoind)):”
what I did was replace self.bitcoind for a bitcoind=False as I understood you did but the error persists. Will you show me exactly how you did that workaround to get it to publish? For a non progamer :slight_smile:
I will try to find a permanent solution later, once i get to issue my first certificate.
Thanks in advance for all the help
Julian

How did you guys fix this problem i still have this issue i tried almost everything and still getting the error.

cert_issuer.errors.InsufficientFundsError: Please add 133500 satoshis to the address

if i change the settings i get this error also

AttributeError: ‘CertificateBatchHandler’ object has no attribute ‘certificates_to_issue’

i tried changing the chain to reg and still also with the bitcoind and without

issuing_address = myaddress

chain=bitcoin_testnet
bitcoind=false

usb_name=/etc/cert-issuer/
key_file=pk_issuer.txt

unsigned_certificates_dir=/etc/cert-issuer/data/unsigned_certificates
blockchain_certificates_dir=/etc/cert-issuer/data/blockchain_certificates
work_dir=/etc/cert-issuer/work

no_safe_mode

Can you please post the connectors.py script here so that learners like me can refer the changes to be made.

Thanks in advance!
Gaurav

1 Like

Thanks d.hussain but I tried your approach however couldn’t solve the same problem.