Skip to content

Commit 3b31495

Browse files
committed
character setup and initial deploy attempts
1 parent d55c86c commit 3b31495

File tree

8 files changed

+271
-39
lines changed

8 files changed

+271
-39
lines changed

.env.example

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ MEDIUM_OPENAI_MODEL= # Default: gpt-4o
8282
LARGE_OPENAI_MODEL= # Default: gpt-4o
8383
EMBEDDING_OPENAI_MODEL= # Default: text-embedding-3-small
8484
IMAGE_OPENAI_MODEL= # Default: dall-e-3
85-
USE_OPENAI_EMBEDDING= # Set to TRUE for OpenAI/1536, leave blank for local
85+
USE_OPENAI_EMBEDDING=FALSE
8686

8787
# Eternal AI's Decentralized Inference API
8888
ETERNALAI_URL=
@@ -171,7 +171,7 @@ EMBEDDING_GROK_MODEL= # Default: grok-2-1212
171171
# Ollama Configuration
172172
OLLAMA_SERVER_URL= # Default: localhost:11434
173173
OLLAMA_MODEL=
174-
USE_OLLAMA_EMBEDDING= # Set to TRUE for OLLAMA/1024, leave blank for local
174+
USE_OLLAMA_EMBEDDING=FALSE
175175
OLLAMA_EMBEDDING_MODEL= # Default: mxbai-embed-large
176176
SMALL_OLLAMA_MODEL= # Default: llama3.2
177177
MEDIUM_OLLAMA_MODEL= # Default: hermes3
@@ -219,16 +219,16 @@ LARGE_HEURIST_MODEL= # Default: meta-llama/llama-3.1-405b-instruct
219219
HEURIST_IMAGE_MODEL= # Default: PepeXL
220220

221221
# Gaianet Configuration
222-
GAIANET_MODEL=
223-
GAIANET_SERVER_URL=
222+
GAIANET_MODEL=qwen72b
223+
GAIANET_SERVER_URL=https://qwen72b.gaia.domains/v1
224224
SMALL_GAIANET_MODEL= # Default: llama3b
225225
SMALL_GAIANET_SERVER_URL= # Default: https://llama3b.gaia.domains/v1
226226
MEDIUM_GAIANET_MODEL= # Default: llama
227227
MEDIUM_GAIANET_SERVER_URL= # Default: https://llama8b.gaia.domains/v1
228228
LARGE_GAIANET_MODEL= # Default: qwen72b
229229
LARGE_GAIANET_SERVER_URL= # Default: https://qwen72b.gaia.domains/v1
230230
GAIANET_EMBEDDING_MODEL=
231-
USE_GAIANET_EMBEDDING= # Set to TRUE for GAIANET/768, leave blank for local
231+
USE_GAIANET_EMBEDDING=TRUE
232232

233233
# Volcengine Configuration
234234
VOLENGINE_API_URL= # Volcengine API Endpoint, Default: https://open.volcengineapi.com/api/v3/
@@ -553,3 +553,6 @@ AKASH_MANIFEST_VALIDATION_LEVEL=strict
553553
# Quai Network Ecosystem
554554
QUAI_PRIVATE_KEY=
555555
QUAI_RPC_URL=https://rpc.quai.network
556+
557+
MOVEMENT_PRIVATE_KEY=your_private_key_here
558+
MOVEMENT_NETWORK=bardock

agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@elizaos/client-telegram": "workspace:*",
3232
"@elizaos/client-twitter": "workspace:*",
3333
"@elizaos/client-slack": "workspace:*",
34-
"@elizaos/core": "workspace:*",
34+
"@elizaos/core": "latest",
3535
"@elizaos/plugin-0g": "workspace:*",
3636
"@elizaos/plugin-abstract": "workspace:*",
3737
"@elizaos/plugin-aptos": "workspace:*",

