Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Create a bootstrap that allows creation of contract-specific command line tools #207

Open
frol opened this issue Jun 8, 2020 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@frol
Copy link

frol commented Jun 8, 2020

I believe that it will greatly improve the DevX of contracts if developers can have a way to easily bootstrap a CLI tool for a contract (to have a dedicated tool instead of using near-shell with manual JSON crafting).

Thus, instead of

near call my_validator deposit '{}' --accountId user1 --amount 100
near call my_validator stake '{"amount": "100000000000000000000000000"}' --accountId user1

a contract user will have a specific interface, thus minimizing the scope (no need to understand and remember the JSON format) and reducing the room for an error:

npx near-staking-pool my_validator deposit-and-stake 100N

Another example where we already want to have a CLI for a contract: near/bounties#10

/cc @evgenykuzyakov @potatodepaulo @nearmax @mikedotexe @amgando

@willemneal
Copy link

This issue is somewhat related and more general purpose for calling any contract: near/near-cli#367

@frol
Copy link
Author

frol commented Jun 8, 2020

@willemneal that API might still be too low-level. Yet, I agree that we can explore the space of generic solutions as well, but in order to make is user-friendly we need to solve the contract metadata problem (a.k.a. contract interfaces)

@vgrichina
Copy link

@frol do you mean instantiating dependency objects automatically a-la near repl or something else?

@frol
Copy link
Author

frol commented Jun 9, 2020

@vgrichina Yes, near repl-like instantiation with CLI framework in place, so developers will only need to add new CLI subcommands calling await contract.welcome({ account_id: "frol" })

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants