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

Invoke contract from RPC server #181

Merged
merged 5 commits into from
Oct 4, 2022

Conversation

2opremio
Copy link
Contributor

@2opremio 2opremio commented Oct 4, 2022

What

Allow invoking a contract through a remote RPC server (i.e. from a real network) instead of local sandbox

Note that, as getContractData is yet to be implemented by the RPC server, it is allowed to provide the contract through the --wasm flag. We should probably remove this in the future.

Also:

  • refactor transaction signing

Known limitations

@2opremio
Copy link
Contributor Author

2opremio commented Oct 4, 2022

CC @sreuland

src/invoke.rs Show resolved Hide resolved
src/invoke.rs Outdated Show resolved Hide resolved
src/invoke.rs Outdated Show resolved Hide resolved
@leighmcculloch leighmcculloch merged commit fb0f700 into stellar:main Oct 4, 2022
@2opremio 2opremio deleted the invoke-against-rpc-server branch October 4, 2022 21:13
pub struct SimulateTransactionResponse {
pub footprint: String,
pub cost: Cost,
// TODO: add results and latestLedger
Copy link
Contributor

Choose a reason for hiding this comment

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

@2opremio FYI because latestLedger is an int64 value it will be represented as a String in the json response

@sreuland
Copy link
Contributor

sreuland commented Oct 4, 2022

@2opremio @leighmcculloch , in terms of using for e2e tests, what would the cli invocation look like for hello world:

the contract fn prototype:
pub fn hello(env: Env, to: Symbol) -> Vec<Symbol>

assuing cli invocation would look something like:

soroban invoke --id <contract_id> \
  --account GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI
  --fn hello \
  --arg "world" \ 

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.

4 participants