agent/src/index.ts

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
7474
import { createNodePlugin } from "@elizaos/plugin-node";
7575
import { obsidianPlugin } from "@elizaos/plugin-obsidian";
7676
import { sgxPlugin } from "@elizaos/plugin-sgx";
77-
import { solanaPlugin } from "@elizaos/plugin-solana";
78-
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit";
7977
import { autonomePlugin } from "@elizaos/plugin-autonome";
8078
import { storyPlugin } from "@elizaos/plugin-story";
8179
import { suiPlugin } from "@elizaos/plugin-sui";
@@ -103,6 +101,8 @@ import path from "path";
103101
import { fileURLToPath } from "url";
104102
import yargs from "yargs";
105103
import {dominosPlugin} from "@elizaos/plugin-dominos";
104+
import { movementPlugin } from "@elizaos/plugin-movement";
105+
import { unjeet } from "../intern"
106106

107107
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
108108
const __dirname = path.dirname(__filename); // get the name of the directory
@@ -290,34 +290,18 @@ export async function loadCharacters(
290290
return loadedCharacters;
291291
}
292292

293-
async function handlePluginImporting(plugins: string[]) {
294-
if (plugins.length > 0) {
295-
elizaLogger.info("Plugins are: ", plugins);
296-
const importedPlugins = await Promise.all(
297-
plugins.map(async (plugin) => {
298-
try {
299-
const importedPlugin = await import(plugin);
300-
const functionName =
301-
plugin
302-
.replace("@elizaos/plugin-", "")
303-
.replace(/-./g, (x) => x[1].toUpperCase()) +
304-
"Plugin"; // Assumes plugin function is camelCased with Plugin suffix
305-
return (
306-
importedPlugin.default || importedPlugin[functionName]
307-
);
308-
} catch (importError) {
309-
elizaLogger.error(
310-
`Failed to import plugin: ${plugin}`,
311-
importError
312-
);
313-
return []; // Return null for failed imports
314-
}
315-
})
316-
);
317-
return importedPlugins;
318-
} else {
319-
return [];
293+
async function handlePluginImporting(plugins: any[]): Promise<any[]> {
294+
const importedPlugins = [];
295+
for (const plugin of plugins) {
296+
if (typeof plugin === "string") {
297+
if (plugin === "@elizaos/plugin-movement") {
298+
importedPlugins.push(movementPlugin);
299+
}
300+
} else {
301+
importedPlugins.push(plugin);
302+
}
320303
}
304+
return importedPlugins;
321305
}
322306

323307
export function getTokenForProvider(
@@ -854,6 +838,7 @@ export async function createAgent(
854838
getSecret(character, "QUAI_PRIVATE_KEY")
855839
? quaiPlugin
856840
: null,
841+
getSecret(character, "MOVEMENT_PRIVATE_KEY") ? movementPlugin : null,
857842
].filter(Boolean),
858843
providers: [],
859844
actions: [],
@@ -1020,7 +1005,7 @@ const startAgents = async () => {
10201005
let serverPort = parseInt(settings.SERVER_PORT || "3000");
10211006
const args = parseArguments();
10221007
let charactersArg = args.characters || args.character;
1023-
let characters = [defaultCharacter];
1008+
let characters = [unjeet];
10241009

10251010
if (charactersArg) {
10261011
characters = await loadCharacters(charactersArg);

deploy.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# Make script exit on first error
4+
set -e
5+
6+
# Check if .env.production exists
7+
if [ ! -f .env.production ]; then
8+
echo "Error: .env.production file not found!"
9+
echo "Please create it from .env.production.example"
10+
exit 1
11+
fi
12+
13+
# Create necessary directories
14+
mkdir -p nginx
15+
mkdir -p ssl
16+
mkdir -p certbot/conf
17+
mkdir -p certbot/www
18+
19+
# Check if running on the server for the first time
20+
if [ ! -d "/etc/letsencrypt/live/${DOMAIN}" ]; then
21+
echo "Initial setup detected. Setting up SSL certificates..."
22+
23+
# Start nginx with temporary config for SSL setup
24+
docker-compose -f docker-compose.prod.yml up -d nginx
25+
26+
# Get SSL certificate
27+
docker-compose -f docker-compose.prod.yml run --rm certbot
28+
29+
# Stop services
30+
docker-compose -f docker-compose.prod.yml down
31+
fi
32+
33+
# Deploy the application
34+
echo "Deploying application..."
35+
docker-compose -f docker-compose.prod.yml up -d
36+
37+
# Check if services are running
38+
echo "Checking service health..."
39+
docker-compose -f docker-compose.prod.yml ps
40+
41+
echo "Deployment completed! Your application should be running at https://${DOMAIN}"
42+
echo "Check the logs with: docker-compose -f docker-compose.prod.yml logs -f"

docker-compose.prod.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
restart: unless-stopped
9+
environment:
10+
- NODE_ENV=production
11+
env_file:
12+
- .env.production
13+
healthcheck:
14+
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
15+
interval: 30s
16+
timeout: 10s
17+
retries: 3
18+
volumes:
19+
- app-data:/app/db.sqlite
20+
- tweet-cache:/app/packages/client-twitter/src/tweetcache
21+
logging:
22+
driver: "json-file"
23+
options:
24+
max-size: "10m"
25+
max-file: "3"
26+
networks:
27+
- app-network
28+
29+
nginx:
30+
image: nginx:alpine
31+
ports:
32+
- "80:80"
33+
- "443:443"
34+
volumes:
35+
- ./nginx:/etc/nginx/conf.d:ro
36+
- ./ssl:/etc/nginx/ssl:ro
37+
- ./certbot/conf:/etc/letsencrypt
38+
- ./certbot/www:/var/www/certbot
39+
depends_on:
40+
- app
41+
networks:
42+
- app-network
43+
44+
certbot:
45+
image: certbot/certbot
46+
volumes:
47+
- ./certbot/conf:/etc/letsencrypt
48+
- ./certbot/www:/var/www/certbot
49+
command: certonly --webroot -w /var/www/certbot --force-renewal --email ${SSL_EMAIL} -d ${DOMAIN} --agree-tos
50+
51+
networks:
52+
app-network:
53+
driver: bridge
54+
55+
volumes:
56+
app-data:
57+
driver: local
58+
tweet-cache:
59+
driver: local

nginx/default.conf

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
server {
2+
listen 80;
3+
server_name ${DOMAIN};
4+
5+
# Redirect all HTTP requests to HTTPS
6+
location / {
7+
return 301 https://$host$request_uri;
8+
}
9+
10+
# Required for Let's Encrypt verification
11+
location /.well-known/acme-challenge/ {
12+
root /var/www/certbot;
13+
}
14+
}
15+
16+
server {
17+
listen 443 ssl;
18+
server_name ${DOMAIN};
19+
20+
# SSL configuration
21+
ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
22+
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
23+
24+
# SSL settings
25+
ssl_protocols TLSv1.2 TLSv1.3;
26+
ssl_prefer_server_ciphers on;
27+
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
28+
ssl_session_timeout 1d;
29+
ssl_session_cache shared:SSL:50m;
30+
ssl_stapling on;
31+
ssl_stapling_verify on;
32+
add_header Strict-Transport-Security max-age=15768000;
33+
34+
# Proxy settings
35+
location / {
36+
proxy_pass http://app:3000;
37+
proxy_http_version 1.1;
38+
proxy_set_header Upgrade $http_upgrade;
39+
proxy_set_header Connection 'upgrade';
40+
proxy_set_header Host $host;
41+
proxy_cache_bypass $http_upgrade;
42+
proxy_set_header X-Real-IP $remote_addr;
43+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44+
proxy_set_header X-Forwarded-Proto $scheme;
45+
46+
# WebSocket support
47+
proxy_set_header Upgrade $http_upgrade;
48+
proxy_set_header Connection "upgrade";
49+
}
50+
}

pnpm-lock.yaml

Lines changed: 57 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)