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

Fixed daf-resolver configuration #298

Merged
merged 5 commits into from
Dec 14, 2020
Merged

Fixed daf-resolver configuration #298

merged 5 commits into from
Dec 14, 2020

Conversation

simonas-notcat
Copy link
Contributor

This is a breaking change.

Add this to your agent.yml:

ethr-did-resolver:
  $require: ethr-did-resolver?t=function&p=/ethr#getResolver
  $args:
    - networks:
      - name: mainnet
        rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
      - name: rinkeby
        rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
      - name: ropsten
        rpcUrl: https://ropsten.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
      - name: kovan
        rpcUrl: https://kovan.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
      - name: goerli
        rpcUrl: https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
      - name: private
        rpcUrl: http://localhost:8545/
        registry: '0x05cc574b19a3c11308f761b3d7263bd8608bc532'

web-did-resolver:
  $require: web-did-resolver?t=function&p=/web#getResolver

universal-resolver:
  $require: daf-resolver#UniversalResolver
  $args:
    - url: https://dev.uniresolver.io/1.0/identifiers/

resolver:
  $require: did-resolver#Resolver
  $args:
    - ethr: 
        $ref: /ethr-did-resolver
      web: 
        $ref: /web-did-resolver
      io: 
        $ref: /universal-resolver   

Update agent.plugins

        - $require: daf-resolver#DafResolver
          $args:
            - resolver:
                $ref: /resolver

@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #298 (ab9a32f) into beta (73ab0e6) will decrease coverage by 0.69%.
The diff coverage is 30.76%.

@@            Coverage Diff             @@
##             beta     #298      +/-   ##
==========================================
- Coverage   65.96%   65.27%   -0.70%     
==========================================
  Files          64       63       -1     
  Lines        1569     1552      -17     
  Branches      243      242       -1     
==========================================
- Hits         1035     1013      -22     
- Misses        438      444       +6     
+ Partials       96       95       -1     

Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

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

This looks great!

I think we should also add some examples or tests that show how this links to (or solves) #205

resolver: new Resolver({
ethr: ethrDidResolver({
networks: [
{ name: 'mainnet', rpcUrl: 'https://mainnet.infura.io/v3/' + infuraProjectId },
Copy link
Member

Choose a reason for hiding this comment

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

This would be a good place to test that using a custom web3 provider also works.
It would be something like this: { name: 'rinkeby', provider: myCustomWeb3Provider }

- networks:
- name: mainnet
rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
- name: rinkeby
Copy link
Member

Choose a reason for hiding this comment

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

This is also a good place to try to use a custom web3 provider class

packages/daf-resolver/src/__tests__/resolver.test.ts Outdated Show resolved Hide resolved
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.

2 participants