Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
secrets support
  • Loading branch information
aelmanaa committed Apr 19, 2023
commit a39aa8bba71c46cd422f206f16a394ccc14270b1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require("@nomiclabs/hardhat-ethers")
require("@chainlink/env-enc").config()
require("@nomicfoundation/hardhat-toolbox")

/**
* @type import('hardhat/config').HardhatUserConfig
Expand Down Expand Up @@ -36,6 +36,15 @@ module.exports = {
},
},
},
{
version: "0.7.0",
settings: {
optimizer: {
enabled: true,
runs: 1_000,
},
},
},
{
version: "0.6.6",
settings: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Now that the consumer contract is deployed and the subscription is created and f

## Send requests

After your on-chain resources are configured, you can send Chainlink Functions requests to the DON. This can be done from a Web3 application, script, another on-chain smart contract, or any other location capable of submitting requests to your consumer contract. This example uses [Ethers v6](https://docs.ethers.org/v6/) without Hardhat to show you how to generate a request, encrypt secrets, send your request, and read the fulfillment response.
After your on-chain resources are configured, you can send Chainlink Functions requests to the DON. This can be done from a Web3 application, script, another on-chain smart contract, or any other location capable of submitting requests to your consumer contract. This example shows you how to generate a request, encrypt secrets, send your request, and read the fulfillment response.

Each request has the following components:

Expand All @@ -263,13 +263,13 @@ For this example, download some example source code and create a script to assem
1. Use `curl` to get the example source code. This code runs on each node in the DON and returns a response to your consumer contract. For this example, use the source from the [Call an API](/chainlink-functions/tutorials/api-query-parameters) tutorial. The following `curl` request creates a file named `Functions-request-source.js` with the source code:

```shell
curl -o Functions-request-source.js https://raw.githubusercontent.com/dwightjl/functions-examples/main/Functions-request-source.js
curl -o Functions-request-source.js https://raw.githubusercontent.com/smartcontractkit/smart-contract-examples/main/Functions-request-source.js
```

1. Get the example script and put it in the `./scripts` directory:

```shell
curl -o ./scripts/request.js https://raw.githubusercontent.com/dwightjl/functions-examples/main/scripts/request.js
curl -o ./scripts/request.js https://raw.githubusercontent.com/smartcontractkit/smart-contract-examples/main/scripts/request.js
```

1. Edit the script and set your deployed consumer address in `const consumerAddress`:
Expand Down