4

Using the nix-shell approach, I'm able to build and execute the plutus starter PAB project, which includes the guessing game contract. GIT repo link

In a separate terminal window, I can run the GET request to see the contract definition. The response shows the GameContract along with the schema, which has lock and guess endpoints.

I successfully call the activate endpoint for each of wallet1 and wallet2.

However, when I call the lock endpoint for wallet1 ID, it gives me the following error. If I look at the logs in the terminal, where the PAB is running, there is no evidence that an endpoint execution failed.

curl -H "Content-Type: application/json" \
>   --request POST \
>   --data '{"amount":{"getValue":[[{"unCurrencySymbol":""},[[{"unTokenName":""},90]]]]},"secretWord":"eagle"}' \
>   http://localhost:8080/api/new/contract/instance/2acb116b-5488-4672-99c2-f2940cfd7b3a/endpoint/lock

EndpointCallError (EndpointNotAvailable (ContractInstanceId {unContractInstanceId = 2acb116b-5488-4672-99c2-f2940cfd7b3a}) (EndpointDescription {getEndpointDescription = "lock"}))

The format of the API call appears correct. Based on PAB docs, it should be

POST /api/new/contract/instance/:contract-instance-id/endpoint/:endpoint-name

Has anyone had this issue? What am I missing?

1
  • I can reproduce this - it was happening prior recent Plutus bump pull request as well. I'm not sure what the root cause is yet - week10 example from plutus-pioneers works. Tests in plutus-starter pass as well but they don't call HTTP API at all. Check that pab executable logs Exposing endpoint <name> message as well (it does for me but I'm not able to call lock).
    – sorki
    Jun 28 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.