Skip to content

Commit 83970a8

Browse files
author
mike dupont
committed
now running locally
1 parent 999990f commit 83970a8

File tree

3 files changed

+204
-126
lines changed

3 files changed

+204
-126
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# debug
2+
3+
`pnpm start:debug --characters=./characters/eliza.character.json`
4+
5+
start direct client here
6+
7+
```
8+
git clone https://github.com/meta-introspector/eliza-starter.git eliza-starter
9+
cd eliza-starter
10+
git checkout feature/opentelemetry
11+
pnpm start --characters=characters/eliza.character.json`
12+
```
13+
114
# Eliza 🤖
215

316
<div align="center">

agent/src/index.ts

+122-126
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DiscordClientInterface } from "@elizaos/client-discord";
1010
import { TelegramClientInterface } from "@elizaos/client-telegram";
1111
import { TwitterClientInterface } from "@elizaos/client-twitter";
1212
// import { ReclaimAdapter } from "@elizaos/plugin-reclaim";
13-
import { DirectClient } from "@elizaos/client-direct";
13+
//import { DirectClient } from "@elizaos/client-direct";
1414
import {
1515
AgentRuntime,
1616
CacheManager,
@@ -33,8 +33,8 @@ import {
3333
} from "@elizaos/core";
3434

3535
//import { zgPlugin } from "@elizaos/plugin-0g";
36-
//import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
37-
import createGoatPlugin from "@elizaos/plugin-goat";
36+
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
37+
//import createGoatPlugin from "@elizaos/plugin-goat";
3838
// import { intifacePlugin } from "@elizaos/plugin-intiface";
3939
import { DirectClient } from "@elizaos/client-direct";
4040
import createGoatPlugin from "@elizaos/plugin-goat";
@@ -44,7 +44,7 @@ import { solanaPlugin } from "@elizaos/plugin-solana";
4444
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit";
4545
//import { storyPlugin } from "@elizaos/plugin-story";
4646
//import { suiPlugin } from "@elizaos/plugin-sui";
47-
//import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
47+
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
4848
//import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin";
4949
//import { tonPlugin } from "@elizaos/plugin-ton";
5050
//import { webSearchPlugin } from "@elizaos/plugin-web-search";
@@ -368,7 +368,7 @@ export function getTokenForProvider(
368368
function initializeDatabase(dataDir: string) {
369369
if (process.env.POSTGRES_URL) {
370370
elizaLogger.info("Initializing PostgreSQL connection...");
371-
const db = new PostgresDatabaseAdapter({
371+
/*const db = new PostgresDatabaseAdapter({
372372
connectionString: process.env.POSTGRES_URL,
373373
parseInputs: true,
374374
});
@@ -385,13 +385,17 @@ function initializeDatabase(dataDir: string) {
385385
});
386386
387387
return db;
388+
*/
389+
return undefined;
388390
} else if (process.env.PGLITE_DATA_DIR) {
391+
/*
389392
elizaLogger.info("Initializing PgLite adapter...");
390393
// `dataDir: memory://` for in memory pg
391394
const db = new PGLiteDatabaseAdapter({
392395
dataDir: process.env.PGLITE_DATA_DIR,
393396
});
394397
return db;
398+
*/
395399
} else {
396400
const filePath =
397401
process.env.SQLITE_FILE ?? path.resolve(dataDir, "db.sqlite");
@@ -438,16 +442,16 @@ export async function initializeClients(
438442

439443
if (clientTypes.includes(Clients.FARCASTER)) {
440444
// why is this one different :(
441-
const farcasterClient = new FarcasterAgentClient(runtime);
445+
/*const farcasterClient = new FarcasterAgentClient(runtime);
442446
if (farcasterClient) {
443447
farcasterClient.start();
444448
clients.farcaster = farcasterClient;
445-
}
449+
}*/
446450
}
447451
if (clientTypes.includes("lens")) {
448-
const lensClient = new LensAgentClient(runtime);
452+
/* const lensClient = new LensAgentClient(runtime);
449453
lensClient.start();
450-
clients.lens = lensClient;
454+
clients.lens = lensClient;*/
451455
}
452456

453457
elizaLogger.log("client keys", Object.keys(clients));
@@ -456,8 +460,8 @@ export async function initializeClients(
456460
// Initialize clients as an object
457461

458462
if (clientTypes.includes("slack")) {
459-
const slackClient = await SlackClientInterface.start(runtime);
460-
if (slackClient) clients.slack = slackClient; // Use object property instead of push
463+
// const slackClient = await SlackClientInterface.start(runtime);
464+
// if (slackClient) clients.slack = slackClient; // Use object property instead of push
461465
}
462466

463467
function determineClientType(client: Client): string {
@@ -576,126 +580,117 @@ export async function createAgent(
576580
// character.plugins are handled when clients are added
577581
plugins: [
578582
bootstrapPlugin,
579-
dominosPlugin,
580-
getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
581-
? confluxPlugin
582-
: null,
583+
// dominosPlugin,
584+
// getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
585+
// ? confluxPlugin
586+
// : null,
583587
nodePlugin,
584-
coinPricePlugin,
585-
getSecret(character, "TAVILY_API_KEY") ? webSearchPlugin : null,
588+
// coinPricePlugin,
589+
// getSecret(character, "TAVILY_API_KEY") ? webSearchPlugin : null,
586590
getSecret(character, "SOLANA_PUBLIC_KEY") ||
587591
(getSecret(character, "WALLET_PUBLIC_KEY") &&
588592
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
589593
? solanaPlugin
590594
: null,
591-
getSecret(character, "SOLANA_PRIVATE_KEY")
592-
? solanaAgentkitPlguin
593-
: null,
594-
(getSecret(character, "NEAR_ADDRESS") ||
595-
getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
596-
getSecret(character, "NEAR_WALLET_SECRET_KEY")
597-
? nearPlugin
598-
: null,
599-
getSecret(character, "EVM_PUBLIC_KEY") ||
600-
(getSecret(character, "WALLET_PUBLIC_KEY") &&
601-
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
602-
? evmPlugin
603-
: null,
604-
getSecret(character, "COSMOS_RECOVERY_PHRASE") &&
605-
getSecret(character, "COSMOS_AVAILABLE_CHAINS") &&
606-
createCosmosPlugin(),
607-
(getSecret(character, "SOLANA_PUBLIC_KEY") ||
608-
(getSecret(character, "WALLET_PUBLIC_KEY") &&
609-
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith(
610-
"0x"
611-
))) &&
612-
getSecret(character, "SOLANA_ADMIN_PUBLIC_KEY") &&
613-
getSecret(character, "SOLANA_PRIVATE_KEY") &&
614-
getSecret(character, "SOLANA_ADMIN_PRIVATE_KEY")
615-
? nftGenerationPlugin
616-
: null,
617-
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
618-
getSecret(character, "COINMARKETCAP_API_KEY")
619-
? coinmarketcapPlugin
620-
: null,
621-
getSecret(character, "COINBASE_COMMERCE_KEY")
622-
? coinbaseCommercePlugin
623-
: null,
624-
getSecret(character, "FAL_API_KEY") ||
625-
getSecret(character, "OPENAI_API_KEY") ||
626-
getSecret(character, "VENICE_API_KEY") ||
627-
getSecret(character, "NINETEEN_AI_API_KEY") ||
628-
getSecret(character, "HEURIST_API_KEY") ||
629-
getSecret(character, "LIVEPEER_GATEWAY_URL")
630-
? imageGenerationPlugin
631-
: null,
632-
getSecret(character, "FAL_API_KEY") ? ThreeDGenerationPlugin : null,
633-
...(getSecret(character, "COINBASE_API_KEY") &&
634-
getSecret(character, "COINBASE_PRIVATE_KEY")
635-
? [
636-
coinbaseMassPaymentsPlugin,
637-
tradePlugin,
638-
tokenContractPlugin,
639-
advancedTradePlugin,
640-
]
641-
: []),
642-
...(teeMode !== TEEMode.OFF && walletSecretSalt ? [teePlugin] : []),
643-
getSecret(character, "COINBASE_API_KEY") &&
644-
getSecret(character, "COINBASE_PRIVATE_KEY") &&
645-
getSecret(character, "COINBASE_NOTIFICATION_URI")
646-
? webhookPlugin
647-
: null,
648-
goatPlugin,
649-
getSecret(character, "COINGECKO_API_KEY") ? coingeckoPlugin : null,
650-
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
651-
getSecret(character, "ABSTRACT_PRIVATE_KEY")
652-
? abstractPlugin
653-
: null,
654-
getSecret(character, "BINANCE_API_KEY") &&
655-
getSecret(character, "BINANCE_SECRET_KEY")
656-
? binancePlugin
657-
: null,
658-
getSecret(character, "FLOW_ADDRESS") &&
659-
getSecret(character, "FLOW_PRIVATE_KEY")
660-
? flowPlugin
661-
: null,
662-
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
663-
getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
664-
getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
665-
getSecret(character, "CRONOSZKEVM_PRIVATE_KEY")
666-
? cronosZkEVMPlugin
667-
: null,
668-
getSecret(character, "TEE_MARLIN") ? teeMarlinPlugin : null,
669-
getSecret(character, "TON_PRIVATE_KEY") ? tonPlugin : null,
670-
getSecret(character, "THIRDWEB_SECRET_KEY") ? thirdwebPlugin : null,
671-
getSecret(character, "SUI_PRIVATE_KEY") ? suiPlugin : null,
672-
getSecret(character, "STORY_PRIVATE_KEY") ? storyPlugin : null,
673-
getSecret(character, "FUEL_PRIVATE_KEY") ? fuelPlugin : null,
674-
getSecret(character, "AVALANCHE_PRIVATE_KEY")
675-
? avalanchePlugin
676-
: null,
677-
getSecret(character, "ECHOCHAMBERS_API_URL") &&
678-
getSecret(character, "ECHOCHAMBERS_API_KEY")
679-
? echoChambersPlugin
680-
: null,
681-
getSecret(character, "LETZAI_API_KEY") ? letzAIPlugin : null,
682-
getSecret(character, "STARGAZE_ENDPOINT") ? stargazePlugin : null,
683-
getSecret(character, "GIPHY_API_KEY") ? giphyPlugin : null,
684-
getSecret(character, "GENLAYER_PRIVATE_KEY")
685-
? genLayerPlugin
686-
: null,
687-
getSecret(character, "AVAIL_SEED") &&
688-
getSecret(character, "AVAIL_APP_ID")
689-
? availPlugin
690-
: null,
691-
getSecret(character, "OPEN_WEATHER_API_KEY")
692-
? openWeatherPlugin
693-
: null,
694-
// getSecret(character, "OBSIDIAN_API_TOKEN") ? obsidianPlugin : null,
695-
getSecret(character, "ARTHERA_PRIVATE_KEY")?.startsWith("0x")
696-
? artheraPlugin
697-
: null,
698-
getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
595+
//getSecret(character, "SOLANA_PRIVATE_KEY")
596+
// ? solanaAgentkitPlguin
597+
// : null,
598+
//(getSecret(character, "NEAR_ADDRESS") ||
599+
//getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
600+
//getSecret(character, "NEAR_WALLET_SECRET_KEY") ? nearPlugin : null,
601+
// getSecret(character, "EVM_PUBLIC_KEY") ||
602+
//(getSecret(character, "WALLET_PUBLIC_KEY") && getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x")) ? evmPlugin : null,
603+
// getSecret(character, "COSMOS_RECOVERY_PHRASE") && getSecret(character, "COSMOS_AVAILABLE_CHAINS") && createCosmosPlugin(),
604+
//(getSecret(character, "SOLANA_PUBLIC_KEY") ||
605+
// (getSecret(character, "WALLET_PUBLIC_KEY") &&
606+
// !getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith(
607+
// "0x"
608+
// ))) &&
609+
// getSecret(character, "SOLANA_ADMIN_PUBLIC_KEY") &&
610+
//getSecret(character, "SOLANA_PRIVATE_KEY") &&
611+
// getSecret(character, "SOLANA_ADMIN_PRIVATE_KEY") ? nftGenerationPlugin : null,
612+
// getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
613+
// getSecret(character, "COINMARKETCAP_API_KEY")
614+
// ? coinmarketcapPlugin
615+
// : null,
616+
// getSecret(character, "COINBASE_COMMERCE_KEY")
617+
// ? coinbaseCommercePlugin
618+
// : null,
619+
// getSecret(character, "FAL_API_KEY") ||
620+
//getSecret(character, "OPENAI_API_KEY") ||
621+
// getSecret(character, "VENICE_API_KEY") ||
622+
// getSecret(character, "NINETEEN_AI_API_KEY") ||
623+
// getSecret(character, "HEURIST_API_KEY") ||
624+
// getSecret(character, "LIVEPEER_GATEWAY_URL")
625+
// ? imageGenerationPlugin
626+
// : null,
627+
// getSecret(character, "FAL_API_KEY") ? ThreeDGenerationPlugin : null,
628+
// ...(getSecret(character, "COINBASE_API_KEY") &&
629+
// getSecret(character, "COINBASE_PRIVATE_KEY")
630+
// ? [
631+
// coinbaseMassPaymentsPlugin,
632+
// tradePlugin,
633+
// tokenContractPlugin,
634+
// advancedTradePlugin,
635+
// ]
636+
// : []),
637+
// ...(teeMode !== TEEMode.OFF && walletSecretSalt ? [teePlugin] : []),
638+
// getSecret(character, "COINBASE_API_KEY") &&
639+
// getSecret(character, "COINBASE_PRIVATE_KEY") &&
640+
// getSecret(character, "COINBASE_NOTIFICATION_URI")
641+
// ? webhookPlugin
642+
// : null,
643+
// goatPlugin,
644+
// getSecret(character, "COINGECKO_API_KEY") ? coingeckoPlugin : null,
645+
// getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
646+
// getSecret(character, "ABSTRACT_PRIVATE_KEY")
647+
// ? abstractPlugin
648+
// : null,
649+
// getSecret(character, "BINANCE_API_KEY") &&
650+
// getSecret(character, "BINANCE_SECRET_KEY")
651+
// ? binancePlugin
652+
// : null,
653+
// getSecret(character, "FLOW_ADDRESS") &&
654+
// getSecret(character, "FLOW_PRIVATE_KEY")
655+
// ? flowPlugin
656+
// : null,
657+
// getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
658+
// getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
659+
// getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
660+
// getSecret(character, "CRONOSZKEVM_PRIVATE_KEY")
661+
// ? cronosZkEVMPlugin
662+
// : null,
663+
// getSecret(character, "TEE_MARLIN") ? teeMarlinPlugin : null,
664+
// getSecret(character, "TON_PRIVATE_KEY") ? tonPlugin : null,
665+
// getSecret(character, "THIRDWEB_SECRET_KEY") ? thirdwebPlugin : null,
666+
// getSecret(character, "SUI_PRIVATE_KEY") ? suiPlugin : null,
667+
// getSecret(character, "STORY_PRIVATE_KEY") ? storyPlugin : null,
668+
// getSecret(character, "FUEL_PRIVATE_KEY") ? fuelPlugin : null,
669+
// getSecret(character, "AVALANCHE_PRIVATE_KEY")
670+
// ? avalanchePlugin
671+
// : null,
672+
// getSecret(character, "ECHOCHAMBERS_API_URL") &&
673+
// getSecret(character, "ECHOCHAMBERS_API_KEY")
674+
// ? echoChambersPlugin
675+
// : null,
676+
// getSecret(character, "LETZAI_API_KEY") ? letzAIPlugin : null,
677+
// getSecret(character, "STARGAZE_ENDPOINT") ? stargazePlugin : null,
678+
// getSecret(character, "GIPHY_API_KEY") ? giphyPlugin : null,
679+
// getSecret(character, "GENLAYER_PRIVATE_KEY")
680+
// ? genLayerPlugin
681+
// : null,
682+
// getSecret(character, "AVAIL_SEED") &&
683+
// getSecret(character, "AVAIL_APP_ID")
684+
// ? availPlugin
685+
// : null,
686+
// getSecret(character, "OPEN_WEATHER_API_KEY")
687+
// ? openWeatherPlugin
688+
// : null,
689+
// // getSecret(character, "OBSIDIAN_API_TOKEN") ? obsidianPlugin : null,
690+
// getSecret(character, "ARTHERA_PRIVATE_KEY")?.startsWith("0x")
691+
// ? artheraPlugin
692+
// : null,
693+
// getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
699694
].filter(Boolean),
700695
providers: [],
701696
actions: [],
@@ -736,6 +731,7 @@ function initializeCache(
736731
db?: IDatabaseCacheAdapter
737732
) {
738733
switch (cacheStore) {
734+
/*
739735
case CacheStore.REDIS:
740736
if (process.env.REDIS_URL) {
741737
elizaLogger.info("Connecting to Redis...");
@@ -751,7 +747,7 @@ function initializeCache(
751747
} else {
752748
throw new Error("REDIS_URL environment variable is not set.");
753749
}
754-
750+
*/
755751
case CacheStore.DATABASE:
756752
if (db) {
757753
elizaLogger.info("Using Database Cache...");

0 commit comments

Comments
 (0)