Skip to content

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

Merged
dOrgJelli merged 5 commits into
origin-devfrom
pileks/feat/cli-wrapper-envs-option
Dec 3, 2022
Merged

CLI - Add --wrapper-envs option to build, codegen, docgen and test#1437
dOrgJelli merged 5 commits into
origin-devfrom
pileks/feat/cli-wrapper-envs-option

Conversation

@pileks
Copy link
Copy Markdown
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