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

Multichain Provider #572

Closed
alexcos20 opened this issue Nov 15, 2022 · 3 comments
Closed

Multichain Provider #572

alexcos20 opened this issue Nov 15, 2022 · 3 comments
Assignees

Comments

@alexcos20
Copy link
Member

alexcos20 commented Nov 15, 2022

(part of oceanprotocol/pm#185)

Make sure that chainId is available when provider cannot figure it out.
Provider will choose the corresponding web3 object based on chainId

Configuration changes:

  • Remove PROVIDER_ADDRESS from Dockerfile, it's not needed
  • PROVIDER_PRIVATE_KEY : can be a string (same key used for all chains) or an array of objects containing chain_id as key and private_key as value:
[
      {"1": "0x123"},
      {"5": "0x124"}
   ]
  • NETWORK_URL : an array of objects containing chain_id as key and RPC URL as value:
[
      {"1": "http://infura.io/mainnet"},
      {"5": "https://getblock"}
   ]

Root endpoint change

instead of :

{"chainId":1,"providerAddress":"0xeAFDC69612a8bF720FBfE6A5520Cfede69a9a5b5",.....}

we will output chainId and providerAddress as arrays:

{"chainId":[1,5],"providerAddress":["0xeAFDC69612a8bF720FBfE6A5520Cfede69a9a5b5","0x123], ....}

Provider endpoints which require update:

  • /api/services/encrypt - add chainId , in case Provider has different privateKeys per each chain

Provider endpoints that do not need updates, but code logic is changing:

  • /api/services/initialize - provider will take chainId by resolving DID
  • /api/services/download - provider will take chainId by resolving DID, select coresponding web3 object and search for txId & events
  • /api/services/fileinfo - provider will take chainId by resolving DID if DID is passed, otherwise it's just a Files object
  • POST /api/services/compute - provider will take chainId by resolving each DID (algo, datasets, etc)

Cool stuff:

  • this will allow compute jobs when assets are on different chains (ie: algo on mainnet, dataset on polygon)
@calina-c
Copy link
Contributor

calina-c commented Nov 22, 2022

Blocked by changes needed to c2d, where chainId should be removed from status, stop and delete endpoints. The bulk of the rest is done.

@jamiehewitt15
Copy link
Member

Will the URI for the new multichain provider be https://v4.provider.oceanprotocol.com?

@calina-c
Copy link
Contributor

Closed by #574

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

No branches or pull requests

3 participants