-
Notifications
You must be signed in to change notification settings - Fork 43
docs/trustless-agent: Add ROFL TS client #1543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for oasisprotocol-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
matevz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the new chapter to the sidebar too and the Build landing page https://github.com/oasisprotocol/docs/blob/main/docs/build/README.mdx
| ## Update on-chain app config | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Update on-chain app config | |
| Then publish the enclave identities and config: |
| oasis rofl update | ||
| ``` | ||
|
|
||
| ## Deploy to a ROFL provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Deploy to a ROFL provider | |
| ## Deploy |
| Your agent can call Sapphire contracts to log decisions or perform actions. | ||
| Gate privileged paths in your contracts by verifying ROFL origin. | ||
|
|
||
| ## Build the ROFL bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Build the ROFL bundle | |
| ## Build ROFL bundle |
| ## Troubleshooting | ||
|
|
||
| - Ensure the ROFL machine can resolve your model endpoint (OpenAI/Ollama) | ||
| - Check `oasis rofl machine logs` for enclave startup issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Check `oasis rofl machine logs` for enclave startup issues | |
| - Check `oasis rofl machine logs` for enclave startup issues |
I would combine the Troubleshooting, Resources and Conclusion in something like "Testing it out" section where you'd show how to use oasis rofl machine logs and what to expect in the output.
|
|
||
|
|
||
| ```shell | ||
| # 1) Install bun and ElizaOS CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is bun really needed?
| bun --version || curl -fsSL https://bun.sh/install | bash | ||
| bun install -g @elizaos/cli | ||
|
|
||
| # 3) Configure model credentials locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 3) Configure model credentials locally | |
| # Configure model credentials locally |
| # or for local models: | ||
| # OLLAMA_HOST=http://host.docker.internal:11434 | ||
|
|
||
| # 4) Start the agent locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 4) Start the agent locally | |
| # Start the agent locally |
| ## ROFL overview | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
| ## ROFL overview |
| # 4) Start the agent locally | ||
| elizaos start | ||
| ``` | ||
| </details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover.
| </details> |
| # or for local models: | ||
| # OLLAMA_HOST=http://host.docker.internal:11434 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ditch ollama for now and rely on OpenAI only.
| # or for local models: | |
| # OLLAMA_HOST=http://host.docker.internal:11434 |
| set -e | ||
|
|
||
| # Expected env in ROFL: | ||
| # OPENAI_API_KEY (or OLLAMA_HOST) for the model provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # OPENAI_API_KEY (or OLLAMA_HOST) for the model provider | |
| # OPENAI_API_KEY for the model provider |
| <summary>docker/Dockerfile</summary> | ||
|
|
||
| ```dockerfile | ||
| FROM oven/bun:1.1-alpine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| FROM oven/bun:1.1-alpine | |
| FROM node:24-alpine |
| ADD . /app | ||
|
|
||
| # Install ElizaOS CLI and project dependencies. | ||
| RUN bun install -g @elizaos/cli && bun install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| RUN bun install -g @elizaos/cli && bun install | |
| RUN npm install -g @elizaos/cli && npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm install doesn't recognize the elizaos/cli package. The official docs list bun as package manager, I think we have to keep it.
| - OPENAI_API_KEY=${OPENAI_API_KEY} | ||
| volumes: | ||
| # Mount only if your agent needs to interact with Sapphire via appd. | ||
| # - /run/rofl-appd.sock:/run/rofl-appd.sock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you communicate with appd? Does ElizaOS now support it out of the box? If not, then just ditch the volumes section.
| bun install -g @elizaos/cli | ||
|
|
||
| # 3) Configure model credentials locally | ||
| elizaos env edit-local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work out of the box. Did you forget to run elizaos create? In this case the eliza-app folder is created there and the secrets configured.
| </details> | ||
|
|
||
| <details> | ||
| <summary>docker/Dockerfile</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dockerfile and docker/entry.sh are already generated, if using elizaos create wizzard. I would remove this.
| ## Contract interaction (high level) | ||
|
|
||
| Your agent can call Sapphire contracts to log decisions or perform actions. | ||
| Gate privileged paths in your contracts by verifying ROFL origin. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
| ## Contract interaction (high level) | |
| Your agent can call Sapphire contracts to log decisions or perform actions. | |
| Gate privileged paths in your contracts by verifying ROFL origin. |
|
|
||
| ## How the agent interacts on Sapphire | ||
|
|
||
| - Encode calldata for your contract method and call `submitEthTx(...)` via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Encode calldata for your contract method and call `submitEthTx(...)` via | |
| - Encode calldata for your contract method and call [`signSubmit()`] via |
[`signSubmit()`]: https://github.com/oasisprotocol/oasis-sdk/blob/main/docs/rofl/features/appd.md
b62b78a to
f7b85ca
Compare
f7b85ca to
a00ef8a
Compare
|
Most of the proposed changes were merged in #1560 (without ROFL TS client). I renamed this PR to add ROFL TS client. |
This PR adds docs/build/use-cases/trustless-agent.mdx, a practical guide for launching a trustless Eliza AI agent with ROFL
Issue: #1527