-
Notifications
You must be signed in to change notification settings - Fork 483
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
Plutus-starter: EndpointNotAvailable #3526
Comments
Thanks for the detailed report! I was able to reproduce it and put up a fix for it. |
@luigy note this is about not being able to call I've tried this several times (prior and after Plutus bump PR) hoping I can fix it but didn't figure it out. One of the things I've tried was turning |
@sorki hmm that's strange. Even though "lock" endpoint is not showing up this is due to way the "guess" endpoint is currently written. I have put up a temp workaround, but there is still an underlying issue that I suspect came from #3342 that I'm currently investigating as even without my changes it is expected to work here is a clip of me calling the "lock" endpoint with my changes plutus-starter-example-2021-07-13_15.20.49.mp4 |
Tested your PR and it indeed does fix this despite my intuition. If you don't mind, I would appreciate a short explanation of what is going on with |
@sorki from my understanding
the behavior I'm observing in the case of the game contract is that in the case of I'm still wondering if this is the intended behavior of The changes in the PR made |
Thank you! Helps a lot to improve my understanding of PAB. |
@luigy @sorki I am not 100% sure, but reading the Plutus source code, I found that When implementing the value check logic after using the utxos <- utxoAt gameAddress
let presentVal = Haskell.foldMap (Ledger.txOutValue . Ledger.txOutTxOut) utxos
let hasEnoughLovelace = presentVal `Ledger.Value.geq` Ada.lovelaceValueOf 1
logWarn @Haskell.String $
if hasEnoughLovelace
then "There is enough lovelace in the script address"
else "There is not enough lovelace in the script address" |
@gege251 With that said in input-output-hk/plutus-starter#26 the behavior of the contract was changed to not wait on having funds any longer so now both endpoint are always available and input-output-hk/plutus-starter#28 made it so the instance can take requests indefinitely instead of stopping after the first one is handled. Closing this, but please reopen if you are still running into issue with the most recent version. |
Area
[] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
[x] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries
[] Marlowe Related to Marlowe
[x] Other Any other topic (Playgrounds, etc.)
Summary
Hello I am trying to use the plutus-starter project to test out some contracts of my own, I am able to follow every step without problems until I try to interrupt with the endpoints, where it always seems to fail.
Steps to reproduce
Steps to reproduce the behavior:
README.md
file for VSCode devcontainer development (Success)Returns error:
EndpointCallError (EndpointNotAvailable (ContractInstanceId {unContractInstanceId = 5ff489d7-4b1c-4828-afd5-424635cf87a1}) (EndpointDescription {getEndpointDescription = "lock"}))
Btw, the discord server link has expired.
Expected behavior
The "lock" operation was expected to go through, more info about the results I got the from the commands below
Screenshots and attachments
curl -s http://localhost:8080/api/new/contract/definitions | jq
Wallet 1:
Reply:
Command:
export INSTANCE_ID=5ff489d7-4b1c-4828-afd5-424635cf87a1
curl -s http://localhost:8080/api/new/contract/instance/$INSTANCE_ID/status | jq
Finally:
Returns error:
EndpointCallError (EndpointNotAvailable (ContractInstanceId {unContractInstanceId = 5ff489d7-4b1c-4828-afd5-424635cf87a1}) (EndpointDescription {getEndpointDescription = "lock"}))
The same happens when I try to do this for Wallet 2 and the Guess endpoint.
Additional context
Did not change the code whatsoever, what am I doing incorrectly when interacting with the endpoints? Am I missing something?
System info (please complete the following information):
The text was updated successfully, but these errors were encountered: