Deep Mind AI
  • Introduction
  • Examples
    • Getting Started with NextJS
    • Telegram Agent
    • Persistent Agent with PostgreSQL
    • AI Guided Market Making Agent
    • Discord Agent Integration
  • Guides
    • Add your own tool
    • Setup locally
    • Test it out
  • Features
    • Transfer Tokens
    • Stake SOL
    • Deploy SPL Token
    • Check Token Balances
    • Token Data Retrieval
    • Deploy NFT Collection
    • Mint NFT
    • Tensor NFT Marketplace
    • Jupiter Exchange Swaps
    • Solana Name Service (SNS)
    • Launch Token on Pump.fun
Powered by GitBook
On this page
  • How to Test It Out
  • ​Running Automated Tests
  • ​Interactive Modes
  • ​Code Examples
  • ​Best Practices
  • ​Troubleshooting
  1. Guides

Test it out

Documentation for test it out

PreviousSetup locallyNextTransfer Tokens

Last updated 3 months ago

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:

  1. Ensure Dependencies are Installed

    • If you haven’t installed the dependencies yet, refer to the guide.

  2. Run the Test Script

    pnpm run test

    This will run the test/index.ts script using ts-node. Ensure that your environment variables are correctly set in the .env file before running the tests.

Interactive Modes

Available Modes

  1. Chat Mode

    • Allows you to interact with the agent in a conversational manner.

  2. Autonomous Mode

    • Enables the agent to perform actions on the blockchain autonomously at regular intervals.

  1. Launch the Agent

    pnpm start
  2. Select Your Mode

    • For Chat Mode: Enter 1 or chat

    • For Autonomous Mode: Enter 2 or auto

  • Start chatting by entering prompts after the Prompt: indicator

  • Type exit to end the chat session

  • The agent executes predefined actions every 10 seconds

  • Actions and outputs are displayed in the console

import { SolanaAgentKit } from "solana-agent-kit";

const agent = new SolanaAgentKit("your_private_key");

const result = await agent.deployToken(
  9, // decimals
);

console.log("Token Mint Address:", result.mint.toString());
import { SolanaAgentKit } from "solana-agent-kit";

const agent = new SolanaAgentKit("your_private_key");

const collection = await agent.deployCollection({
  name: "My NFT Collection",
  uri: "https://arweave.net/metadata.json",
  royaltyBasisPoints: 500,  // 5%
  creators: [
    {
      address: "creator-wallet-address",
      percentage: 100,
    },
  ],
});
  • Verify .env file contains correct and secure values

  • Ensure all required environment variables are set

  • Maintain comprehensive test coverage

  • Monitor console logs during testing

  • Clean up test assets after deployment

  • Issue: Tests fail due to missing environment variables

  • Solution: Check .env file for all required variables

  • Issue: Network-related errors

  • Solution: Verify internet connection and Solana RPC endpoint accessibility

  • Issue: Agent doesn’t prompt for mode selection

  • Solution: Verify successful build and dependency installation

Starting the Agent

Using Each Mode

Chat Mode

Autonomous Mode

Code Examples

Token Deployment

NFT Collection Creation

Best Practices

Environment Setup

Testing

Troubleshooting

Test Failures

Missing Environment Variables

Network Problems

Agent Issues

Startup Problems

​
Setup Locally
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​