You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+8-3
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,9 @@ Up-to-date documentation on Chainlink Functions can be found [here](https://docs
38
38
39
39
Install Node.js version `18.18.0` or higher _and_ Deno version `1.36.0` or higher.
40
40
41
+
For version 0.3.2 and above of this functions-toolkit package, Anvil is required to run local tests. A `Makefile` is included to automate the installation and build process. Simply run `make install` to install Anvil and all npm packages.
42
+
If you already have anvil and/or foundry (the Foundry toolchain) installed, you would not need to run this. But you may want to run `foundryup` to update your version and `npm install` to install packages.
43
+
41
44
Chainlink Functions requires signing a terms of service agreement before creating a billing subscription. See this [getting started](https://docs.chain.link/chainlink-functions/getting-started) section in the docs.
> For version 0.3.2 and above of this functions-toolkit package, Anvil is REQUIRED to use `localFunctionsTestnet`. Please run `make install` to install Anvil and all the necessary dependencies. If you already have anvil and/or foundry (the Foundry toolchain) installed, you would not need to run this. But you may want to run `foundryup` to update your version and `npm install` to install packages.
601
+
596
602
For debugging smart contracts and the end-to-end request flow on your local machine, you can use the `localFunctionsTestnet` function. This creates a local testnet RPC node with a mock Chainlink Functions contracts. You can then deploy your own Functions consumer contract to this local network, create and manage subscriptions, and send requests. Request processing will simulate the behavior of an actual DON where the request is executed 4 times and the discrete median response is transmitted back to the consumer contract. (Note that Chainlink Functions uses the following calculation to select the discrete median response: `const medianResponse = responses[responses.length - 1) / 2]`).
597
603
598
604
The `localFunctionsTestnet` function takes the following values as arguments.
getFunds: (address: string, { weiAmount, juelsAmount }: { weiAmount?: BigInt | string; juelsAmount?: BigInt | string }) => Promise<void> // Method which can be called to send funds to any address
629
-
close: () => Promise<void> // Method to close the server
634
+
close: () => Promise<void> // Method to stop the Anvil instance
630
635
donId: string // DON ID for simulated DON
631
636
// The following values are all Ethers.js contract types: https://docs.ethers.org/v5/api/contract/contract/
632
637
linkTokenContract: Contract // Mock LINK token contract
0 commit comments