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

feat(indy-vdr): add indy-vdr package and indy vdr pool #1160

Merged
merged 25 commits into from
Jan 26, 2023

Conversation

Vickysomtee
Copy link
Contributor

@Vickysomtee Vickysomtee commented Dec 14, 2022

This PR implements the new IndyVdr Pool Package

Work funded by the government of Ontario

vickysomtee added 5 commits November 24, 2022 15:24
Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @Vickysomtee! Left some comments mostly on things that can be done a bit differently in the indy vdr library compared to the indy sdk

packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPool.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPool.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPool.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPool.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPoolService.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPoolService.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPoolService.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPoolService.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/IndyVdrPoolService.ts Outdated Show resolved Hide resolved
Signed-off-by: vickysomtee <victor@animo.id>
@TimoGlastra TimoGlastra linked an issue Dec 17, 2022 that may be closed by this pull request
vickysomtee and others added 2 commits December 20, 2022 10:49
Work Funded by the Government of Ontario

Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
packages/indy-vdr/src/utils/did.ts Fixed Show fixed Hide fixed
packages/indy-vdr/src/utils/did.ts Fixed Show fixed Hide fixed
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2022

Codecov Report

Merging #1160 (62b7ae3) into main (0f6d231) will decrease coverage by 48.92%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             main    #1160       +/-   ##
===========================================
- Coverage   87.66%   38.74%   -48.92%     
===========================================
  Files         739      613      -126     
  Lines       17619    14773     -2846     
  Branches     2992     2520      -472     
===========================================
- Hits        15445     5724     -9721     
- Misses       2167     9049     +6882     
+ Partials        7        0        -7     
Impacted Files Coverage Δ
packages/core/src/storage/Repository.ts 8.88% <0.00%> (-91.12%) ⬇️
...src/storage/migration/updates/0.1-0.2/mediation.ts 9.09% <0.00%> (-90.91%) ⬇️
...les/credentials/protocol/BaseCredentialProtocol.ts 10.76% <0.00%> (-89.24%) ⬇️
...rc/storage/migration/updates/0.1-0.2/connection.ts 12.05% <0.00%> (-87.95%) ⬇️
packages/core/src/utils/timestamp.ts 12.50% <0.00%> (-87.50%) ⬇️
...entials/protocol/v2/CredentialFormatCoordinator.ts 2.91% <0.00%> (-86.87%) ⬇️
...es/credentials/protocol/v1/V1CredentialProtocol.ts 6.88% <0.00%> (-86.48%) ⬇️
packages/core/src/utils/indyProofRequest.ts 14.28% <0.00%> (-85.72%) ⬇️
...rc/storage/migration/updates/0.2-0.3/connection.ts 14.28% <0.00%> (-85.72%) ⬇️
...cover-features/services/DiscoverFeaturesService.ts 14.28% <0.00%> (-85.72%) ⬇️
... and 423 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

vickysomtee and others added 9 commits December 20, 2022 16:08
Work Funded by the Government of Ontario

Signed-off-by: vickysomtee <victor@animo.id>
Work Funded by the Government of Ontario

Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
Work funded by the Ontario Government

Signed-off-by: vickysomtee <victor@animo.id>
Work funded by the Ontario Government

Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
Signed-off-by: vickysomtee <victor@animo.id>
@TimoGlastra TimoGlastra changed the title feat: Indy-vdr pool package feat(indy-vdr): add indy-vdr package and indy vdr pool Jan 24, 2023
@TimoGlastra TimoGlastra marked this pull request as ready for review January 24, 2023 13:16
@TimoGlastra TimoGlastra requested a review from a team as a code owner January 24, 2023 13:16
Copy link
Contributor

@genaris genaris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've left a few comments and questions about the initialization.

Probably as part of another PR (when adding consumers to Indy VDR Pool like the resolvers and registry), but should we create it as a module that registers services and also initializes the binding library within its register method?

