Guides
Test it out
Documentation for test it out
How to Test It Out
Testing the Solana Agent Kit ensures that all functionalities are working as expected. You can run automated tests or interact with the agent in different modes to verify its operations.
Running Automated Tests
The project includes a test script located at test/index.ts
. To execute the tests:
-
Ensure Dependencies are Installed
- If you haven’t installed the dependencies yet, refer to the Setup Locally guide.
-
Run the Test Script
This will run the
test/index.ts
script usingts-node
. Ensure that your environment variables are correctly set in the.env
file before running the tests.
Interactive Modes
Available Modes
-
Chat Mode
- Allows you to interact with the agent in a conversational manner.
-
Autonomous Mode
- Enables the agent to perform actions on the blockchain autonomously at regular intervals.
Starting the Agent
-
Launch the Agent
-
Select Your Mode
- For Chat Mode: Enter
1
orchat
- For Autonomous Mode: Enter
2
orauto
- For Chat Mode: Enter
Using Each Mode
Chat Mode
- Start chatting by entering prompts after the
Prompt:
indicator - Type
exit
to end the chat session
Autonomous Mode
- The agent executes predefined actions every 10 seconds
- Actions and outputs are displayed in the console
Code Examples
Token Deployment
NFT Collection Creation
Best Practices
Environment Setup
- Verify
.env
file contains correct and secure values - Ensure all required environment variables are set
Testing
- Maintain comprehensive test coverage
- Monitor console logs during testing
- Clean up test assets after deployment
Troubleshooting
Test Failures
Missing Environment Variables
- Issue: Tests fail due to missing environment variables
- Solution: Check
.env
file for all required variables
Network Problems
- Issue: Network-related errors
- Solution: Verify internet connection and Solana RPC endpoint accessibility
Agent Issues
Startup Problems
- Issue: Agent doesn’t prompt for mode selection
- Solution: Verify successful build and dependency installation
Was this page helpful?