Closed Julian-dev28 closed 1 year ago
Error might occur due to an incorrect rev
value
The main issue seems to be resolved by updating the rev value to 8abd3353c728f09ee1c8a2544f67a853e915afc2
, which is the commit hash for rs-soroban-sdk version 0.7.0.
[dependencies]
soroban-sdk = { version = "0.7.0", git = "https://github.com/stellar/rs-soroban-sdk", rev = "8abd3353c728f09ee1c8a2544f67a853e915afc2"}
[dev_dependencies]
soroban-sdk = { version = "0.7.0", git = "https://github.com/stellar/rs-soroban-sdk", rev = "8abd3353c728f09ee1c8a2544f67a853e915afc2", features = ["testutils"] }
This error occurs consistently in all examples when running locally, but it can be fixed by making a change to the cargo.toml
file. On the other hand, the examples appear to work without any issues in GitPod.
This likely means you're running a version of soroban-cli that is not compatible with the contracts on the main branch. You'll need to figure out which soroban-cli (if one exists) that is using the same soroban-sdk and soroban-env as the examples in here. This is not always trivial, as you might need to look through the cli's history and install it from source at the right commit. The soroban-cli source can be found at https://github.com/stellar/soroban-tools.
Note that when folks typically use this example repo, they do so at a specific tag that corresponds to a specific soroban-cli, soroban-sdk, etc, which have all been aligned for a release.
Thanks for the response @leighmcculloch I appreciate it.
I have re-cloned the repo and used soroban 0.7.0 and it its working fine
It was my error by cloning the soroban/examples
from gh and then working from there instead of cloning the specific version as the tutorial states
@leighmcculloch although it doesn't affect the current workflow for users if they follow the example tutorials in their current state, if we update the docs to use the main branch, the dependencies may cause errors for users.
Are we planning to update the docs to point to the main branch? (The main branch of this repo is at the moment always a work-in-progress, using unreleased development versions of the sdk and env that are probably not compatible with any deployed environment, or even quickstart, and not really ready for use.)
Understood
It's possible that my assumption is incorrect. However, I based it on the reference to a layout where the target directory is included in each example's directory, rather than being at the top level. Currently, this implementation is only present in the main branch.
Are we planning to implement this change into the soroban v0.7.0 examples?
Ah. So those changes shouldn't be published to the docs until the v0.8.0 examples are released.
What we've done in the past is push changes that need to be scheduled with the release to the docs to a dev
branch and them merged the dev branch to main at release. But this process might have changed recently. @sisuresh did this process change?
We said that we would create a docs branch for the upcoming release (so something like release-v0.8.0
) and merge into that. This hasn't been done yet, but I or someone else can create it now since docs are being worked on. The dev branch should be deprecated.
Thanks for the clarification everyone
Sorry if I caused any confusion. It sounds like there are a lot of moving pieces and I began working on this prematurely. Please ping me when the changes are pushed and I can get those target directories changed asap!
I created a release-preview-9
branch in soroban-docs that can be used to stage docs changes for the next release.
Bug Report:
Summary: The user is attempting to invoke a contract called "soroban_events_contract" but encounters an error while executing the command. The error message states that there is an issue with the input arguments provided to the host function, which results in a "HostError". The debug events indicate that an unexpected environment interface version was encountered, and a backtrace is provided. Additionally, to fix the issue, the user made some changes to the
cargo.toml
file of the project.Steps to Reproduce:
Build the "soroban_events_contract" using
cargo build --target wasm32-unknown-unknown --release
. Invoke the "soroban_events_contract" usingsoroban contract invoke
with the following arguments: a. --wasm pointing to the path of the built wasm file. b. --id argument set to 1. c. -- followed by the function name "increment".Expected Results: The contract should be successfully invoked, and the function
increment
should be executed. Event should be displayed in terminalActual Results: Upon executing the soroban contract invoke command, the following error is encountered:
The debug events indicate that there was an unexpected environment interface version, and the backtrace suggests that there was an error with the host function.
Environment: The error occurred on a MacBook Pro. The user attempted invoking the contract using both soroban version 0.7.0 and soroban version 0.7.1.
Additional Information: To solve the issue, the user made changes to the
cargo.toml
file of the project and then usedcargo build --target wasm32-unknown-unknown --release
to rebuild the.wasm
file for theincrement contract
. Specifically, they removed thegit
andrev
fields from thesoroban-sdk dependencies
, which were pointing to a specific commit on theStellar Soroban SDK
repository. Instead, they included only the version field.old
cargo.toml
:new
cargo.toml