packages/indy-vdr/README.md Outdated Show resolved Hide resolved
@@ -0,0 +1,5 @@
try {
require('indy-vdr-test-nodejs')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this work when we want to use this package in React Native? Should we add the require('indy-vdr-test-react-native') to the catch block?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we could either do it with the catch as you say, or we detect the platform. Or would you prefer the manual approach? (so you provide it to the module). That's also fine for me.

packages/indy-vdr/src/pool/IndyVdrPool.ts Outdated Show resolved Hide resolved
}

// FIXME: this method doesn't work??
// this.pool.close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it throwing an error or something like that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. it hangs indefinitely. should create an issue for it in the indy-vdr repo. @blu3beri do you still know the details?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, apparently, almost a year ago now, I create an issue for this.
hyperledger/indy-vdr#92

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can investigate this further if it's required. The reasoning (no write-access to lock) might be completely incorrect.

packages/core/src/index.ts Outdated Show resolved Hide resolved
packages/indy-vdr/README.md Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/src/error/IndyVdrNotConfiguredError.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/utils/did.ts Outdated Show resolved Hide resolved
packages/indy-vdr/tests/indy-vdr-pool.e2e.test.ts Outdated Show resolved Hide resolved
packages/indy-vdr/tests/indy-vdr-pool.e2e.test.ts Outdated Show resolved Hide resolved
packages/indy-vdr/tests/indy-vdr-pool.e2e.test.ts Outdated Show resolved Hide resolved
packages/indy-vdr/tests/indy-vdr-pool.e2e.test.ts Outdated Show resolved Hide resolved
Signed-off-by: vickysomtee <victor@animo.id>
Work funded by the Ontario Government

Signed-off-by: vickysomtee <victor@animo.id>
vickysomtee added 2 commits January 25, 2023 23:31
Work funded by the Ontario Government

Signed-off-by: vickysomtee <victor@animo.id>
Work funded by the Ontario Government

Signed-off-by: vickysomtee <victor@animo.id>
Copy link
Contributor

@karimStekelenburg karimStekelenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these are mostly style changes and they look good to me. I'm assuming the README will be done in a follow-up PR, so I'll approve. If not, this needs to be added before merging.

In order to do so, just have a look at the READMEs of other packages inside this repository. They'll give you an idea of what is required.

describe('Schemas & credential Definition', () => {
test('can write a schema using the pool', async () => {
const pool = indyVdrPoolService.getPoolForNamespace('pool:localtest')

const dynamicVersion = `1.${Math.random() * 100}` // TODO Remove this before pushing
const dynamicVersion = `1.${Math.random() * 100}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimoGlastra this was originally added by me. I assumed we could remove this, as the CI uses a clean ledger for every run. Is my assumption correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we can. But then subsequent test runs (local) will fail I think? So I thought there's not harm in keeping it in.

packages/indy-vdr/tests/setup.ts Outdated Show resolved Hide resolved
packages/indy-vdr/src/pool/didIdentifier.ts Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
packages/indy-vdr/package.json Outdated Show resolved Hide resolved
.eslintrc.js Outdated Show resolved Hide resolved
vickysomtee and others added 2 commits January 26, 2023 12:18
work funded by the Ontario Government

Signed-off-by: vickysomtee <victor@animo.id>
@TimoGlastra TimoGlastra dismissed genaris’s stale review January 26, 2023 11:50

Comments have been resolved

@genaris
Copy link
Contributor

genaris commented Jan 26, 2023

I think it would be nice to use @hyperledger/indy-vdr-* packages now that they are going to be released in NPM after the v0.4.0-dev.2 release (https://github.com/hyperledger/indy-vdr/releases/tag/v0.4.0-dev.2)

work funded by the Ontario Government

Signed-off-by: Victor Anene <victor@animo.id>
@TimoGlastra
Copy link
Contributor

I think it would be nice to use @hyperledger/indy-vdr-* packages now that they are going to be released in NPM after the v0.4.0-dev.2 release (hyperledger/indy-vdr@v0.4.0-dev.2 (release))

It doesn't quite work yet, so I'm going to merge this once CI passes and once the build is working we can make a follow up PR.

work funded by the Ontario Government

Signed-off-by: Victor Anene <victor@animo.id>
@TimoGlastra TimoGlastra merged commit e8d6ac3 into openwallet-foundation:main Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create IndyVdrPoolService in AFJ
6 participants