Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update local deployment guide. Improve CLI commands. #485

Merged
merged 9 commits into from
Feb 18, 2021

Conversation

sept-en
Copy link
Contributor

@sept-en sept-en commented Feb 8, 2021

Fixes #467

Copy link
Contributor

@mfornet mfornet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sept-en can you rebase on top of master, such that only commits relevant to this PR are taking into account.

@sept-en
Copy link
Contributor Author

sept-en commented Feb 15, 2021

@mfornet now only relevant commits are applied on top of master.

@sept-en sept-en requested a review from mfornet February 15, 2021 12:27
README.md Outdated Show resolved Hide resolved
cli/index.js Outdated
Comment on lines 785 to 790
[
'near-master-account',
'near-erc20-account',
'near-network-id',
'near-node-url',
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing near-receiver-account

Offtopic of this PR, but this is a reason why we need more consistent way to handle CLI, using a framework such as yargs.

// View
async function getBridgeOnNearBalance ({
nearReceiverAccount,
nearMasterAccount: nearMasterAccountId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using different name here?

Suggested change
nearMasterAccount: nearMasterAccountId,
nearMasterAccount,

)

const nearTokenContract = new nearAPI.Contract(
nearMasterAccount,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is undefined at this point

cli/index.js Outdated
'--near-receiver-account <near_receiver_account>',
'The account on NEAR blockchain that received the minted token.'
)
.description('Gets balance on Near for Rainbow-Bridge Eth on Near Prover.'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Near Prover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong info related to the old account that was used everywhere.

cli/index.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -69,7 +69,7 @@ To learn the commands that you can use with the rainbow bridge run
Alternatively, clone this repo, `yarn install`, then you can see what commands you can use with:

```
./index.js --help
cli/index.js --help
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout the README the command rainbow is being used. Either change it to use cli/index.js everywhere, or use rainbow here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rainbow --help command is mentioned a few lines above.
Therefore, I believe that it's good to have cli/index.js here, so if someone decides to test using local code, it's clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a second thought, for the sake of consistency, can you remove first two instructions:

(1) npm i -g rainbow-bridge-cli
(2) rainbow --help

Since we are not releasing new versions. If a developer tries that it will just fail. So let's stick with the cli/index.js interface for now on all the steps.

README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mfornet mfornet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please address both comments.

@@ -69,7 +69,7 @@ To learn the commands that you can use with the rainbow bridge run
Alternatively, clone this repo, `yarn install`, then you can see what commands you can use with:

```
./index.js --help
cli/index.js --help
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a second thought, for the sake of consistency, can you remove first two instructions:

(1) npm i -g rainbow-bridge-cli
(2) rainbow --help

Since we are not releasing new versions. If a developer tries that it will just fail. So let's stick with the cli/index.js interface for now on all the steps.

nearNodeUrl,
}) {
try {
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Suggested change
// @ts-ignore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got it. I agree in this case it's better to stick to cli/index.js approach.

sept-en and others added 8 commits February 17, 2021 22:26
* CLI: make transfer functions callable directly from CLI (without
  "TESTING" prefix).
* CLI: improve `getErc20Balance` method.
* CLI: add `getBridgeOnNearBalance` method.
* Update README.
* Minor improvements.
* CLI: make aux methods (transfer and view-balance functionality)
  to be called through the TESTING subcommand again.
* CLI: `getBridgeOnNearBalance` - don't provide private key to the view
  method.
* Update README.
Co-authored-by: Marcelo Fornet <mfornet94@gmail.com>
Co-authored-by: Marcelo Fornet <mfornet94@gmail.com>
@mfornet
Copy link
Contributor

mfornet commented Feb 18, 2021

@sept-en address formatting issues, right now we are using standardjs. Fix with:

yarn
yarn standard --fix

@mfornet mfornet enabled auto-merge (squash) February 18, 2021 16:33
@mfornet mfornet merged commit 4ee7472 into Near-One:master Feb 18, 2021
karim-en pushed a commit that referenced this pull request Dec 20, 2021
* (#467) Minor CLI improvements. Update README.

* CLI: make transfer functions callable directly from CLI (without
  "TESTING" prefix).
* CLI: improve `getErc20Balance` method.
* CLI: add `getBridgeOnNearBalance` method.
* Update README.
* Minor improvements.

* (#467) Update README. CLI commands minor changes.

* CLI: make aux methods (transfer and view-balance functionality)
  to be called through the TESTING subcommand again.
* CLI: `getBridgeOnNearBalance` - don't provide private key to the view
  method.
* Update README.

* (#467) Update README.

* Update cli/index.js

Co-authored-by: Marcelo Fornet <mfornet94@gmail.com>

* Update README

Co-authored-by: Marcelo Fornet <mfornet94@gmail.com>

* Update README. Minor improvements and fixes.

* Update README: use `cli/index.js` as a rainbow cmd.

* Remove redundant code.

* Lint fixes.

Co-authored-by: Marcelo Fornet <mfornet94@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check the local deployment part of the README.md
2 participants