Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts:
dist
creds
node_modules
abi
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "es5",
"semi": true,
"singleQuote": true
}
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Fileverse Agents
# Fileverse Agents

Access the Fileverse middleware, programmatically. Fileverse's middleware is expanding from powering self-sovereign human collaboration to also enabling multi-agent coordination with crypto primitives guaranteed :yellow_heart:

## Documentation

* [Take a look at our documentation](https://docs.fileverse.io/0x81fb962e2088De6925AffA4E068dd3FAF3EFE163/57#key=VWweDIp0IV7cWWPpYflsPkgEcekIkYXkdPkxfO02R2JbjXq-u1tf6Axsp7824S_7) to learn more about the Fileverse Agents SDK.
- [Take a look at our documentation](https://docs.fileverse.io/0x81fb962e2088De6925AffA4E068dd3FAF3EFE163/57#key=VWweDIp0IV7cWWPpYflsPkgEcekIkYXkdPkxfO02R2JbjXq-u1tf6Axsp7824S_7) to learn more about the Fileverse Agents SDK.

* Monitor, search and retrieve all your agents' onchain activity and outputs: https://agents.fileverse.io/
- Monitor, search and retrieve all your agents' onchain activity and outputs: https://agents.fileverse.io/

## Overview

With the Fileverse Agents SDK, your agents will have the ability to read, write, and organize data onchain and on IPFS.
With the Fileverse Agents SDK, your agents will have the ability to read, write, and organize data onchain and on IPFS.

Out of the box and by default, your agent will get its own:
* Safe Smart Account / Multisig: gasless transactions, make your Agent customisable
* Smart Contract on Gnosis: public and permissionless registry of all the agent's outputs
* Storage space on IPFS: decentralised and content addressing focused for your agent's outputs
* Human-readable .md output: markdown is a format accessible by anyone, humans and other agents

- Safe Smart Account / Multisig: gasless transactions, make your Agent customisable
- Smart Contract on Gnosis: public and permissionless registry of all the agent's outputs
- Storage space on IPFS: decentralised and content addressing focused for your agent's outputs
- Human-readable .md output: markdown is a format accessible by anyone, humans and other agents

## Installation

Expand All @@ -34,25 +35,25 @@ import { PinataStorageProvider } from '@fileverse/agents/storage';
// Create storage provider
const storageProvider = new PinataStorageProvider({
jwt: process.env.PINATA_JWT,
gateway: process.env.PINATA_GATEWAY
gateway: process.env.PINATA_GATEWAY,
});

// Initialize agent
const agent = new Agent({
chain: process.env.CHAIN, // required - options: gnosis, sepolia
viemAccount: privateKeyToAccount(process.env.PRIVATE_KEY), // required - viem account instance
pimlicoAPIKey: process.env.PIMLICO_API_KEY, // required - see how to get API keys below
storageProvider // required - storage provider instance
storageProvider, // required - storage provider instance
});

// setup storage with namespace
// This will generate the required keys and deploy a portal or pull the existing
// This will generate the required keys and deploy a portal or pull the existing
await agent.setupStorage('my-namespace'); // file is generated as the creds/${namespace}.json in the main directory

const latestBlockNumber = await agent.getBlockNumber();
console.log(`Latest block number: ${latestBlockNumber}`);

// create a new file
// create a new file
const file = await agent.create('Hello World');
console.log(`File created: ${file}`);

Expand All @@ -70,10 +71,11 @@ console.log(`File deleted: ${deletedFile}`);
```

## How to get API Keys
* Pimlico API Key: https://www.pimlico.io/
* https://docs.pimlico.io/permissionless/tutorial/tutorial-1#get-a-pimlico-api-key
* Pinata JWT and Gateway: https://pinata.cloud/
* https://docs.pinata.cloud/account-management/api-keys

- Pimlico API Key: https://www.pimlico.io/
- https://docs.pimlico.io/permissionless/tutorial/tutorial-1#get-a-pimlico-api-key
- Pinata JWT and Gateway: https://pinata.cloud/
- https://docs.pinata.cloud/account-management/api-keys

## Chains Supported

Expand Down
4 changes: 2 additions & 2 deletions abi/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PortalABI from "./Portal.json" with { type: "json" };
import PortalRegistryABI from "./PortalRegistry.json" with { type: "json" };
import PortalABI from './Portal.json' with { type: 'json' };
import PortalRegistryABI from './PortalRegistry.json' with { type: 'json' };

export { PortalABI, PortalRegistryABI };
Loading