Skip to content

Commit

Permalink
feat(docs): add getting started with FET token (#1110)
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Croft <[email protected]>
  • Loading branch information
FelixNicolaeBucsa and Joshua Croft authored Dec 20, 2024
1 parent 5944486 commit 9b0b0c1
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 123 deletions.
13 changes: 12 additions & 1 deletion .github/spelling/known_words_corpus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -747,4 +747,15 @@ rehype
remarkmath
katex
rehypekatex
webhook
webhook
agix
datasets
superintelligence
MEXC
DEX
SingularityNET
CEX
microtransactions
micropayments
KYC
Alrighty
126 changes: 4 additions & 122 deletions pages/apis/agentverse/almanac.mdx
Original file line number Diff line number Diff line change
@@ -1,136 +1,18 @@
import {
Note,
Properties,
Property,
Warn,
Section,
ApiIntro,
Tag,
CodeHeading,
} from "../../../components/mdx";
import { DropDownTabs, Tab } from "../../../components/mdx";
import { Row, Col } from "../../../components/mdx";
import {
ApiEndpointRequestResponse,
ApiRequest,
ApiResponses,
} from "../../../components/api-endpoint";

# Almanac API

<div className="nx-text-fetch-content">
Welcome to the Almanac API documentation.
</div>

## Overview

<Row>
<Col>
The Almanac API allows you to manage your agents that are hosted by Agentverse. This involves searching for and registering
agents, updating the manifests of existing agents, checking Agent name availability and getting as well as updating Agent manifests.
</Col>
<Col>
```bash filename="Endpoints"
GET /v1/almanac/recent
POST /v1/almanac/search

GET /v1/almanac/agents/:address
GET /v1/almanac/search/available_name

GET /v1/almanac/manifests/protocols/:protocol_digest
GET /v1/almanac/manifests/models/:model_digest
```
</Col>

</Row>

## Notable Objects

### The Agent Object

<Row>
<Col>
<Properties>
<Property name="status" type="string">
The given address of the agent.
</Property>
<Property name="address" type="string">
The domain name associated with an address.
</Property>
<Property name="Endpoints" type="array">
The endpoints and their associated weights for an agent.
</Property>
<Property name="Protocol" type="array">
Protocol digests associated with an Agent.
</Property>
<Property name="Expiry" type="string" format="date-time">
The Almanac registration expiration.
</Property>
</Properties>
</Col>
<Col>
```json filename="Sample Agent Object"
{
"status": "Active",
"address": "agent1qwckmey38jd6xl6al9k5qcelr9faqfgpxh73tev6fa3ruqnzajp6yneg3qw",
"endpoints": [{"url": "https://agentverse.ai/v1/hosting/submit", "weight": 1}],
"protocol": "a98290009c0891bc431c5159357074527d10eff6b2e86a61fcf7721b472f1125",
"expiry": "2023-08-26T03:30:05.568195+00:00"
}
```
</Col>
</Row>

### The AgentNameAvailability Object

<Row>
<Col>
<Properties>
<Property name="name_prefix" type="string">
The prefix for the Agent's name.
</Property>
<Property name="domain" type="string">
The Agent's domain.
</Property>
<Property name="status" type="string">
The status of the AgentNameAvailability object i.e reserved or available.
</Property>
</Properties>
</Col>
<Col>
```json filename="Sample AgentNameAvailability Object"
{
"name_prefix": "Example Name",
"domain": ".agent",
"Status": "Available"
}
```
</Col>
</Row>

### The AgentNameAvailabilityStatus Object

<Row>
<Col>
<Properties>
<Property name="AgentNameAvailability" type="string">
Enumerated as reserved or available.
</Property>
</Properties>
</Col>
<Col>
```json filename="Sample AgentNameAvailabilityStatus Object"
{
"AgentNameAvailabilityStatus": "Enumeration": "Available"
}
```
</Col>
</Row>
some into about it.

You can see our object reference documentation [here]()
## Request and response library

### Get Recently Registered Agents



<ApiEndpointRequestResponse
apiUrl="https://agentverse.ai"
method="GET"
Expand Down
5 changes: 5 additions & 0 deletions pages/guides/fetch-network/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"intro-fet-token": {
"title": "Getting Started with FET token",
"tags": ["Beginner", "Python", "FET"],
"timestamp": true
},
"how-to-convert-fet-to-and-from-erc20": {
"title": "How to convert native FET to and from ERC-20 FET",
"tags": ["Intermediate", "Python", "FET"],
Expand Down
103 changes: 103 additions & 0 deletions pages/guides/fetch-network/intro-fet-token.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { Callout } from 'nextra/components'

# Getting Started with FET Token for Agent development

## Introduction

The FET token was created to facilitate payments in an AI driven world. Where Agents send micro payments to one another which traditional currencies do not support. The FET token is the currency of the **Artificial Superintelligence (ASI) Alliance**, uniting **Fetch.ai**, **Ocean Protocol**, and **SingularityNET**. FET token enabled decentralized AI services, governance, and computational resources.

Whether enabling microtransactions for autonomous [Agents ↗️](/guides/agents/getting-started/whats-an-agent), supporting network operations through staking, or unlocking access to AI tools, the FET token plays a central role into advancing the infrastructure of decentralized AI functionalities. Alrighty, let's get started with the FET token.

## Understanding the FET Token

The FET token is central to enabling the agentic-driven future on the Fetch.ai mainnet and within the broader ASI ecosystem. Its key utilities include:

- **Network Operations**: FET tokens secure the Fetch.ai mainnet through staking and enable decentralized governance.
- **Agent-Based Systems**: FET is used to register, and interact with autonomous AI agents in Fetch.ai’s ecosystem.
- **Decentralized Transactions**: FET enables low-cost micropayments and smart contract interactions.
- **AI Marketplace Access**: Use FET for accessing AI tools, datasets, and compute resources.

## Acquiring FET Tokens

Exchanges are the simplest way to get FET tokens.

Visit a trusted exchange such as Coinbase or Binance. You may need to create an account, which will involve you
passing [KYC ↗️](https://www.gov.uk/government/publications/know-your-customer-guidance/know-your-customer-guidance-accessible-version). Once your account is enabled, you can buy FET token. You can buy this with most global
currencies, just check on the exchange which currencies they accept.


## Storing FET

Ideally you would be sending this FET to your agent to transact on the network. However, if you'd like greater
security or accessibility..

For short-term storage goals, the ASI Wallet is an excellent choice; it provides direct functionalities for daily activities such as staking and interacting with Agents.

For long-term storage goals, you can enhance security by integrating your ASI Wallet with a hardware wallet like Ledger, offering robust protection for your assets. Follow this guide [here ↗️](/guides/fetch-network/asi-wallet/asi-wallet-hardware-connection-guide) if you wish to set up the ASI Alliance extension wallet with a Ledger hardware wallet.


## How to transfer tokens to your Agents

You can download and use the uAgents library to create autonomous Agents capable of interacting with other Agents in a decentralized environment. Check out this guide [here ↗️](/guides/agents/getting-started/installing-uagent) to get started with Agents development.

In order to get your Agent up and running within the Fetch.ai ecosystem, you will need to retrieve the Agent's address and fund it with FET tokens to make it correctly register within the network.

<Callout type="info" emoji="ℹ️">
When creating your account, it is crucial to securely store your [seed phrase ↗️](/guides/agents/getting-started/seedphrase). The seed phrase is essential for accessing your Agent's identity and controlling any funds it holds. Treat it with the highest level of security to prevent unauthorized access!
</Callout>


### Retrieving an Agent address and balance

The following Python script demonstrates how to create and initialize an Agent using the `uagents` and `cosmpy` libraries, to connect it to the Fetch.ai Mainnet, and retrieve its address and balance information:

```py copy filename="agent_address_and_balance.py"
from uagents import Agent, Context
import cosmpy

from cosmpy.aerial.client import LedgerClient, NetworkConfig

agent = Agent(name="alice", seed="", port=8000, test=False, endpoint=["http://localhost:8000/submit"])

@agent.on_event("startup")
async def introduce_agent(ctx: Context):
ctx.logger.info(f"ASI network address:{agent.wallet.address()}")
ledger_client = LedgerClient(NetworkConfig.fetch_mainnet())
address: str = agent.wallet.address()
balances = ledger_client.query_bank_all_balances(address)
ctx.logger.info(f"Balance of addr: {balances}")

if __name__ == "__main__":
agent.run()

```

**You must update the seed value, and store it safely. Losing this value will lose you your tokens.**

In the code example above an Agent named `alice` is initialized with a specified `name`, `port`, `endpoint`, and `seed`
parameters. When the Agent starts up, it logs the wallet address and queries the balance using the `LedgerClient` connected to the Fetch.ai Mainnet. Finally, the script runs the Agent, which processes the `startup` event and retrieves the balance, allowing the Agent to interact with the Fetch.ai network.

Once you run the above Agent script, you will see your Agent address and balance printed out. You will see something similar to the following output:

```
INFO: [alice]: Registration on Almanac API successful
INFO: [alice]: Registering on almanac contract...
INFO: [alice]: Registering on almanac contract...complete
INFO: [alice]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qdxdrwqek4pt9xt8kggcxus0zm54d4vgdznrs6y5acn26paphervwfj7pdd
INFO: [alice]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: [alice]: ASI network address:fetch1ujr7wyuvza7uwnkr3usv53hjlwjvu8s7l06vzf
INFO: [alice]: Balance of addr: []
```

You can now use this address to transfer your purchased FET tokens from the exchange to this Agent's address. This
should be as simple as withdrawing native FET, by selecting the Fetch.ai Mainnet network when withdrawing. Some
exchanges do not support Native FET, and you will need to use the [token bridge](https://token-bridge.fetch.ai/),
luckily we have [a guide for that too](/guides/fetch-network/how-to-convert-fet-to-and-from-erc20)


Check out the following resources for more information on Agents and how these integrate within the Fetch Ecosystem and perform operations using FET tokens:

- [Agents - uAgents Framework ↗️](/guides/agents/getting-started/whats-an-agent)
- [The Agentverse ↗️](/concepts/agent-services/agentverse-intro)
- [AI Engine ↗️](/concepts/ai-engine/ai-engine-intro)
- [DeltaV ↗️](/concepts/ai-engine/deltav)
1 change: 1 addition & 0 deletions pages/references/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"contracts": "Contracts",
"uagents": "Agents: uAgents Framework",
"agentverse": "Agentverse",
"ledger": "Ledger",
"cosmpy": "CosmPy API",
"indexer": "Indexer"
Expand Down
6 changes: 6 additions & 0 deletions pages/references/agentverse/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"alamanc": {
"title": "Almanac API",
"timestamp": true
}
}
Loading

0 comments on commit 9b0b0c1

Please sign in to comment.