Skip to content

Commit e9feefb

Browse files
committed
Third and hopefully final round of link and style guie cleanup.
1 parent 3155694 commit e9feefb

File tree

17 files changed

+320
-308
lines changed

17 files changed

+320
-308
lines changed

docs/blockchain-development-tutorials/native-vrf/commit-reveal-cadence.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ keywords:
2121

2222
Randomness is a critical component in blockchain applications. It allows fair and unpredictable outcomes for use cases like gaming, lotteries, and cryptographic protocols.
2323

24-
The most basic approach that you can use to generate a random number on EVM chains is to use block hashes, which combines the block hash with a user-provided seed and hashes them together. You can use the has that results as a pseudo-random generator seed. However, this approach has limitations. A validator that influences the random source used to compute transactions can manipulate the block hash. The block proposer can decide what to include into a block and can iterate through different combinations until they find a favorable random source.
24+
The most basic approach that you can use to generate a random number on EVM chains is to use block hashes, which combines the block hash with a user-provided seed and hashes them together. You can use the hash that results as a pseudo-random generator seed. However, this approach has limitations. A validator that influences the random source used to compute transactions can manipulate the block hash. The block proposer can decide what to include into a block and can iterate through different combinations until they find a favorable random source.
2525

2626
[Chainlink VRF][chainlink-vrf] is a popular tool that improves on this. It provides another approach you can use to generate provably random values on Ethereum and other blockchains. It relies on a decentralized oracle network to deliver cryptographically secure randomness from off-chain sources. However, this dependence on external oracles introduces several weaknesses, such as cost, latency, and scalability concerns.
2727

28-
In contrast, Flow offers a simpler and more integrated approach with its native onchain Randomness Beacon at the protocol level, which eliminates reliance on external oracles and sidestepping their associated risks.
28+
In contrast, Flow offers a simpler and more integrated approach with its native onchain Randomness Beacon at the protocol level, which eliminates reliance on external oracles and the need to sidestep their associated risks.
2929

30-
In addition to instant randomness that is available to any transaction (via `revertibleRandom` function), Flow provides a solution to the problem of a user reverting a transaction with an unfavorable outcome. Commit-Reveal schemes on Flow also rely on protocol-native secure randomness and they fix the issue of post-selection by trustless users. Commit-Reveal tools on Flow can be used within both Cadence and Consumer Decentralized Finance (DeFi) contracts. This tutorial focuses on Cadence.
30+
In addition to instant randomness that is available to any transaction (via `revertibleRandom` function), Flow provides a solution to the problem of a user who reverts a transaction with an unfavorable outcome. Commit-Reveal schemes on Flow also rely on protocol-native secure randomness and they fix the issue of post-selection by trustless users. Commit-Reveal tools on Flow can be used within both Cadence and Consumer Decentralized Finance (DeFi) contracts. This tutorial focuses on Cadence.
3131

3232
## Objectives
3333

@@ -55,7 +55,7 @@ To illustrate this concept, we will build a Coin Toss game on Flow, which demons
5555

5656
### What is the Coin Toss Game?
5757

58-
The Coin Toss Game is a decentralized betting game that showcases the commit-reveal pattern. Players place bets without knowing the random outcome, which ensures fairness and resistance to manipulation.
58+
The Coin Toss Game is a decentralized betting game that showcases the commit-reveal pattern. Players place bets and don't know the random outcome, which ensures fairness and resistance to manipulation.
5959

6060
The game consists of two distinct phases:
6161

@@ -80,13 +80,13 @@ In addition, commit-reveal patterns solve the issue of revertible randoms:
8080

8181
:::info
8282

83-
One of the powers of Cadence transactions is that a developer can set post-conditions that must be true, or the transaction will revert. This is very useful for scenarios such as guaranteeing a user receives their purchase in a complex and multi-step transaction, but it also means that they can set conditions to reject the transaction. In an instant-win lottery, this would allow users to test large numbers of tickets for a win without paying the purchase price.
83+
One of the powers of Cadence transactions is that a developer can set post-conditions that must be true, or the transaction will revert. This is very useful for scenarios such as to guarantee a user receives their purchase in a complex and multi-step transaction, but it also means that they can set conditions to reject the transaction. In an instant-win lottery, this would allow users to test large numbers of tickets for a win without purchase price payment.
8484

