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

Allow gcclient to connect to chaincode from GC gateway URL #232

Open
dzikowski opened this issue May 16, 2024 · 0 comments
Open

Allow gcclient to connect to chaincode from GC gateway URL #232

dzikowski opened this issue May 16, 2024 · 0 comments

Comments

@dzikowski
Copy link
Collaborator

Currently gcclient allows to connect to GC gateway with forApiConfig method, which requires the following parameters (assuming #231 is resolved):

export interface RestApiClientConfig {
  apiUrl: string;
  userId?: string;
  userSecret?: string;
  configPath: string;
}

We would like to allow an additional way of connecting to the contract, by contract URL. We should add gcclient.forContractUrl(url) method which accepts just a contract URL, like: https://gateway.stage.galachain.com/api/hackathon03/gc-8c757ffb9ac963b04e45b5e6e8a298992c530c23-GalaChainToken. Then it would use a similar flow as RestApiClient, just with no need of fetching contract API.

Probably the best way to approach is to:

  1. add gcclient.forContractUrl(url) method
  2. copy RestApiClientBuilder and remove non relevant code (duplication is good here)
  3. copy RestApiClient and remove non relevant code (also duplication is good)

Then we can use this way of connecting to the contract with @gala-chain/connect

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

1 participant