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

CLI - Add --wrapper-envs option to build, codegen, docgen and test #1437

Merged
merged 5 commits into from
Dec 3, 2022

Conversation

pileks
Copy link
Contributor

@pileks pileks commented Nov 24, 2022

Remaining work

Comments from 28.11.2022. dev sync

  • add support for YAML in addition to JSON
  • parse tokens for and load env variables
    • This is achieved in the same manner that the deploy command parses and imports env variables.
  • Update CLI reference documentation

Description

This PR aims to give developers a quick and easy way to specify wrapper envs when running CLI commands that support the -c, --client-config option.

For example, in order to use a non-throttled Infura API key inside the Ethereum Plugin, you can create an envs.json file like such:

{
  "ens/ethereum.polywrap.eth": {
    "connection": {
      "node": "https://mainnet.infura.io/v3/your_api_key",
      "networkNameOrChainId": "mainnet"
    }
  }
}

and run a command specifying that file:

polywrap codegen --wrapper-envs ./envs.json

Additional notes

A change was made to the Ethereum Plugin in order for it to properly consume the supplied env, with some comments added as to the reasoning behind the change. The change does the trick, but I feel like we should do a more detailed review as to why we are using the approach we are currently, and maybe set up a more robust solution.

@pileks pileks marked this pull request as ready for review November 28, 2022 14:08
dOrgJelli
dOrgJelli previously approved these changes Dec 3, 2022
@dOrgJelli dOrgJelli merged commit 8985e7e into origin-dev Dec 3, 2022
@dOrgJelli dOrgJelli deleted the pileks/feat/cli-wrapper-envs-option branch April 10, 2023 17:01
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