Skip to content

Aliserag/elizaOnFlow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eliza 🤖 on Flow Blockchain

Flow-dedicated Autonomous Agents powered by Eliza.

ElizaOnFlow Banner

✨ Features & Use Cases

Basic Features

Check out the Eliza's README

Extra Features

  • Provide Flow-dedicated Agent without other extra blockchain dependencies runtime(by default).
    • You can still use other blockchains if you want.
  • Use InversifyJS for dependency injection.
    • Share the same instances of providers across the application and plugins.
    • All actions / evaluators / providers for plugins can be dynamically loaded and injected.
    • Provide standard action / evaluator wrapper for plugins.
    • Let develoeprs focus on the business logic of actions / evaluators.
  • Use shared flow.json for all Flow Cadence contracts dependencies in Flow relevant plugins.
  • Both Flow EVM and Flow Cadence projects will be supported.

🚀 Quick Start

Prerequisites

Note for Windows Users: WSL 2 is required.

Install ElizaOnFlow

# Clone the repository
git clone --recurse-submodules https://github.com/fixes-world/elizaOnFlow.git

# If you already cloned without submodules, run:
git submodule update --init --recursive

Automatically Start ElizaOnFlow

This will run everything to setup the project and start the bot with the default character.

sh scripts/start.sh

Edit the character file

  1. Open agent/src/character.ts to apply modifications on the default character.
  2. To load custom characters:
    • Use pnpm start --characters="path/to/your/character.json"
    • Multiple character files can be loaded simultaneously
  3. Connect with X (Twitter)
    • change "clients": [] to "clients": ["twitter"] in the character file to connect with X

Manually Start ElizaOnFlow

pnpm i
pnpm build
pnpm start

# The project iterates fast, sometimes you need to clean the project if you are coming back to the project
pnpm clean

Install / Add new Flow Cadence contracts dependencies

All Flow Cadence contracts dependencies should be installed to flow.json file. To ensure development and deployment, you need to install all dependencies.

flow deps install

And if you want to add a new contract dependency, you can use the following command:

flow deps add mainnet://0xAddress.ContractName

How to use plugins from ElizaOnFlow in original Eliza framework?

Plugins from ElizaOnFlow is compatible with the original Eliza framework but you need to apply dependency injection when you use them. You can use the following code to use the plugins from ElizaOnFlow in the original Eliza framework.

# Import packages from ElizaOnFlow to your Eliza project
pnpm add @fixes-ai/core @fixes-ai/common

Open the agent/src/index.ts file and add the following code:

// Import the normalizeCharacter function from the core package
import { normalizeCharacter } from "@fixes-ai/core";

// Load the character file
const startAgents = async () => {
    // ... existing code
    if (charactersArg) {
        characters = await loadCharacters(charactersArg, defaultCharacter);
    }

    // Right after loading the characters
    // Add this line to apply dependency injection and normalize characters, all dependencies will be injected
    characters = await Promise.all(characters.map(normalizeCharacter));

    // ... existing code
}

Additional Requirements

You may need to install Sharp. If you see an error when starting up, try installing it with the following command:

pnpm install --include=optional sharp

Community & contact

About

Flow-dedicated Autonomous Agents powered by Eliza.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.2%
  • Cadence 8.9%
  • Shell 4.5%
  • JavaScript 2.4%