FAQ

This page is dedicated to troubleshooting issues found when building on the AI Agent Contract.

1. Why does my code fail to run a local testnet when executing the commands npm run start and npm run dev?

For these commands to work, you must have Docker installed on your machine. Check out the Docker Docs or try installing Docker Desktop.

2. How do I query my local AI Agent Contract build when running a local testnet?

To interact with your local AI Agent Conract build through a local testnet, you will use the following curl commands:

# GET request
curl http://127.0.0.1:8000/local
# GET request with URL queries
curl http://127.0.0.1:8000/local?query1=one&query2=two
# POST request
curl http://127.0.0.1:8000/local -X POST -H 'content-type: application/json' -d '{"foo": "bar"}'

3. How do I add secrets to my AI Agent Contract build when running a local testnet?

Execute the following command to add your secrets. Make sure to set the cid key to value local.

curl http://127.0.0.1:8000/vaults -H 'Content-Type: application/json' -d '{"cid": "local", "data": {"secretKey":"secretValue"}}' 

4. How do I check the logs of my local testnet?

Logs can be checked by running the following curl command:

curl 'http://127.0.0.1:8000/logs/all/local'

You should see your logs outputed in your terminal like below.

2024-09-14T03:22:05.542Z [82570760-98d3-4dda-9f82-eb69a3a5e79a] [REPORT] END Request: Duration: 222ms
2024-09-14T03:22:05.542Z [82570760-98d3-4dda-9f82-eb69a3a5e79a] [INFO] 'Type: , Data: '
2024-09-14T03:22:05.542Z [82570760-98d3-4dda-9f82-eb69a3a5e79a] [INFO] { secretSalt: 'LOCAL_TEST' }
2024-09-14T03:22:05.542Z [82570760-98d3-4dda-9f82-eb69a3a5e79a] [REPORT] START Request: GET https://127.0.0.1:8000/local?key=2a769684f518edfe

For further assistance, refer to the documentation or reach out to the support team.

Last updated

Logo

COPYRIGHT © 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!