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

Use real running node instead of emulation #28

Open
SkymanOne opened this issue Jul 18, 2023 · 5 comments
Open

Use real running node instead of emulation #28

SkymanOne opened this issue Jul 18, 2023 · 5 comments

Comments

@SkymanOne
Copy link
Contributor

I think the tool has value beyond emulating pallet-contracts and minimum substrate runtime.
It would be nice to be able to use the tool with an actually running substrate node, as it simplifies interaction with the contract from the CLI (e.g. instantiation, contract calls, etc). cargo-contract forces you to specify --suri and --contract flags with every call command

@pmikolajczyk41
Copy link
Member

thanks for creating issue @SkymanOne! there are few directions that you touched:

  1. regarding specifying --suri and --contract flags for every contract-related operation, we already have some support, called Session: https://github.com/Cardinal-Cryptography/drink/blob/main/drink/src/session.rs for sure it's not the final form, but we found it already helpful
    if we are talking about not specifying such flags in real tool, then drink-cli already uses Session, so the burden is mitigated there as well

  2. "beyond emulating pallet-contracts" - generally, we could use the core approach (direct interaction with runtime embedded in TestExternalities) to test any runtime features as we want - e.g. running staking simulations; however, I cannot tell how useful it would be...

  3. "minimum substrate runtime" - I introduced a trait Runtime, so that one can use drink with any custom runtime, that contains some very basic functionalities; unfortunately most of the current runtimes (like the one from contracts-node) is not being published to crates.io and thus cannot be put natively here in drink library (git dependencies prevent from publishing crate)

  4. "use the tool with an actually running substrate node" - I'm lost here: the whole point was to not having a node anymore... did you mean that anyway we should create a possibility to get into runtime on a running node? if so, how should it be used?

@SkymanOne
Copy link
Contributor Author

SkymanOne commented Jul 20, 2023

What I am saying is the fact that you can have a session in CLI with multiple contracts, selecting a specific contract in the menu and making a call to it is also useful when working with the running node.

did you mean that anyway we should create a possibility to get into runtime on a running node?

No, this is not what I meant. I understand that you can not manually advance blocks in running node, so I think you can limit functionality to just displaying the current block in this case.

Overall, my point here is that the TUI you have can be useful when testing contracts on the local testnet.

@deuszx
Copy link
Collaborator

deuszx commented Jul 20, 2023

What I am saying is the fact that you can have a session in CLI with multiple contracts, selecting a specific contract in the menu and making a call to it is also useful when working with the running node.

ContractsUI does it already with far better UX.

If we were to add that feature (i.e. support talking to an actual node) this little tool becomes much more involved as it'd require adding RPC client etc.

@SkymanOne
Copy link
Contributor Author

Yes, but that’s an argument for every TUI

@SkymanOne
Copy link
Contributor Author

I guess where I am getting at is that it would be cool to have Drink TUI as a TUI wrapper for the cargo-contract. I agree that it is too much work to change the drink's core API and implement RPC client, but cargo-contract already does all of that, so maybe the only thing that is missing is the notion of sessions.

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

No branches or pull requests

3 participants