Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

[v4.0.0] Reorganize, Reduce and Enhance #1082

Merged
merged 25 commits into from
Feb 8, 2024
Merged

Conversation

gagdiez
Copy link
Contributor

@gagdiez gagdiez commented Jan 23, 2024

This is a proposal for a new major version of near-cli.

The main change is that the code was re-organized so it is simpler to maintain:

  • All commands are now in the commands folder.
  • Added multiple tests (all now running directly on testnet)
  • All packages were updated (node v16 is now the minimum version, which is understandable)

The second change is that the complexity of near-cli was reduced by removing a couple of features:

  • Removed analytics
  • Breaking: removed x-api option.
  • Breaking: removed stake command.
  • Breaking: removed all evm commands.
  • Breaking: Removed all Ledger support.
  • Breaking: removed all validator commands.
  • Breaking: removed walletUrl, nodeUrl and helperUrl options.
  • Breaking: removed dev-deploy command. Users must now create an account (can fund it with a faucet) and deploy to it.

The third change is that Errors are now handled on each command, and not through some obscure middleware.

The fourth change is that a couple of fixes were implemented:

  • create-account can now create TLA, sub-accounts and .testnet/.near accounts. The user can choose to fund the new account with an existing account or with a faucet service.
  • Fix: Default wallet is now MyNearWallet install of NearWallet
  • Fix: Removed global flags, since they were not so global at all.. now each command has only the strict and necessary flags that it needs.
  • Fix: Fixed --networkId flag, now it works as expected (i.e. switches network) in all relevant commands.
  • Chore: many commands were renamed, but aliases are set in place for retro-compatibility.

Fifth: besides the removal of commands explained in the second point, there is just one more breaking change:

  • The generate-key command does not save the key by default, now it needs the --saveImplicit flag to save the key. Also, it does not overwrite the key if it exists, it needs the --force flag for that.

@gagdiez gagdiez requested review from volovyks and ailisp January 23, 2024 11:05
@gagdiez gagdiez changed the title [v4.0.0] Simplify, Reduce and Reorganize [v4.0.0] Reorganize, Reduce and Enhance Jan 23, 2024
@gagdiez
Copy link
Contributor Author

gagdiez commented Jan 23, 2024

Comparison:

All commands and options for near-cli 4.0.0

Screenshot 2024-01-23 at 13 25 15

Commands and options in the same space for current near-cli

Screenshot 2024-01-23 at 13 26 41 Screenshot 2024-01-23 at 13 27 01

@gagdiez gagdiez mentioned this pull request Jan 23, 2024
@volovyks
Copy link
Collaborator

Lots of good changes. Nice work @gagdiez!
Are you sure we want to delete some of the features? Lise staking and ledger?
Overall we should move to the Rust version and sunset this one.

@gagdiez
Copy link
Contributor Author

gagdiez commented Jan 23, 2024

@volovyks

Edit: stake is for validators? or for users?. Because I would recommend validators to use near-cli-rs and users to use a wallet for staking.

For Ledger, I saw it added a lot of complexity to the code... thought I might be evaluating the situation wrong here. Also, don't want a Ledger to be connected to a project with minimum support.

@volovyks
Copy link
Collaborator

@gagdiez stake for users.
Ok, we may ask users to use Rust version for Ledger.

@gagdiez
Copy link
Contributor Author

gagdiez commented Jan 23, 2024

@volovyks should we then implement stake, unstake and withdraw? I do not like the idea of having only stake, since then anyway you need a wallet to unstake it.

Otherwise, we can remove it now, and bring it back later if anyone was handling their staking through the CLI (which again, would be weird, since they cannot unstake it through there later)

@gagdiez gagdiez merged commit b9038a0 into master Feb 8, 2024
5 checks passed
@gagdiez gagdiez deleted the simplify-and-reorgazine branch February 8, 2024 15:16
@gagdiez
Copy link
Contributor Author

gagdiez commented Feb 8, 2024

Merged since it is simpler to start fixing this version that keep working on the previous one (for example, TLA account creation is now broken)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants