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

Add doc for passing param path to deploy function #6059

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/src/content/ignition/docs/guides/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,34 @@ You can also define global parameters that will be available to all modules. To

In this example, the `shouldBeAllowed` parameter will be `true` for all modules except `MyModule`, where it will be `false`. Global parameters can be accessed in the same way as module parameters.

### Module parameters when deploying via Hardhat Scripts

If you're deploying Ignition Modules via Hardhat Scripts, you can pass an absolute path to your parameters JSON file directly to the `deploy` function. Here's an example of how to do this:

```typescript
import hre from "hardhat";
import path from "path";

import ApolloModule from "../ignition/modules/Apollo";

async function main() {
const { apollo } = await hre.ignition.deploy(ApolloModule, {
// This must be an absolute path to your parameters JSON file
parameters: path.resolve(__dirname, "../ignition/parameters.json"),
});

console.log(`Apollo deployed to: ${await apollo.getAddress()}`);
}

main().catch(console.error);
```

:::tip

You can read more about deploying and using Ignition modules in Hardhat scripts in the [scripts guide](/ignition/docs/guides/scripts).

:::

## Inspecting an existing deployment

To get a list of all the deployment IDs that exist in the current project, run:
Expand Down
Loading