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

Fails to deploy contract with soroban-client to 0.2.1 and sorban 0.3.2 #72

Closed
esteblock opened this issue Dec 13, 2022 · 6 comments · Fixed by stellar/freighter#696
Closed
Labels
bug Something isn't working

Comments

@esteblock
Copy link
Contributor

What version are you using?

So, I was testing the new commit da61364 that uses soroban-sdk 0.3.2

I had different errors with different versions of soroban-cli

With soroban 0.2.1, while running ./initialize, I managed to deploy the contract, but not to initialized it.

Initialize the crowdfund contract
error: parsing contract spec: parsing contract spec

Then, I updated to soroban 0.3.3, and I did not even manged to deploy the contract. Got:

Deploy the token contract
error: transaction submission failed

I was looking at the recent changes, and found that in the Docs it is used

docker run --rm -it \
  --platform linux/amd64 \
  -p 8000:8000 \
  --name stellar \
  stellar/quickstart:soroban-dev@sha256:8046391718f8e58b2b88b9c379abda3587bb874689fa09b2ed4871a764ebda27 \
  --standalone \
  --enable-soroban-rpc

Did the change to ./quickstart.sh and now works.
Will open PR

@esteblock esteblock added the bug Something isn't working label Dec 13, 2022
@esteblock esteblock changed the title Fails to deploy contract with soroban-client to 0.2.1 Fails to deploy contract with soroban-client to 0.2.1 and sorban 0.3.2 Dec 13, 2022
@esteblock
Copy link
Contributor Author

I realized that in fact the project is using soroban 0.3.2, so I moved to that version and I had to fix initialize.sh

Everything in the #74 PR

@esteblock
Copy link
Contributor Author

So I am still very confused about this:
With the lastest commit da61364 the following packages are used:

Following leigh recommendation the recommended setups say that: for this setup

  • soroban-cli should be 0.3.3
  • js-soroban-client should be in v0.2.0
  • stellar quickstart docker should be: stellar/quickstart:soroban-dev@sha256:8046391718f8e58b2b88b9c379abda3587bb874689fa09b2ed4871a764ebda27

So, after installing soroban-cli 0.3.3 I got the following error while ./initialize.sh

When using standalone:

Using standalone network
Fund token admin account from friendbot
{
  "type": "https://stellar.org/horizon-errors/server_error",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An error occurred while processing this request.  This is usually due to a bug within the server software.  Trying this request again may succeed if the bug is transient. Otherwise, please contact the system administrator."
}Deploy the token contract
error: transaction submission failed
Build the crowdfund contract
cargo fmt --all
cargo build --target wasm32-unknown-unknown --release
    Finished release [optimized] target(s) in 0.06s
cd target/wasm32-unknown-unknown/release/ && \
	for i in *.wasm ; do \
		ls -l "$i"; \
	done
-rwxrwxr-x 2 wachuma wachuma 8371 dic 13 08:15 soroban_crowdfund_contract.wasm
Deploy the crowdfund contract
error: transaction submission failed
Contract deployed succesfully with ID: 
Initialize the crowdfund contract
error: transaction simulation failed: Could not unmarshal transaction

What I did is to use that docker version, in this commit and it did solve the deploy problem...

Deploy the token contract
success
success
Token contract was deployed with TOKEN_ID: 83ef099c3dd37c454ff87b16c20b2f7db6be2467832161b40d7c8fee72850a16
Build the crowdfund contract
cargo fmt --all
cargo build --target wasm32-unknown-unknown --release
    Finished release [optimized] target(s) in 0.06s
cd target/wasm32-unknown-unknown/release/ && \
	for i in *.wasm ; do \
		ls -l "$i"; \
	done
-rwxrwxr-x 2 wachuma wachuma 8371 dic 13 08:15 soroban_crowdfund_contract.wasm
Deploy the crowdfund contract
success
success
Crowdunfund contract was deployed with ID: 6d8a27e42a2f124e2dfc1575ddc52327c5c5d96a9ebb59c90db713c24252917d
Initialize the crowdfund contract
success
null

However, when running the front end:

  • Apparently I read correctly the information from the blockchain (wallet/hooks/useContractValue.tsx is working correctly.
  • But there are errors when trying to sign messages (wallet/hooks/useSendTransaction.tsx failing)
    I am now debugging, and will write the errors in a next Comment

@esteblock
Copy link
Contributor Author

First error, when Minting:
timeout it not defined in useSendTransaction- fixed

After fixing it, I can say that Minting is working, however, apparently it does only mints 42 EXT??

When "approve and back up this project"

error while handleSubmit:  Unable to send message to extension

Error: XDR Read Error: Unknown ScHashType member for value 32
    at x

I guess that the error comes from trying to send the transaction to the wallet, because when minting it does gives a private jey

@esteblock
Copy link
Contributor Author

My guess is that there is something wronw while building the transaction
Because even if I hardcode the secret key, it's bugging in SorobanClient.Server.simulateTransaction(txn);

@esteblock
Copy link
Contributor Author

There are too many things here. This issue will onlye refer to "Failing to deploy contract with soroban-client 0.2.1"

What I did is to use that docker version, in this commit and it did solve the deploy problem...

So I'm opening a pull request for this:

#77

@esteblock
Copy link
Contributor Author

Pull request accepted
#77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant