Skip to main content

Prerequisites

Before installing Caisper, ensure you have:
# Check ElizaOS version
elizaos --version
# Should be >= 1.7.0

# Install ElizaOS CLI if needed
npm install -g @elizaos/[email protected]
# Install Bun (recommended over npm/yarn)
curl -fsSL https://bun.sh/install | bash

# Verify installation
bun --version
GhostSpeak uses Bun as the primary package manager. While npm/yarn work, Bun provides faster installs and better ESM support.
You’ll need a Solana wallet with:
  • Devnet: ~0.5 SOL (free from faucet)
  • Mainnet: ~0.01 SOL for agent registration
# Generate new keypair
solana-keygen new --outfile ~/.config/solana/ghostspeak-agent.json

# Save the seed phrase safely!
While GhostSpeak works with public RPCs, premium endpoints provide better performance:

Installation Methods

Add to ElizaOS Agent

The declarative approach using ElizaOS character configuration:
{
  "name": "GhostSpeak Agent",
  "description": "AI agent with on-chain reputation",
  "modelProvider": "anthropic",
  "plugins": [
    "@ghostspeak/plugin-elizaos"
  ],
  "settings": {
    "secrets": {
      "AGENT_WALLET_PRIVATE_KEY": "base58-encoded-private-key",
      "SOLANA_CLUSTER": "devnet",
      "SOLANA_RPC_URL": "https://api.devnet.solana.com"
    }
  },
  "bio": [
    "I track my reputation on GhostSpeak blockchain",
    "I can issue and verify W3C credentials",
    "I accept x402 payments for my services"
  ]
}
Store sensitive values in .env and reference them with ${VARIABLE_NAME} syntax in character files.

Method 2: Programmatic Registration

The code-first approach for custom agent setup:
import { createAgent } from '@elizaos/core'
import { starterPlugin } from '@ghostspeak/plugin-elizaos'

// Create agent with GhostSpeak plugin
const agent = await createAgent({
  character: {
    name: "My GhostSpeak Agent",
    modelProvider: "anthropic",
    plugins: ["@ghostspeak/plugin-elizaos"],
    settings: {
      secrets: {
        AGENT_WALLET_PRIVATE_KEY: process.env.AGENT_WALLET_PRIVATE_KEY,
        SOLANA_CLUSTER: process.env.SOLANA_CLUSTER || "devnet",
      }
    }
  },
  plugins: [starterPlugin],
  modelProvider: anthropicProvider,
})

// Start agent
await agent.start()

console.log('Agent running with GhostSpeak integration!')

Method 3: Dynamic Plugin Loading

Load plugins at runtime based on conditions:
import { createAgent } from '@elizaos/core'

const agent = await createAgent({
  character: myCharacter,
  plugins: [], // Start with no plugins
})

// Load GhostSpeak plugin conditionally
if (process.env.ENABLE_GHOSTSPEAK === 'true') {
  const { starterPlugin } = await import('@ghostspeak/plugin-elizaos')
  await agent.registerPlugin(starterPlugin)
  console.log('GhostSpeak plugin loaded dynamically')
}

await agent.start()

Verify Installation

Quick Health Check

# Start ElizaOS in dev mode
elizaos dev

# In agent chat, test actions:
# 1. Hello world test
> hello

# 2. Check Ghost Score (will fail gracefully if no agent registered)
> check ghost score

# 3. Test credential action
> issue credential for test
Expected output:
✅ Caisper plugin loaded
✅ Actions registered: 5
✅ Services started: 2
✅ Providers active: 2

Test Actions Available

// In ElizaOS console
agent.getActions().filter(a => a.name.includes('GHOST'))

// Should return:
// - CHECK_GHOST_SCORE
// - REGISTER_AGENT
// - ISSUE_CREDENTIAL

Test Service Health

# Check plugin services
curl http://localhost:3000/api/ghost-score/YOUR_AGENT_ADDRESS

# Should return JSON with Ghost Score data

Troubleshooting

Symptoms: Plugin doesn’t appear in elizaos plugin listSolutions:
  1. Check package.json includes @ghostspeak/plugin-elizaos
  2. Run bun install to ensure dependencies are installed
  3. Verify character file has plugin in plugins array
  4. Check ElizaOS version is >= 1.7.0
# Reinstall plugin
bun remove @ghostspeak/plugin-elizaos
bun add @ghostspeak/plugin-elizaos
elizaos dev
Symptoms: “Insufficient SOL balance” or “Invalid wallet”Solutions:
  1. Verify wallet file exists and is readable
  2. Check wallet has SOL on correct network (devnet vs mainnet)
  3. Request devnet SOL from faucet
# Check wallet balance
solana balance ~/.config/solana/ghostspeak-agent.json --url devnet

# Request devnet SOL
solana airdrop 1 $(solana-keygen pubkey ~/.config/solana/ghostspeak-agent.json) --url devnet
Symptoms: “Failed to connect to RPC” or timeoutsSolutions:
  1. Check SOLANA_RPC_URL is set correctly
  2. Verify network is reachable (curl the RPC endpoint)
  3. Try different RPC provider (Helius, QuickNode)
  4. Check firewall/proxy settings
# Test RPC connectivity
curl -X POST https://api.devnet.solana.com \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}'

# Should return: {"jsonrpc":"2.0","result":"ok","id":1}
Symptoms: Actions don’t respond to commandsSolutions:
  1. Check action validation logic (see validate function)
  2. Verify command syntax matches examples
  3. Enable debug logging to see action matching
# Enable debug logs
LOG_LEVEL=debug elizaos dev

# Watch for action validation logs

Upgrade Guide

Minor Version Updates (0.1.x → 0.1.y)

# Update plugin
bun update @ghostspeak/plugin-elizaos

# Restart agent
elizaos restart

Major Version Updates (0.x → 1.x)

Major version updates may include breaking changes. Always check the CHANGELOG before upgrading.
# Check for breaking changes
cat node_modules/@ghostspeak/plugin-elizaos/CHANGELOG.md

# Update with caution
bun update @ghostspeak/plugin-elizaos@latest

# Review migration guide if provided

Next Steps