Skip to content

Commit

Permalink
Update README and DEVELOPMENT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajvijay1997 committed Apr 23, 2024
1 parent f8b7906 commit 618dd73
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Porting go-nitro latest commits
# Development

## Skipped go-nitro Commits / Features

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,7 @@ Run relay node using v2 watcher
```bash
clearNodeStorage()
```

### Development

* [README](./DEVELOPMENT.md)
28 changes: 28 additions & 0 deletions packages/nitro-util/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Development

## Generate contract bindings

* Clone the go-nitro repo (<https://github.com/statechannels/go-nitro>) 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.
```
27 changes: 2 additions & 25 deletions packages/nitro-util/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
# nitro-util

## Generate contract bindings
## Development

* Clone the go-nitro repo (<https://github.com/statechannels/go-nitro>) 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)

0 comments on commit 618dd73

Please sign in to comment.