stellar / soroban-example-dapp

End-to-End Example Soroban Dapp
Apache License 2.0
1.03k stars 835 forks source link

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

Closed esteblock closed 1 year ago

esteblock commented 1 year ago

What version are you using?

So, I was testing the new commit https://github.com/stellar/soroban-example-dapp/commit/da61364736f7f5e0e6be8e3bb50891d92173c527 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 commented 1 year ago

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 https://github.com/stellar/soroban-example-dapp/pull/74 PR

esteblock commented 1 year ago

So I am still very confused about this: With the lastest commit https://github.com/stellar/soroban-example-dapp/commit/da61364736f7f5e0e6be8e3bb50891d92173c527 the following packages are used:

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

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:

esteblock commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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:

https://github.com/stellar/soroban-example-dapp/pull/77

esteblock commented 1 year ago

Pull request accepted https://github.com/stellar/soroban-example-dapp/pull/77