8585
:::
8686

8787
## Build the Coin Toss contract
8888

89-
In this section, we'll walk through how to construct the `CoinToss.cdc` contract, which contains the core logic for the Coin Toss game. To function properly, the contract relies on supporting contracts and a proper deployment setup.
89+
In this section, we'll walk through how to construct the `CoinToss.cdc` contract, which contains the core logic for the Coin Toss game. To function properly, the contract relies on support contracts and a proper deployment setup.
9090

9191
This tutorial will focus specifically on how to write and understand the `CoinToss.cdc` contract, while you can find additional setup details in the [original GitHub repo][github-repo].
9292

@@ -136,7 +136,7 @@ access(all) fun flipCoin(bet: @{FungibleToken.Vault}): @Receipt {
136136

137137
### Step 3: Implement the reveal phase With `revealCoin`
138138

139-
Now we implement the reveal phase with the `revealCoin` function. Here, the caller provides the Receipt they recieve at commitment. The contract then "flips a coin" with `_randomCoin()` providing the Receipt's contained Request. The reveal step is possible only when the protocol random source at the committed block height becomes available.
139+
Now we implement the reveal phase with the `revealCoin` function. Here, the caller provides the Receipt they recieve at commitment. The contract then "flips a coin" and `_randomCoin()` provides the Receipt's contained Request. The reveal step is possible only when the protocol random source at the committed block height becomes available.
140140

141141
If result is 1, the user loses, but if it's 0, the user doubles their bet. Note that the caller could condition the revealed transaction, but they've already provided their bet amount, so there's no loss for the contract if they do.
142142

@@ -213,14 +213,14 @@ transaction(betAmount: UFix64) {
213213

214214
![remix5-sc](./imgs/remix5.png)
215215

216-
5. Track it: You can take the transaction id to [FlowDiver][flow-diver][.io](https://testnet.flowdiver.io/tx/9c4f5436535d36a82d4ae35467b37fea8971fa0ab2409dd0d5f861f61e463d98) to have a full view of everything that's going on with this `FlipCoin` transaction.
216+
5. Track it: You can take the transaction id to [FlowDiver][flow-diver][.io] to have a full view of everything about this `FlipCoin` transaction.
217217

218218
### Reveal the coin toss result
219219

220220
Let's reveal the outcome of your coin toss to see if you've won. This step uses the receipt from your bet, so ensure you use the same account that placed the bet. Here's how to do it:
221221

222222
1. Return to your Dev Environment: Open [run.dnz][run-dnz] again.
223-
2. Enter the Reveal Code: Paste the following Cadence transaction into the editor:
223+
2. Enter the Reveal Code. Paste the following Cadence transaction into the editor:
224224

225225
```cadence
226226
import FlowToken from 0x7e60df042a9c0868
@@ -249,7 +249,7 @@ transaction {
249249
}
250250
```
251251

252-
After we run this transaction, we reveal the result of the coin flip and it's 1! It means we haven't won anything this time, but keep trying!
252+
After we run this transaction, we reveal the result of the coin flip and it's 1! It means we haven't won anything this time, but we'll try again!
253253

254254
You can find the full transaction used for this example, with its result and events, at [FlowDiver.io/tx/][flow-diver-tx].
255255

@@ -276,6 +276,7 @@ When you harness the built-in randomness capabilities on Flow, you can create en
276276
[flow-docs]: https://developers.flow.com
277277
[flow-diver]: https://testnet.flowdiver.io/
278278
[github-repo]: https://github.com/onflow/random-coin-toss
279+
[.io]: https://testnet.flowdiver.io/tx/9c4f5436535d36a82d4ae35467b37fea8971fa0ab2409dd0d5f861f61e463d98
279280
[run-dnz]: https://run.dnz.dev/
280281
[coin-toss-contract]: https://contractbrowser.com/A.b6c99d7ff216a684.CoinToss
281282
[coin-toss-contract-code]: https://github.com/onflow/random-coin-toss/blob/main/contracts/CoinToss.cdc

docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/agentkit-flow-guide.md

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ sidebar_label: Using AgentKit on Flow
55
sidebar_position: 2
66
---
77

8-
# Getting Started with AgentKit on Flow
8+
# Build Custom AI Agents on Flow with AgentKit
99

1010
AgentKit is an ecosystem-agnostic modular developer toolkit that lets you rapidly build, deploy, and iterate on AI agents using pre-configured environments and ready-to-use templates.
1111

1212
In this guide, you'll set up your own custom agent that runs on **Flow's EVM-compatible testnet**, powered by **Langchain** and **Anthropic's Claude** LLM.
1313

1414
---
1515

16-
## Quickstart - Starting From Scratch
16+
## Quickstart - start from scratch
1717

1818
Open your terminal and run:
1919

@@ -36,7 +36,7 @@ Follow the interactive setup:
3636

3737
---
3838

39-
## Project Setup
39+
## Project setup
4040

4141
When your scaffold is ready:
4242

@@ -45,7 +45,7 @@ cd onchain-agent
4545
npm install
4646
```
4747

48-
Now open the project in your preferred integrated development environment (IDE) (for example, [Cursor](../cursor/index.md).
48+
Now open the project in your preferred integrated development environment (IDE) (for example, [Cursor].
4949

5050
### Environment Configuration
5151

@@ -56,7 +56,7 @@ Now open the project in your preferred integrated development environment (IDE)
5656
5757
### Get Your Anthropic API Key
5858

59-
- Head to [Anthropic Console](https://console.anthropic.com/dashboard).
59+
- Head to [Anthropic Console].
6060
- Create an account and **purchase credits**.
6161
- Click **Create Key**, name it, and copy the API key.
6262
- Add this to your `.env.local`:
@@ -65,10 +65,10 @@ Now open the project in your preferred integrated development environment (IDE)
6565
ANTHROPIC_API_KEY=your_api_key_here
6666
```
6767

68-
### Wallet Setup with MetaMask
68+
### Wallet setup with MetaMask
6969

70-
1. Add [Flow Testnet](https://developers.flow.com/evm/using) to MetaMask.
71-
2. Use the [Faucet](https://faucet.flow.com/fund-account) to fund your wallet.
70+
1. Add [Flow Testnet] to MetaMask.
71+
2. Use the [Faucet] to fund your wallet.
7272
3. Get your private key:
7373
- Click the `...` menu in MetaMask > **Account Details**.
7474
- Enter your password, copy the private key.
@@ -104,11 +104,11 @@ http://localhost:3000
104104

105105
If your agent doesn't respond yet, no worries! You still need to configure your **LLM and client libraries**.
106106

107-
### Choose a Model
107+
### Choose a model
108108

109-
Langchain supports many LLMs ([full list here](https://python.langchain.com/docs/integrations/llms/)).
109+
Langchain supports many LLMs ([full list here]).
110110

111-
For this example, we'll use **Anthropic's `claude-3-5-haiku-20241022`**, a lightweight and affordable model. Alternatively, [DeepSeek](https://deepseek.com/) is highly recommended for budget-friendly usage.
111+
For this example, we'll use **Anthropic's `claude-3-5-haiku-20241022`**, a lightweight and affordable model. Alternatively, [DeepSeek] is highly recommended for budget-friendly usage.
112112

113113
### Update `create-agent.ts`
114114

@@ -134,9 +134,9 @@ npm install @langchain/anthropic
134134

135135
---
136136

137-
## Configure Flow and Viem Wallet
137+
## Configure Flow and Viem wallet
138138

139-
### Update the Faucet Provider Logic
139+
### Update the Faucet provider logic
140140

141141
Change this:
142142

@@ -150,7 +150,7 @@ To:
150150
const canUseFaucet = walletProvider.getNetwork().networkId == 'flow-testnet';
151151
```
152152

153-
### Add Flow Context Message to Agent
153+
### Add Flow context message to Agent
154154

155155
This gives your agent context about the Flow testnet:
156156

@@ -196,11 +196,11 @@ agent = createReactAgent({
196196

197197
---
198198

199-
## You're Done!
199+
## You're done!
200200

201-
You now have a working AI agent connected to Flow testnet using AgentKit!
201+
You now have a working AI agent connected to Flow testnet with AgentKit!
202202

203-
You can send faucet tokens to your wallet and start testing smart contract interactions or onchain workflows.
203+
You can send faucet tokens to your wallet and start to test smart contract interactions or onchain workflows.
204204

205205
---
206206

@@ -214,11 +214,11 @@ This starter includes all of the necessary configurations to start building imme
214214

215215
---
216216

217-
## Adding AgentKit to an Existing Project
217+
## Add AgentKit to a current project
218218

219219
Already have a project and want to add AgentKit? Follow these steps to integrate it into your codebase:
220220

221-
### Install the Package
221+
### Install the package
222222

223223
Run this command in your project's root directory:
224224

@@ -228,11 +228,11 @@ npm install onchain-agent@latest
228228

229229
This will:
230230

231-
- Download and install the latest version of the `onchain-agent` package
232-
- Add it to the dependencies section of your `package.json`
233-
- Update your `node_modules` folder accordingly
231+
- Download and install the latest version of the `onchain-agent` package.
232+
- Add it to the dependencies section of your `package.json`.
233+
- Update your `node_modules` folder accordingly.
234234

235-
### Configure Environment
235+
### Configure environment
236236

237237
1. Create or update your `.env` file with the necessary API keys:
238238

@@ -249,7 +249,7 @@ FLOW_TESTNET_RPC_URL=https://testnet.evm.nodes.onflow.org
249249
FLOW_MAINNET_RPC_URL=https://mainnet.evm.nodes.onflow.org
250250
```
251251

252-
### Integrate AgentKit in Your Code
252+
### Integrate AgentKit in your code
253253

254254
Import and configure AgentKit in your application:
255255

@@ -284,7 +284,7 @@ const agent = createReactAgent({
284284
// ...
285285
```
286286

287-
### Add Specialized Tools (Optional)
287+
### Add Specialized tools (optional)
288288

289289
To add specialized blockchain tools to your agent:
290290

@@ -314,11 +314,25 @@ const agent = createReactAgent({
314314

315315
## Resources
316316

317-
- [AgentKit Docs](https://docs.cdp.coinbase.com/agent-kit/welcome)
318-
- [Flow EVM Guide](https://developers.flow.com/evm/using)
319-
- [Langchain LLM Integrations](https://python.langchain.com/docs/integrations/llms/)
320-
- [Anthropic Model Comparison](https://docs.anthropic.com/en/docs/about-claude/models/all-models#model-comparison-table)
317+
- [AgentKit Docs]
318+
- [Flow EVM Guide]
319+
- [Langchain LLM Integrations]
320+
- [Anthropic Model Comparison]
321321

322322
---
323323

324324
Happy hacking on Flow!
325+
326+
<!-- Relative links, will not render on page -->
327+
328+
[Cursor]: ../cursor/index.md
329+
[Anthropic Console]: https://console.anthropic.com/dashboard
330+
[Flow Testnet]: https://developers.flow.com/evm/using
331+
[Faucet]: https://faucet.flow.com/fund-account
332+
[full list here]: https://python.langchain.com/docs/integrations/llms/
333+
[DeepSeek]: https://deepseek.com/
334+
[Fork the Flow AgentKit Starter]: https://github.com/Aliserag/flow-agentkit-starter
335+
[AgentKit Docs]: https://docs.cdp.coinbase.com/agent-kit/welcome
336+
[Flow EVM Guide]: https://developers.flow.com/evm/using
337+
[Langchain LLM Integrations]: https://python.langchain.com/docs/integrations/llms/
338+
[Anthropic Model Comparison]: https://docs.anthropic.com/en/docs/about-claude/models/all-models#model-comparison-table

docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/build-plugin.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ keywords:
1818

1919
Plugins are a powerful way to extend the functionality of your Eliza AI agents. This guide will walk you through the process of how to create custom plugins that can enhance your agent's capabilities, from simple utilities to complex integrations with external services. You'll learn how to leverage the plugin system to create modular and reusable components for your AI agents.
2020

21-
## Learning Objectives
21+
## Learning objectives
2222

2323
After you complete this tutorial, you will be able to:
2424

@@ -33,21 +33,21 @@ After you complete this tutorial, you will be able to:
3333

3434
Before you get started with Eliza, make sure you have:
3535

36-
- [Node.js 23+] (using [nvm] is recommended)
36+
- [Node.js 23+] (we recommend that you use [nvm])
3737
- [pnpm 9+]
3838
- Git for version control
39-
- A code editor ([VS Code], [Cursor] or [VSCodium] recommended)
39+
- A code editor (we recommend [VS Code], [Cursor] or [VSCodium])
4040
- [Flow-cli] for Flow blockchain interaction.
4141

42-
> **Note for Windows Users:** [WSL 2] is required.
42+
> **Note for Windows users:** [WSL 2] is required.
4343
4444
## Quickstart
4545

4646
Follow the [Quickstart Guide] to set up your development environment.
4747

48-
## Plugin Development
48+
## Plugin development
4949

50-
### Create a Plugin repository from Template
50+
### Create a plugin repository from Template
5151

5252
Visit [Eliza Plugin Template] and click "Use this template" to create a new repository.
5353

@@ -59,7 +59,7 @@ Flow's Eliza plugin template uses Dependency Injection(`@elizaos-plugins/plugin-
5959

6060
:::
6161

62-
### Add the Plugin repository to your Eliza project
62+
### Add the plugin repository to your Eliza project
6363

6464
Let's say you created a repository named `username/plugin-foo`.
6565

@@ -93,7 +93,7 @@ Check the `agent/package.json` to make sure the plugin is added. You'll see some
9393
}
9494
```
9595

96-
### Build the Plugin
96+
### Build the plugin
9797

9898
Build the plugin with the following command:
9999

@@ -104,9 +104,9 @@ pnpm build --filter ./packages/plugin-foo
104104
pnpm build
105105
```
106106

107-
### Add Plugin to the `character.json` you want to use
107+
### Add the plugin to the `character.json` you want to use
108108

109-
Let's say you want to add the plugin to the `sample` character which is `characters/sample.character.json`.
109+
Let's say you want to add the plugin to the `sample` character, which is `characters/sample.character.json`.
110110

111111
```json
112112
{
@@ -119,7 +119,7 @@ Let's say you want to add the plugin to the `sample` character which is `charact
119119

120120
:::warning
121121

122-
If you use Dependency Injection(`@elizaos-plugins/plugin-di`) in your plugin, remember to add it to the `postProcessors` field. And **`clients` field is deprecated** in the latest version of Eliza, so if you want to add clients, you also need to use `plugins` field.
122+
If you use Dependency Injection(`@elizaos-plugins/plugin-di`) in your plugin, remember to add it to the `postProcessors` field. The **`clients` field is deprecated** in the latest version of Eliza, so if you want to add clients, you also need to use `plugins` field.
123123

124124
:::
125125

@@ -136,7 +136,7 @@ If you use Dependency Injection(`@elizaos-plugins/plugin-di`) in your plugin, re
136136
}
137137
```
138138

139-
### Run the Eliza Agent with your Plugin
139+
### Run the Eliza agent with your plugin
140140

141141
Run the Eliza agent to test the plugin.
142142

@@ -147,7 +147,7 @@ pnpm start --character="characters/sample.character.json"
147147
pnpm start:debug --character="characters/sample.character.json"
148148
```
149149

150-
### Interact with the Agent
150+
### Interact with the agent
151151

152152
Now, you're ready to start a conversation with your agent.
153153

@@ -157,7 +157,7 @@ Open a new terminal window and run the client's http server.
157157
pnpm start:client
158158
```
159159

160-
## Plugin Registration
160+
## Plugin registration
161161

162162
You need to register your plugin in the [Eliza Plugin Registry] to make it available for other users.
163163

0 commit comments

Comments
 (0)