Skip to content

Commit 9280036

Browse files
committed
doc(plugin): update readme
1 parent feab296 commit 9280036

File tree

2 files changed

+1421
-9
lines changed

2 files changed

+1421
-9
lines changed

hardhat-kadena-plugin/packages/hardhat-kadena/README.md

+39-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ To install the plugin, run the following command: **NOT PUBLISHED YET**
1010
npm install hardhat_kadena
1111
```
1212

13+
## Build from source
14+
You can also build the plugin from source. To do this, first, clone the repository and follow these steps:
15+
16+
**Note**: You need to have `pnpm` installed.
17+
```bash
18+
cd hardhat-kadena-plugin
19+
pnpm install
20+
cd packages/hardhat-kadena
21+
pnpm build
22+
```
23+
Once built, you can run the tests for the example project:
24+
```bash
25+
cd ../solidity-example
26+
pnpm hardhat test
27+
```
28+
29+
1330
## Usage
1431

1532
To use the plugin in your Hardhat project, import it in your Hardhat configuration file (`hardhat.config.ts` or `hardhat.config.js`):
@@ -39,8 +56,7 @@ The plugin uses the following configuration options:
3956
| `accounts` | `HardhatNetworkAccountsConfig` (optional) | Defines the accounts configuration for the network (default: Hardhat network accounts). |
4057
| `chains` | `number` (optional) | Specifies the number of chains in the Chainweb network (default: `2`). |
4158
| `graph` | `{ [key: number]: number[] }` (optional) | Defines the graph structure of the Chainweb network where keys represent chain IDs and values are arrays of connected chain IDs (default: Pearson graph). |
42-
| `logging` | `"none" \| "info" \| "debug"` (optional) | Sets the logging level for debugging
43-
purposes (default: `"info"`). |
59+
| `logging` | `"none" \| "info" \| "debug"` (optional) | Sets the logging level for debugging purposes (default: `"info"`). |
4460

4561
## Graph
4662
If you don’t provide a graph, the plugin automatically generates one for the chains using its built-in algorithm. Currently, it supports only 2, 3, 10, or 20 chains. If you need a different number of chains, you must explicitly pass the graph property
@@ -51,7 +67,13 @@ If you don’t provide a graph, the plugin automatically generates one for the c
5167
module.exports = {
5268
solidity: "0.8.20",
5369
chainweb: {
54-
chains: 2,
70+
chains: 4,
71+
graph: {
72+
0: [1,2,3]
73+
1: [0,2,3]
74+
2: [0,1,3]
75+
3: [0,1,2]
76+
}
5577
},
5678
};
5779
```
@@ -73,14 +95,11 @@ module.exports = {
7395
networks: {
7496
kadena_devnet_0: {
7597
chainId: 123, // Use custom chainId for chain 0
98+
gasPrice: 0.1 // set custom gas price
7699
},
77100
},
78101
chainweb: {
79102
chains: 2,
80-
graph: {
81-
0: [1],
82-
1: [0],
83-
},
84103
},
85104
};
86105
```
@@ -117,6 +136,17 @@ export interface ChainwebPluginApi {
117136
| `deployMocks` | None | `ReturnType<DeployContractOnChains>` | Deploys mock contracts for testing. |
118137
| `network` | None | `ChainwebNetwork` | Provides access to the Chainweb network object. |
119138

139+
For the spv proof you need to pass the origin with the following interface
140+
```TS
141+
export interface Origin {
142+
chain: bigint;
143+
originContractAddress: string;
144+
height: bigint;
145+
txIdx: bigint;
146+
eventIdx: bigint;
147+
}
148+
```
149+
120150
### Example
121151
```TS
122152
import { chainweb } from "hardhat"
@@ -140,8 +170,9 @@ This plugin overrides `switchNetwork` from `hardhat-switch-network` to load the
140170
## Future Works
141171

142172
- Support external Chainweb configuration.
173+
- Support chainweb docker compose
143174
- Support multiple Chianweb
144-
- Expose PRC Server
175+
- Expose PRC Server for `hardhat --node`
145176

146177
## License
147178

0 commit comments

Comments
 (0)