GithubHelp home page GithubHelp logo

Comments (6)

lemoustachiste avatar lemoustachiste commented on August 16, 2024

hmm, I think it could be related to the fact that you are using the examples context: https://www.w3.org/2018/credentials/examples/v1 and that it's not "preloaded" to jsonld. To make sure, try to remove this context from the list, you should get a different error on alumniOf.

If that's the case, and you really want to use the examples context, there 2 ways you can preload the context.

Either in conf.ini:

context_urls=[https://www.w3.org/2018/credentials/examples/v1]
context_file_paths=[your-path-to-the-local-context-file]

Tip: you can do something like curl -L https://www.w3.org/2018/credentials/examples/v1 >> your-path-to-the-local-context-file to quickly store the file locally.

Or with the CLI:

python -m cert_issuer -c conf.ini --context_urls https://www.w3.org/2018/credentials/examples/v1 --context_file_paths your-path-to-the-local-context-file

from cert-issuer.

pranayperiwal avatar pranayperiwal commented on August 16, 2024

Hi! Thank you for your quick reply.
If I remove the line https://www.w3.org/2018/credentials/examples/v1 from verifiable-credential.json, I get this response:

bash-5.0# cert-issuer -c /etc/cert-issuer/conf.ini
WARNING - Your app is configured to skip the wifi check when the USB is plugged in. Read the documentation to ensure this is what you want, since this is less secure
INFO - This run will try to issue on the bitcoin_regtest chain
INFO - Set cost constants to recommended_tx_fee=0.000600,min_per_output=0.000028,satoshi_per_byte=250
INFO - Processing 1 certificates
INFO - Processing 1 certificates under work path=/etc/cert-issuer/work
INFO - Total cost will be 133500 satoshis
INFO - Starting finalizable signer
WARNING - app is configured to skip the wifi check when the USB is plugged in. Read the documentation to ensure this is what you want, since this is less secure
INFO - Stopping finalizable signer
WARNING - app is configured to skip the wifi check when the USB is plugged in. Read the documentation to ensure this is what you want, since this is less secure
INFO - here is the op_return_code data: f4906de7db4f9a826b5998472f51eaac762d429b29b6c2496f38870a477929d9
INFO - Unsigned hextx=0100000001556154cba262e3795d9925b9c83bd1bbefc4a0c59f617c1efbd262b8f5032dff0100000000ffffffff02a07acc1d0000000016001425e2b1a1d9f2496c0d04c7c19592dc4214c9e5c40000000000000000226a20f4906de7db4f9a826b5998472f51eaac762d429b29b6c2496f38870a477929d900000000
INFO - Preparing tx for signing
INFO - Starting finalizable signer
WARNING - app is configured to skip the wifi check when the USB is plugged in. Read the documentation to ensure this is what you want, since this is less secure
ERROR - Unable to sign transaction. hextx=01000000000101556154cba262e3795d9925b9c83bd1bbefc4a0c59f617c1efbd262b8f5032dff0100000000ffffffff02a07acc1d0000000016001425e2b1a1d9f2496c0d04c7c19592dc4214c9e5c40000000000000000226a20f4906de7db4f9a826b5998472f51eaac762d429b29b6c2496f38870a477929d902473044022028e084bbf275b27f7d796a299ce53ee4e0af94c71fbbc70fe49d7f53d00a2aff022006e9a873c64d3685d7131704fc119f22e6303ec574783607dfa2e1027670500b0121026f62fd7d68fa3ac1add38c9b30b033af1c5b7de2522742ede2cbd3a51433ac7000000000
INFO - Stopping finalizable signer
WARNING - app is configured to skip the wifi check when the USB is plugged in. Read the documentation to ensure this is what you want, since this is less secure
Traceback (most recent call last):
  File "/usr/bin/cert-issuer", line 8, in <module>
    sys.exit(cert_issuer_main())
  File "/usr/lib/python3.8/site-packages/cert_issuer/__main__.py", line 17, in cert_issuer_main
    issue_certificates.main(parsed_config)
  File "/usr/lib/python3.8/site-packages/cert_issuer/issue_certificates.py", line 34, in main
    return issue(app_config, certificate_batch_handler, transaction_handler)
  File "/usr/lib/python3.8/site-packages/cert_issuer/issue_certificates.py", line 20, in issue
    tx_id = issuer.issue(app_config.chain)
  File "/usr/lib/python3.8/site-packages/cert_issuer/issuer.py", line 27, in issue
    txid = self.transaction_handler.issue_transaction(blockchain_bytes)
  File "/usr/lib/python3.8/site-packages/cert_issuer/blockchain_handlers/bitcoin/transaction_handlers.py", line 56, in issue_transaction
    signed_tx = self.sign_transaction(prepared_tx)
  File "/usr/lib/python3.8/site-packages/cert_issuer/blockchain_handlers/bitcoin/transaction_handlers.py", line 92, in sign_transaction
    signed_tx = signer.sign_transaction(prepared_tx)
  File "/usr/lib/python3.8/site-packages/cert_issuer/models/__init__.py", line 99, in sign_transaction
    return self.signer.sign_transaction(self.wif, transaction_to_sign)
  File "/usr/lib/python3.8/site-packages/cert_issuer/blockchain_handlers/bitcoin/signer.py", line 35, in sign_transaction
    raise UnableToSignTxError('Unable to sign transaction')
cert_issuer.errors.UnableToSignTxError: Unable to sign transaction

If I don't remove the line from the file, I get the same error even after downloading the context file and adding the lines you mentioned in conf.ini

from cert-issuer.

lemoustachiste avatar lemoustachiste commented on August 16, 2024

You should look at the reason why the Error is raised from there:

 File "/usr/lib/python3.8/site-packages/cert_issuer/blockchain_handlers/bitcoin/signer.py", line 35, in sign_transaction
    raise UnableToSignTxError('Unable to sign transaction')

Reasons could be different, but the low hanging one could be: is your wallet funded?

from cert-issuer.

pranayperiwal avatar pranayperiwal commented on August 16, 2024

I have tried to debug it but not sure what else can I do. There is enough balance in the wallet yup. I am not sure if there is a problem with the docker container or if there is some issue with the default files given. Apologies, I am new to blockchain so any advice would be helpful. Also if you would like, all I did was follow the steps in the Readme of cert-issuer while choosing 'sample unsigned certificate' for the issuing certificate,

from cert-issuer.

lemoustachiste avatar lemoustachiste commented on August 16, 2024

is your private key correctly defined in pk_issuer.txt?
It should be in the WIF format: https://github.com/blockchain-certificates/did-generator/blob/master/key-management/generateKeyPair.ts#L75

from cert-issuer.

owenwu811 avatar owenwu811 commented on August 16, 2024

you @context property needs to be an object, not an array:

{
"@context": {
"@Version": 1.1,
"schema": "http://schema.org/",
"cred": "https://www.w3.org/2018/credentials#",
"Blockcerts": "https://w3id.org/blockcerts#"
},
"id": "urn:uuid:bbba8553-8ec1-445f-82c9-a57251dd731c",
"type": ["VerifiableCredential", "BlockcertsCredential"],
"issuer": "did:example:23adb1f712ebc6f1c276eba4dfa",
"issuanceDate": "2022-01-01T19:33:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"alumniOf": {
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1"
}
}
}

from cert-issuer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.