Skip to content

Commit eacbe82

Browse files
authored
Update README.md
1 parent 95442be commit eacbe82

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

README.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,52 @@
22

33
A plugin for handling Polkadot blockchain operations, providing wallet management and price fetching capabilities.
44

5-
### Usage
6-
---
7-
Add the plugin to your character configuration:
8-
9-
```
10-
"plugins": ["@elizaos-plugins/plugin-polkadot"]
11-
```
12-
## Configuration
13-
The plugin requires these environment variables (can be set in .env file or character settings):
5+
## Step by Step Usage
6+
7+
**Option 1** - Dynamically Loading from Github repo:
8+
1. Follow the ElizaOS quickstart instructions here: https://eliza.how/docs/quickstart
9+
2. Add the following dependancy in your newly created agent's package.json: `"@esscrypt/plugin-polkadot": "github:Esscrypt/plugin-polkadot"`
10+
3. Add the following line to the end of the plugins array in src/character.ts: `'@esscrypt/plugin-polkadot'`
11+
4. Run: `bun install`
12+
5. Start Agent: `bun run dev`
13+
6. (Optional) Set root .env with **POLKADOT_PRIVATE_KEY** and **POLKADOT_RPC_URL**
14+
> Note: When starting the Agent, if **POLKADOT_PRIVATE_KEY** is not set, an error will pop up, but the agent will still run and expect a wallet to get created by the user
15+
16+
**Option 2** - Submodule
17+
1. Clone the ElizaOS monorepo: https://github.com/elizaOS/eliza
18+
2. Inside packages, clone the polkadot-plugin repo: https://github.com/Esscrypt/plugin-polkadot
19+
3. Configuration. Ether:
20+
- Inside `packages/plugin-polkadot/characters/polkadot.character.json`, Fill up the secrets:
1421
```env
1522
"settings": {
16-
"POLKADOT_RPC_URL": "rpc-url",
17-
"COINMARKETCAP_API_KEY": "<api-key>",
18-
"POLKADOT_PRIVATE_KEY": "<private_key>"
23+
"secrets": {
24+
"POLKADOT_RPC_URL": "<your-rpc-url>",
25+
"POLKADOT_PRIVATE_KEY": "<your-private-key>",
26+
"COINMARKETCAP_API_KEY": "<api-key>",
27+
"OPENAI_API_KEY": "<your-openai-api-key>"
28+
29+
}
1930
}
2031
```
21-
Or in .env file:
32+
- Or in .env file:
2233

2334
```env
2435
POLKADOT_RPC_URL=your_polkadot_rpc_endpoint # Optional - defaults to wss://rpc.polkadot.io
2536
COINMARKETCAP_API_KEY=your_cmc_api_key # Optional - for fetching token prices
2637
POLKADOT_PRIVATE_KEY=your_mnemonic_phrase # Optional - for default wallet initialization via initWalletProvider
38+
OPENAI_API_KEY=your-openai-api-key> # Optional - for inference through the OpenAI LLM. You can use a different one
2739
```
40+
4. In the root folder (monorepo), run:
41+
`bun i && bun run build`
42+
5. Eliza now supports a CLI that can be run through:
43+
```
44+
bun install -g @elizaos/cli
45+
elizaos start --character "packages/plugin-polkadot/characters/polkadot.character.json"
46+
# Alternatively using bun:
47+
bun run start:debug --character "packages/plugin-polkadot/characters/polkadot.character.json"
48+
```
49+
50+
#### Go to [http://localhost:3000/](http://localhost:3000/) and interact with the agent. If started, click the "Polkadot" character and then "Start agent" then interact.
2851

2952
## Overview
3053

0 commit comments

Comments
 (0)