Skip to content

Commit 9b0b0c1

Browse files
FelixNicolaeBucsaJoshua Croft
and
Joshua Croft
authored
feat(docs): add getting started with FET token (#1110)
Co-authored-by: Joshua Croft <[email protected]>
1 parent 5944486 commit 9b0b0c1

File tree

7 files changed

+248
-123
lines changed

7 files changed

+248
-123
lines changed

.github/spelling/known_words_corpus.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -747,4 +747,15 @@ rehype
747747
remarkmath
748748
katex
749749
rehypekatex
750-
webhook
750+
webhook
751+
agix
752+
datasets
753+
superintelligence
754+
MEXC
755+
DEX
756+
SingularityNET
757+
CEX
758+
microtransactions
759+
micropayments
760+
KYC
761+
Alrighty

pages/apis/agentverse/almanac.mdx

+4-122
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,18 @@
1-
import {
2-
Note,
3-
Properties,
4-
Property,
5-
Warn,
6-
Section,
7-
ApiIntro,
8-
Tag,
9-
CodeHeading,
10-
} from "../../../components/mdx";
11-
import { DropDownTabs, Tab } from "../../../components/mdx";
12-
import { Row, Col } from "../../../components/mdx";
131
import {
142
ApiEndpointRequestResponse,
15-
ApiRequest,
16-
ApiResponses,
173
} from "../../../components/api-endpoint";
184

195
# Almanac API
206

21-
<div className="nx-text-fetch-content">
22-
Welcome to the Almanac API documentation.
23-
</div>
24-
25-
## Overview
26-
27-
<Row>
28-
<Col>
29-
The Almanac API allows you to manage your agents that are hosted by Agentverse. This involves searching for and registering
30-
agents, updating the manifests of existing agents, checking Agent name availability and getting as well as updating Agent manifests.
31-
</Col>
32-
<Col>
33-
```bash filename="Endpoints"
34-
GET /v1/almanac/recent
35-
POST /v1/almanac/search
36-
37-
GET /v1/almanac/agents/:address
38-
GET /v1/almanac/search/available_name
39-
40-
GET /v1/almanac/manifests/protocols/:protocol_digest
41-
GET /v1/almanac/manifests/models/:model_digest
42-
```
43-
</Col>
44-
45-
</Row>
46-
47-
## Notable Objects
48-
49-
### The Agent Object
50-
51-
<Row>
52-
<Col>
53-
<Properties>
54-
<Property name="status" type="string">
55-
The given address of the agent.
56-
</Property>
57-
<Property name="address" type="string">
58-
The domain name associated with an address.
59-
</Property>
60-
<Property name="Endpoints" type="array">
61-
The endpoints and their associated weights for an agent.
62-
</Property>
63-
<Property name="Protocol" type="array">
64-
Protocol digests associated with an Agent.
65-
</Property>
66-
<Property name="Expiry" type="string" format="date-time">
67-
The Almanac registration expiration.
68-
</Property>
69-
</Properties>
70-
</Col>
71-
<Col>
72-
```json filename="Sample Agent Object"
73-
{
74-
"status": "Active",
75-
"address": "agent1qwckmey38jd6xl6al9k5qcelr9faqfgpxh73tev6fa3ruqnzajp6yneg3qw",
76-
"endpoints": [{"url": "https://agentverse.ai/v1/hosting/submit", "weight": 1}],
77-
"protocol": "a98290009c0891bc431c5159357074527d10eff6b2e86a61fcf7721b472f1125",
78-
"expiry": "2023-08-26T03:30:05.568195+00:00"
79-
}
80-
```
81-
</Col>
82-
</Row>
83-
84-
### The AgentNameAvailability Object
85-
86-
<Row>
87-
<Col>
88-
<Properties>
89-
<Property name="name_prefix" type="string">
90-
The prefix for the Agent's name.
91-
</Property>
92-
<Property name="domain" type="string">
93-
The Agent's domain.
94-
</Property>
95-
<Property name="status" type="string">
96-
The status of the AgentNameAvailability object i.e reserved or available.
97-
</Property>
98-
</Properties>
99-
</Col>
100-
<Col>
101-
```json filename="Sample AgentNameAvailability Object"
102-
{
103-
"name_prefix": "Example Name",
104-
"domain": ".agent",
105-
"Status": "Available"
106-
}
107-
```
108-
</Col>
109-
</Row>
110-
111-
### The AgentNameAvailabilityStatus Object
112-
113-
<Row>
114-
<Col>
115-
<Properties>
116-
<Property name="AgentNameAvailability" type="string">
117-
Enumerated as reserved or available.
118-
</Property>
119-
</Properties>
120-
</Col>
121-
<Col>
122-
```json filename="Sample AgentNameAvailabilityStatus Object"
123-
{
124-
"AgentNameAvailabilityStatus": "Enumeration": "Available"
125-
}
126-
```
127-
</Col>
128-
</Row>
7+
some into about it.
1298

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

13212
### Get Recently Registered Agents
13313

14+
15+
13416
<ApiEndpointRequestResponse
13517
apiUrl="https://agentverse.ai"
13618
method="GET"

pages/guides/fetch-network/_meta.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
"intro-fet-token": {
3+
"title": "Getting Started with FET token",
4+
"tags": ["Beginner", "Python", "FET"],
5+
"timestamp": true
6+
},
27
"how-to-convert-fet-to-and-from-erc20": {
38
"title": "How to convert native FET to and from ERC-20 FET",
49
"tags": ["Intermediate", "Python", "FET"],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import { Callout } from 'nextra/components'
2+
3+
# Getting Started with FET Token for Agent development
4+
5+
## Introduction
6+
7+
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.
8+
9+
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.
10+
11+
## Understanding the FET Token
12+
13+
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:
14+
15+
- **Network Operations**: FET tokens secure the Fetch.ai mainnet through staking and enable decentralized governance.
16+
- **Agent-Based Systems**: FET is used to register, and interact with autonomous AI agents in Fetch.ai’s ecosystem.
17+
- **Decentralized Transactions**: FET enables low-cost micropayments and smart contract interactions.
18+
- **AI Marketplace Access**: Use FET for accessing AI tools, datasets, and compute resources.
19+
20+
## Acquiring FET Tokens
21+
22+
Exchanges are the simplest way to get FET tokens.
23+
24+
Visit a trusted exchange such as Coinbase or Binance. You may need to create an account, which will involve you
25+
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
26+
currencies, just check on the exchange which currencies they accept.
27+
28+
29+
## Storing FET
30+
31+
Ideally you would be sending this FET to your agent to transact on the network. However, if you'd like greater
32+
security or accessibility..
33+
34+
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.
35+
36+
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.
37+
38+
39+
## How to transfer tokens to your Agents
40+
41+
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.
42+
43+
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.
44+
45+
<Callout type="info" emoji="ℹ️">
46+
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!
47+
</Callout>
48+
49+
50+
### Retrieving an Agent address and balance
51+
52+
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:
53+
54+
```py copy filename="agent_address_and_balance.py"
55+
from uagents import Agent, Context
56+
import cosmpy
57+
58+
from cosmpy.aerial.client import LedgerClient, NetworkConfig
59+
60+
agent = Agent(name="alice", seed="", port=8000, test=False, endpoint=["http://localhost:8000/submit"])
61+
62+
@agent.on_event("startup")
63+
async def introduce_agent(ctx: Context):
64+
ctx.logger.info(f"ASI network address:{agent.wallet.address()}")
65+
ledger_client = LedgerClient(NetworkConfig.fetch_mainnet())
66+
address: str = agent.wallet.address()
67+
balances = ledger_client.query_bank_all_balances(address)
68+
ctx.logger.info(f"Balance of addr: {balances}")
69+
70+
if __name__ == "__main__":
71+
agent.run()
72+
73+
```
74+
75+
**You must update the seed value, and store it safely. Losing this value will lose you your tokens.**
76+
77+
In the code example above an Agent named `alice` is initialized with a specified `name`, `port`, `endpoint`, and `seed`
78+
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.
79+
80+
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:
81+
82+
```
83+
INFO: [alice]: Registration on Almanac API successful
84+
INFO: [alice]: Registering on almanac contract...
85+
INFO: [alice]: Registering on almanac contract...complete
86+
INFO: [alice]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8000&address=agent1qdxdrwqek4pt9xt8kggcxus0zm54d4vgdznrs6y5acn26paphervwfj7pdd
87+
INFO: [alice]: Starting server on http://0.0.0.0:8000 (Press CTRL+C to quit)
88+
INFO: [alice]: ASI network address:fetch1ujr7wyuvza7uwnkr3usv53hjlwjvu8s7l06vzf
89+
INFO: [alice]: Balance of addr: []
90+
```
91+
92+
You can now use this address to transfer your purchased FET tokens from the exchange to this Agent's address. This
93+
should be as simple as withdrawing native FET, by selecting the Fetch.ai Mainnet network when withdrawing. Some
94+
exchanges do not support Native FET, and you will need to use the [token bridge](https://token-bridge.fetch.ai/),
95+
luckily we have [a guide for that too](/guides/fetch-network/how-to-convert-fet-to-and-from-erc20)
96+
97+
98+
Check out the following resources for more information on Agents and how these integrate within the Fetch Ecosystem and perform operations using FET tokens:
99+
100+
- [Agents - uAgents Framework ↗️](/guides/agents/getting-started/whats-an-agent)
101+
- [The Agentverse ↗️](/concepts/agent-services/agentverse-intro)
102+
- [AI Engine ↗️](/concepts/ai-engine/ai-engine-intro)
103+
- [DeltaV ↗️](/concepts/ai-engine/deltav)

pages/references/_meta.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"contracts": "Contracts",
33
"uagents": "Agents: uAgents Framework",
4+
"agentverse": "Agentverse",
45
"ledger": "Ledger",
56
"cosmpy": "CosmPy API",
67
"indexer": "Indexer"
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"alamanc": {
3+
"title": "Almanac API",
4+
"timestamp": true
5+
}
6+
}

0 commit comments

Comments
 (0)