Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intrinsic gas too low while creating identity service #255

Closed
HamzaBinSarfraz opened this issue Oct 26, 2020 · 6 comments
Closed

intrinsic gas too low while creating identity service #255

HamzaBinSarfraz opened this issue Oct 26, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@HamzaBinSarfraz
Copy link

i am trying to create identity service by using identityManagerAddService using did:ethr:rinkeby DID, but get the following error

[ethjs-query] while formatting outputs from RPC '{"value":{"code":-32000,"message":"intrinsic gas too low"}}'

@simonas-notcat
Copy link
Contributor

You can configure gas for the identity provider:

https://github.com/uport-project/daf/blob/beta/__tests__/localAgent.test.ts#L109

or pass gas value as part of method arguments:

https://github.com/uport-project/daf/blob/beta/docs/api/daf-core.iidentitymanageraddserviceargs.md

await agent.identityManagerAddService({
  did: ...,
  service: ...,
  options: {
     gas: ...
  }
})

@HamzaBinSarfraz
Copy link
Author

Thanks the gas issue is resolved but unfortunatly i am getting this error while creating identity service


/home/ameer/.nvm/versions/node/v10.16.3/bin/node ./server.js
***************************************************************
 server.js
null: Error: Expected type object but found type string; identityManagerAddService; #/; INVALID_TYPE; undefined
    at new PluginReturnTypeError (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/src/validator.ts:33:5)
    at Object.exports.validateReturnType (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/src/validator.ts:56:11)
    at Agent.<anonymous> (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/src/agent.ts:198:7)
    at step (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:44:23)
    at Object.next (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:25:53)
    at fulfilled (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:16:58) {name: 'PluginReturnTypeError', method: 'identityManagerAddService', description: undefined, path: '#/', code: 'INVALID_TYPE', …}
code: 'INVALID_TYPE'
description: undefined
message: 'Expected type object but found type string; identityManagerAddService; #/; INVALID_TYPE; undefined'
method: 'identityManagerAddService'
name: 'PluginReturnTypeError'
path: '#/'
stack: 'PluginReturnTypeError: Expected type object but found type string; identityManagerAddService; #/; INVALID_TYPE; undefined\n    at new PluginReturnTypeError (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/validator.js:41:28)\n    at Object.exports.validateReturnType (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/validator.js:65:15)\n    at Agent.<anonymous> (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:233:41)\n    at step (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:44:23)\n    at Object.next (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:25:53)\n    at fulfilled (/home/ameer/hamza/git/daf7-demo/node_modules/daf-core/build/agent.js:16:58)'
__proto__: Error

Also my requested service looks like this

const result = await agent.identityManagerAddService({
            did: did,
            service: {
                id: did,
                type: 'identityManagerImportIdentity',
                serviceEndpoint: 'http://localhost:3001/agent',
            },
            options: {
                gas: 1000001
            },
        });

@mirceanis
Copy link
Member

This looks like it's being caused by the schema validation on the return type of the identityManagerAddService.
It's likely that I'm wrong but from the looks of it, the call to identityManagerAddService() is returning undefined.

@simonas-notcat can you suggest a way to disable the schema check here so that the issue can be further debugged?

@mirceanis mirceanis added the bug Something isn't working label Nov 20, 2020
mirceanis added a commit that referenced this issue Nov 20, 2020
* add `schemaValidation` flag to `IAgentOptions` to enable validation of inputs and outputs.
* update config templates to set `schemaValidation` flag to false

Closes #255
Closes #275
mirceanis added a commit that referenced this issue Nov 20, 2020
* add `schemaValidation` flag to `IAgentOptions` to enable validation of inputs and outputs.
* update config templates to set `schemaValidation` flag to false

Closes #255
Closes #275
mirceanis added a commit that referenced this issue Nov 23, 2020
* add `schemaValidation` flag to `IAgentOptions` to enable validation of inputs and outputs.
* update config templates to set `schemaValidation` flag to false
* update integration tests to consider validation

Closes #255
Closes #275
mirceanis added a commit that referenced this issue Nov 23, 2020
* add `schemaValidation` flag to `IAgentOptions` to enable validation of inputs and outputs.
* update config templates to set `schemaValidation` flag to false
* update integration tests to consider validation

Closes #255
Closes #275
@mirceanis
Copy link
Member

@HamzaBinSarfraz can you try again using version [7.0.0-beta.47] and see if you make progress?

mirceanis added a commit that referenced this issue Nov 24, 2020
mirceanis added a commit that referenced this issue Nov 24, 2020
@mirceanis
Copy link
Member

Closing this since there is a workaround for the second issue as well. ( see #275 #278 #280 )

Thank you for reporting this.

@HamzaBinSarfraz
Copy link
Author

Yeah this issue is resolved, thanks @mirceanis @simonas-notcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants