Skip to content

Commit

Permalink
Merge pull request #6059 from NomicFoundation/ignition/scripts-module…
Browse files Browse the repository at this point in the history
…s-doc

Add doc for passing param path to deploy function
  • Loading branch information
zoeyTM authored Dec 18, 2024
2 parents edd7d35 + de27804 commit 2f8447f
Showing 1 changed file with 28 additions and 0 deletions.
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

0 comments on commit 2f8447f

Please sign in to comment.