diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 993d7ec9..dae7b314 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,4 +1,4 @@ -# Porting go-nitro latest commits +# Development ## Skipped go-nitro Commits / Features diff --git a/README.md b/README.md index 86ad3cf1..009c2941 100644 --- a/README.md +++ b/README.md @@ -182,3 +182,7 @@ Run relay node using v2 watcher ```bash clearNodeStorage() ``` + +### Development + +* [README](./DEVELOPMENT.md) diff --git a/packages/nitro-util/DEVELOPMENT.md b/packages/nitro-util/DEVELOPMENT.md new file mode 100644 index 00000000..a4c99833 --- /dev/null +++ b/packages/nitro-util/DEVELOPMENT.md @@ -0,0 +1,28 @@ +# Development + +## Generate contract bindings + +* Clone the go-nitro repo () and run `yarn` in root of repo. + +* Move to `go-nitro/packages/nitro-protocol/` and run `yarn hardhat compile` to compile the contract + + ```bash + $ yarn hardhat compile + Generating typings for: 43 artifacts in dir: typechain-types for target: ethers-v5 + Successfully generated 67 typings! + Compiled 42 Solidity files successfully + ``` + +* Copy files `ConsensusApp.json` `NitroAdjudicator.json` `VirtualPaymentApp.json` from go-nitro `packages/nitro-protocol/artifacts` to ts-nitro `packages/nitro-util/contracts` + +* In ts-nitro `packages/nitro-util` run `yarn generate-bindings` to generate the contract bindings + + ```bash + $ yarn generate-bindings + + yarn run v1.22.19 + $ ./scripts/generate-bindings.sh + $ /ts-nitro/node_modules/.bin/typechain --target ethers-v5 --out-dir ./src/contract-bindings ./contracts/NitroAdjudicator.json ./contracts/ConsensusApp.json ./contracts/VirtualPaymentApp.json ./contracts/Token.json + Successfully generated 11 typings! + Done in 1.27s. + ``` diff --git a/packages/nitro-util/README.md b/packages/nitro-util/README.md index 055f50c2..71f3412e 100644 --- a/packages/nitro-util/README.md +++ b/packages/nitro-util/README.md @@ -1,28 +1,5 @@ # nitro-util -## Generate contract bindings +## Development -* Clone the go-nitro repo () and run `yarn` in root of repo. - -* Move to `go-nitro/packages/nitro-protocol/` and run `yarn hardhat compile` to compile the contract - - ```bash - $ yarn hardhat compile - Generating typings for: 43 artifacts in dir: typechain-types for target: ethers-v5 - Successfully generated 67 typings! - Compiled 42 Solidity files successfully - ``` - -* Copy files `ConsensusApp.json` `NitroAdjudicator.json` `VirtualPaymentApp.json` from go-nitro `packages/nitro-protocol/artifacts` to ts-nitro `packages/nitro-util/contracts` - -* In ts-nitro `packages/nitro-util` run `yarn generate-bindings` to generate the contract bindings - - ```bash - $ yarn generate-bindings - - yarn run v1.22.19 - $ ./scripts/generate-bindings.sh - $ /ts-nitro/node_modules/.bin/typechain --target ethers-v5 --out-dir ./src/contract-bindings ./contracts/NitroAdjudicator.json ./contracts/ConsensusApp.json ./contracts/VirtualPaymentApp.json ./contracts/Token.json - Successfully generated 11 typings! - Done in 1.27s. - ``` +* [README](./DEVELOPMENT.md)