Skip to content

Commit

Permalink
Upgrade package versions and change server CLI args (#127)
Browse files Browse the repository at this point in the history
* Upgrade version to 0.1.12

* Change yargs options to lower case

* Upgrade version to 0.1.13

* Change yargs options to camel case

---------

Co-authored-by: neeraj <[email protected]>
  • Loading branch information
nikugogoi and neerajvijay1997 authored Oct 4, 2023
1 parent d675a0d commit 3a42d1d
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Run relay node using v2 watcher

```bash
# In packages/server
yarn cli --pk $BOB_PK --chainpk $BOB_CHAIN_PK --store ./out/bob-db --direct-fund --counterparty $CHARLIE_ADDRESS --get-ledger-channel --amount 1000000
yarn cli --pk $BOB_PK --chain-pk $BOB_CHAIN_PK --store ./out/bob-db --direct-fund --counter-party $CHARLIE_ADDRESS --get-ledger-channel --amount 1000000
# Expected output:
# ts-nitro:engine Constructed Engine +0ms
Expand All @@ -90,7 +90,7 @@ Run relay node using v2 watcher
* Run client for Bob again to create virtual payment channel:

```bash
yarn cli --pk $BOB_PK --chainpk $BOB_CHAIN_PK --store ./out/bob-db --virtual-fund --counterparty $CHARLIE_ADDRESS --get-payment-channel --amount 1000
yarn cli --pk $BOB_PK --chain-pk $BOB_CHAIN_PK --store ./out/bob-db --virtual-fund --counter-party $CHARLIE_ADDRESS --get-payment-channel --amount 1000
# Final Expected output:
# ts-nitro:engine Objective VirtualFund-0xf112143060c59a6d2c5b2d429ca46eb48286e1ca1301da60b9a1a184ad1a58bb is complete & returned to API +1ms
Expand All @@ -106,7 +106,7 @@ Run relay node using v2 watcher
* Run client for Bob to make payment:

```bash
yarn cli --pk $BOB_PK --chainpk $BOB_CHAIN_PK --store ./out/bob-db --pay --amount 50 --payment-channel $PAYMENT_CHANNEL_ID --wait
yarn cli --pk $BOB_PK --chain-pk $BOB_CHAIN_PK --store ./out/bob-db --pay --amount 50 --payment-channel $PAYMENT_CHANNEL_ID --wait
```

* Wait for voucher received log in client Charlie
Expand All @@ -120,7 +120,7 @@ Run relay node using v2 watcher
* Close virtual payment channel using client Bob

```bash
yarn cli --pk $BOB_PK --chainpk $BOB_CHAIN_PK --store ./out/bob-db --virtual-defund --payment-channel $PAYMENT_CHANNEL_ID --get-payment-channel
yarn cli --pk $BOB_PK --chain-pk $BOB_CHAIN_PK --store ./out/bob-db --virtual-defund --payment-channel $PAYMENT_CHANNEL_ID --get-payment-channel
# Final Expected output:
# ts-nitro:engine Objective VirtualDefund-0xe613b9f1651f971473061a968823463e9570b83230c2bce734b21800f663e4aa is complete & returned to API +1ms
Expand All @@ -130,7 +130,7 @@ Run relay node using v2 watcher
* Close the ledger channel using client Bob

```bash
yarn cli --pk $BOB_PK --chainpk $BOB_CHAIN_PK --store ./out/bob-db --direct-defund --ledger-channel $LEDGER_CHANNEL_ID --get-ledger-channel
yarn cli --pk $BOB_PK --chain-pk $BOB_CHAIN_PK --store ./out/bob-db --direct-defund --ledger-channel $LEDGER_CHANNEL_ID --get-ledger-channel
# Final Expected output:
# ts-nitro:engine Objective DirectDefunding-0xe29e2d7ee060fb78b279ac4c8f5cc9bf59334f3e0d25315d5e3c822ed0303d9e is complete & returned to API +1ms
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.1.11"
"version": "0.1.13"
}
4 changes: 2 additions & 2 deletions packages/example-web-app/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@cerc-io/example-web-app",
"version": "0.1.11",
"version": "0.1.13",
"private": true,
"dependencies": {
"@cerc-io/nitro-node": "^0.1.11",
"@cerc-io/nitro-node": "^0.1.13",
"@libp2p/crypto": "^1.0.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/nitro-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/nitro-node",
"version": "0.1.11",
"version": "0.1.13",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -54,14 +54,14 @@
},
"dependencies": {
"@cerc-io/libp2p": "0.42.2-laconic-0.1.4",
"@statechannels/nitro-protocol": "^2.0.0-alpha.5",
"@cerc-io/nitro-util": "^0.1.11",
"@cerc-io/nitro-util": "^0.1.13",
"@cerc-io/peer": "^0.2.60",
"@cerc-io/ts-channel": "1.0.3-ts-nitro-0.1.1",
"@jpwilliams/waitgroup": "^2.1.0",
"@libp2p/crypto": "^1.0.4",
"@libp2p/tcp": "^6.0.0",
"@multiformats/multiaddr": "^11.1.4",
"@statechannels/nitro-protocol": "^2.0.0-alpha.5",
"assert": "^2.0.0",
"async-mutex": "^0.4.0",
"debug": "^4.3.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/nitro-node/scripts/deploy-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const log = debug('ts-nitro:node');
const getArgv = () => yargs.parserConfiguration({
'parse-numbers': false,
}).options({
chainurl: {
chainUrl: {
alias: 'c',
type: 'string',
describe: 'RPC endpoint for the chain',
Expand All @@ -38,7 +38,7 @@ async function main() {
nitroAdjudicatorAddress,
virtualPaymentAppAddress,
consensusAppAddress,
] = await deployContracts(argv.chainurl, argv.key);
] = await deployContracts(argv.chainUrl, argv.key);

const output = {
nitroAdjudicatorAddress,
Expand Down
4 changes: 2 additions & 2 deletions packages/nitro-util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/nitro-util",
"version": "0.1.11",
"version": "0.1.13",
"main": "dist/index.js",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -38,8 +38,8 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@statechannels/nitro-protocol": "^2.0.0-alpha.5",
"@cerc-io/ts-channel": "1.0.3-ts-nitro-0.1.1",
"@statechannels/nitro-protocol": "^2.0.0-alpha.5",
"assert": "^2.0.0",
"debug": "^4.3.4",
"ethers": "^5.7.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/nitro-util/scripts/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const log = debug('ts-nitro:util');
const getArgv = () => yargs.parserConfiguration({
'parse-numbers': false,
}).options({
chainurl: {
chainUrl: {
alias: 'c',
type: 'string',
describe: 'RPC endpoint for the chain',
Expand Down Expand Up @@ -48,16 +48,16 @@ async function main() {
if (argv.address) {
address = argv.address;
} else if (argv.key) {
address = await getAddressByKey(argv.key, argv.chainurl);
address = await getAddressByKey(argv.key, argv.chainUrl);
} else {
throw new Error('Provide either address or private key of an account');
}

if (argv.token) {
const balance = await getTokenBalanceByAddress(argv.token, address, argv.chainurl);
const balance = await getTokenBalanceByAddress(argv.token, address, argv.chainUrl);
log(`Token balance of account ${address} is ${balance.toString()}`);
} else {
const balance = await getBalanceByAddress(address, argv.chainurl);
const balance = await getBalanceByAddress(address, argv.chainUrl);
log(`ETH balance of account ${address} is ${balance.toString()}`);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/nitro-util/scripts/deploy-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const log = debug('ts-nitro:util');
const getArgv = () => yargs.parserConfiguration({
'parse-numbers': false,
}).options({
chainurl: {
chainUrl: {
alias: 'c',
type: 'string',
describe: 'RPC endpoint for the chain',
Expand All @@ -27,7 +27,7 @@ const getArgv = () => yargs.parserConfiguration({
async function main() {
const argv = getArgv();

const provider = new providers.JsonRpcProvider(argv.chainurl);
const provider = new providers.JsonRpcProvider(argv.chainUrl);
const signer = argv.key ? new ethers.Wallet(argv.key, provider) : provider.getSigner();

const tokenAddress = await deployToken(signer, tokenArtifact);
Expand Down
4 changes: 2 additions & 2 deletions packages/nitro-util/scripts/transfer-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const log = debug('ts-nitro:util');
const getArgv = () => yargs.parserConfiguration({
'parse-numbers': false,
}).options({
chainurl: {
chainUrl: {
alias: 'c',
type: 'string',
describe: 'RPC endpoint for the chain',
Expand Down Expand Up @@ -43,7 +43,7 @@ const getArgv = () => yargs.parserConfiguration({
async function main() {
const argv = getArgv();

const provider = new providers.JsonRpcProvider(argv.chainurl);
const provider = new providers.JsonRpcProvider(argv.chainUrl);
const signer = new Wallet(argv.key, provider);
const from = await signer.getAddress();

Expand Down
34 changes: 17 additions & 17 deletions packages/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an

```bash
# In packages/server
yarn cli --pk $BOB_PK --chainpk $BOB_CHAIN_PK --store ./out/bob-db --wait
yarn cli --pk $BOB_PK --chain-pk $BOB_CHAIN_PK --store ./out/bob-db --wait
# Expected output:
# ts-nitro:engine Constructed Engine +0ms
Expand All @@ -83,7 +83,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
```bash
# In packages/server
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --direct-fund --counterparty $BOB_ADDRESS --amount 1000000
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --direct-fund --counter-party $BOB_ADDRESS --amount 1000000
# Expected output:
# ts-nitro:engine Constructed Engine +0ms
Expand All @@ -103,7 +103,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
* Run command to get ledger channel information
```bash
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --get-ledger-channel --ledger-channel $LEDGER_CHANNEL_ID
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --get-ledger-channel --ledger-channel $LEDGER_CHANNEL_ID
# Expected output:
# ts-nitro:server Ledger channel 0xb18b4a179496b698d1adef6c6a57a8debf75c1000ed69154615a5a4904036e4d status:
Expand All @@ -123,7 +123,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
* Run client for Alice again to create virtual payment channel:
```bash
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-fund --counterparty $BOB_ADDRESS --amount 1000
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-fund --counter-party $BOB_ADDRESS --amount 1000
# Final Expected output:
# ts-nitro:engine Objective VirtualFund-0x033d8dcf8a34333cf7807082c03cb940241a3a115a7fa44e47de2c9ec7e5e992 is complete & returned to API +1ms
Expand All @@ -140,7 +140,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
* Run command to get payment channel information
```bash
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID
# Expected output:
# ts-nitro:server Virtual payment channel 0x033d8dcf8a34333cf7807082c03cb940241a3a115a7fa44e47de2c9ec7e5e992 status:
Expand All @@ -160,7 +160,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
* Run client for Alice to make payment:
```bash
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --pay --amount 50 --payment-channel $PAYMENT_CHANNEL_ID --wait
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --pay --amount 50 --payment-channel $PAYMENT_CHANNEL_ID --wait
# Expected output:
# ts-nitro:engine Constructed Engine +0ms
Expand Down Expand Up @@ -192,13 +192,13 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
* Check status of payment channel after making payments
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID
```
* Close virtual payment channel using client Alice
```bash
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-defund --payment-channel $PAYMENT_CHANNEL_ID --get-payment-channel
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-defund --payment-channel $PAYMENT_CHANNEL_ID --get-payment-channel
# Final Expected output:
# ts-nitro:engine Objective VirtualDefund-0x033d8dcf8a34333cf7807082c03cb940241a3a115a7fa44e47de2c9ec7e5e992 is complete & returned to API +1ms
Expand All @@ -220,7 +220,7 @@ Instructions to run two instances of `ts-nitro` clients in a node environment an
* Close the ledger channel using client Alice
```bash
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --direct-defund --ledger-channel $LEDGER_CHANNEL_ID --get-ledger-channel
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --direct-defund --ledger-channel $LEDGER_CHANNEL_ID --get-ledger-channel
# Final Expected output:
# ts-nitro:engine Objective DirectDefunding-0xb18b4a179496b698d1adef6c6a57a8debf75c1000ed69154615a5a4904036e4d is complete & returned to API +1ms
Expand Down Expand Up @@ -358,7 +358,7 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
```bash
# In packages/server
yarn cli --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --direct-fund --counterparty $ERIN_ADDRESS --amount 1000000 --additional-peers ./additional-peers.json
yarn cli --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --direct-fund --counter-party $ERIN_ADDRESS --amount 1000000 --additional-peers ./additional-peers.json
# Expected output:
# ts-nitro:engine Constructed Engine +0ms
Expand All @@ -378,7 +378,7 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
* Run command to get ledger channel information
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --get-ledger-channel --ledger-channel $LEDGER_CHANNEL_ID --counterparty $ERIN_ADDRESS --amount 1000000 --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --get-ledger-channel --ledger-channel $LEDGER_CHANNEL_ID --counter-party $ERIN_ADDRESS --amount 1000000 --additional-peers ./additional-peers.json
# Expected output:
# ts-nitro:server Ledger channel 0xb18b4a179496b698d1adef6c6a57a8debf75c1000ed69154615a5a4904036e4d status:
Expand All @@ -398,7 +398,7 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
* Run client for Alice again to create virtual payment channel:
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-fund --counterparty $ERIN_ADDRESS --amount 1000 --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-fund --counter-party $ERIN_ADDRESS --amount 1000 --additional-peers ./additional-peers.json
# Final Expected output:
# ts-nitro:engine Objective VirtualFund-0x033d8dcf8a34333cf7807082c03cb940241a3a115a7fa44e47de2c9ec7e5e992 is complete & returned to API +1ms
Expand All @@ -415,7 +415,7 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
* Run command to get payment channel information
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID --counterparty $ERIN_ADDRESS --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID --counter-party $ERIN_ADDRESS --additional-peers ./additional-peers.json
# Expected output:
# ts-nitro:server Virtual payment channel 0x033d8dcf8a34333cf7807082c03cb940241a3a115a7fa44e47de2c9ec7e5e992 status:
Expand All @@ -435,7 +435,7 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
* Run client for Alice to make payment:
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --pay --amount 50 --payment-channel $PAYMENT_CHANNEL_ID --wait --counterparty $ERIN_ADDRESS --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --pay --amount 50 --payment-channel $PAYMENT_CHANNEL_ID --wait --counter-party $ERIN_ADDRESS --additional-peers ./additional-peers.json
# Expected output:
# ts-nitro:engine Constructed Engine +0ms
Expand All @@ -448,13 +448,13 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
* Check status of payment channel after making payments
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID --counterparty $ERIN_ADDRESS --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --get-payment-channel --payment-channel $PAYMENT_CHANNEL_ID --counter-party $ERIN_ADDRESS --additional-peers ./additional-peers.json
```
* Close virtual payment channel using client Alice
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-defund --payment-channel $PAYMENT_CHANNEL_ID --counterparty $ERIN_ADDRESS --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --virtual-defund --payment-channel $PAYMENT_CHANNEL_ID --counter-party $ERIN_ADDRESS --additional-peers ./additional-peers.json
# Final Expected output:
# ts-nitro:engine Objective VirtualDefund-0x033d8dcf8a34333cf7807082c03cb940241a3a115a7fa44e47de2c9ec7e5e992 is complete & returned to API +1ms
Expand All @@ -477,7 +477,7 @@ Instructions to run instances of `ts-nitro` (node) and `go-nitro` clients and cr
* Close the ledger channel using client Alice
```bash
yarn cli -p 3005 --pk $ALICE_PK --chainpk $ALICE_CHAIN_PK --store ./out/alice-db --direct-defund --ledger-channel $LEDGER_CHANNEL_ID --get-ledger-channel --counterparty $ERIN_ADDRESS --additional-peers ./additional-peers.json
yarn cli -p 3005 --pk $ALICE_PK --chain-pk $ALICE_CHAIN_PK --store ./out/alice-db --direct-defund --ledger-channel $LEDGER_CHANNEL_ID --get-ledger-channel --counter-party $ERIN_ADDRESS --additional-peers ./additional-peers.json
# Final Expected output:
# ts-nitro:engine Objective DirectDefunding-0xb18b4a179496b698d1adef6c6a57a8debf75c1000ed69154615a5a4904036e4d is complete & returned to API +1ms
Expand Down
6 changes: 3 additions & 3 deletions packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/server",
"version": "0.1.11",
"version": "0.1.13",
"main": "index.js",
"license": "MIT",
"private": true,
Expand Down Expand Up @@ -32,8 +32,8 @@
"chain:anvil": "hardhat --config hardhat.anvil.config.ts node"
},
"dependencies": {
"@cerc-io/nitro-node": "^0.1.11",
"@cerc-io/nitro-util": "^0.1.11",
"@cerc-io/nitro-node": "^0.1.13",
"@cerc-io/nitro-util": "^0.1.13",
"assert": "^2.0.0",
"debug": "^4.3.4",
"dotenv": "^16.0.3",
Expand Down
Loading

0 comments on commit 3a42d1d

Please sign in to comment.