Skip to content

Commit 96ecc5c

Browse files
authored
Merge branch 'main' into humanagent/feature-20251018-122308
2 parents 5f44f20 + cd2cdb5 commit 96ecc5c

File tree

9 files changed

+9495
-9300
lines changed

9 files changed

+9495
-9300
lines changed

docs/pages/*.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Page not found
2+
3+
This page may have been moved, renamed, or removed. Our docs are actively maintained, so URLs occasionally change.
4+
5+
Please use the search field or links in the header to find what you need.
6+
7+
To request help or report a bug, please [open an issue](https://github.com/xmtp/docs-xmtp-org/issues).
8+
9+
We know how important it is to have reliable documentation and we appreciate your patience.

docs/pages/agents/build-agents/groups.mdx

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,42 @@ To learn more, see the [Gated group example](https://github.com/ephemeraHQ/xmtp-
3434

3535
The maximum group chat size is 250 members.
3636

37+
### Add members
38+
39+
You can add members directly by their Ethereum addresses or by their inbox IDs
40+
3741
```js [Node]
38-
// Get inbox IDs for identities
39-
const inboxId = await client.getInboxIdByIdentities([
40-
bo.identity,
41-
caro.identity,
42-
]);
42+
// Add members by Ethereum address
43+
await ctx.addMembersWithAddresses(group, [ address1, address2 ]);
4344

44-
// Add/remove members
45+
46+
// Add members using inbox IDs
4547
await group.addMembers([inboxId]);
48+
```
49+
50+
### Remove members
51+
52+
Remove members from the group by their Ethereum addresses or by their inbox IDs:
53+
54+
```js [Node]
55+
// Remove members by address
56+
//needs to send the group to the context
57+
await ctx.removeMembersWithAddresses(group, [ address1, address2 ]);
58+
59+
// Remove members by inbox ID
4660
await group.removeMembers([inboxId]);
61+
```
4762

48-
// Get member information
63+
### Get member information
64+
65+
Retrieve and work with member data:
66+
67+
```js [Node]
68+
// Sync group data to get latest member information
4969
await group.sync();
50-
const members = group.members;
51-
const addedByInboxId = group.addedByInboxId;
5270

53-
// Map inbox ID to account identity
54-
const inboxIdIdentityMap = new Map(
55-
members.map((member) => [member.inboxId, member.accountIdentity])
56-
);
71+
// Get all members
72+
const members = await group.members();
5773
```
5874

5975
## Manage group chat admins
@@ -74,7 +90,7 @@ await group.removeAdmin(inboxId);
7490
await group.removeSuperAdmin(inboxId);
7591
```
7692

77-
## Member information
93+
## Example usage
7894

7995
Get detailed information about group members:
8096

docs/pages/agents/build-agents/local-database.mdx

Lines changed: 14 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Each XMTP agent installation maintains its own local database containing message history, conversation state, and cryptographic material. When you delete this database (or use an in-memory database), you create a new installation that counts toward your [installation limits](/chat-apps/core-messaging/manage-inboxes#inbox-update-and-installation-limits).
44

5+
:::danger[CRITICAL FOR PRODUCTION]
6+
7+
Each time you run your agent, XMTP creates local database files that must be **kept between restarts and between deployments**. Without persistent volumes, each restart creates a new installation and you're **limited to 10 installations per inbox**.
8+
9+
:::
10+
511
## Installation limits and revocation rules
612

713
Understanding XMTP's installation and inbox limits is critical for production deployments:
@@ -12,6 +18,7 @@ Understanding XMTP's installation and inbox limits is critical for production de
1218

1319
These limits protect inbox integrity and prevent unbounded key state growth across devices. For production environments, always use persistent volumes to back up and preserve your database across agent restarts.
1420

21+
1522
## Understand local database files
1623

1724
The Agent SDK creates database files in the `dbPath` directory (default is `'/'`). These files store your agent's identity and message history.
@@ -30,22 +37,6 @@ xmtp-production-62ff7c82fa2e8c9a0a0c9e58e7247704d102c41e5ceb4dc3573792d7d7a1c688
3037
- `62ff7c82fa2e8c9a0a0c9e58e7247704d102c41e5ceb4dc3573792d7d7a1c688`: Inbox ID (Your xmtp identity)
3138
- `.db3`: SQLite database file extension
3239

33-
**Keep these files between deployments:**
34-
35-
- Deleting them creates a new installation each time
36-
- Reusing them maintains the same installation
37-
- Each inbox can have up to 10 installations
38-
39-
**For production deployments:**
40-
41-
- Use persistent volumes (Railway volumes, Render disks, etc.)
42-
- The database needs to persist across restarts
43-
44-
:::warning[Note]
45-
46-
If you hit the 10 installation limit, use [this script](https://github.com/ephemeraHQ/xmtp-agent-examples?tab=readme-ov-file#revoke-installations) to revoke installations.
47-
48-
:::
4940

5041
## Understand installations
5142

@@ -89,45 +80,18 @@ If you deploy your agent to this same network environment, you have 1 inbox with
8980
/>
9081
</div>
9182

92-
Here are some best practices for agent installation management:
93-
94-
- Configure your deployments to preserve the agent's database
95-
- Consider how many platforms you'll need before hitting the 10 installation limit
96-
- Keep track of which installation corresponds to which platform
97-
- Regularly [check how many installations your agent has](/agents/deploy/debug-agents)
98-
- [Revoke installations](#revoke-agent-installations) from platforms you no longer use
99-
100-
## Common agent installation scenarios
101-
102-
### Deploy to a new platform
103-
104-
When you deploy your agent to a new platform (e.g., from Railway to Fly.io):
105-
106-
- Your agent creates a new installation for the new platform
107-
- If you already have 10 installations, you'll need to [revoke one first](#revoke-agent-installations)
108-
- The new installation will start fresh without conversation history
109-
110-
### Update an existing deployment
111-
112-
When you redeploy your agent to the same platform:
113-
114-
- If the platform preserves the database, the same installation continues working
115-
- If the platform doesn't preserve the database, a new installation is created
116-
11783
## Revoke agent installations
11884

119-
:::warning[Important]
85+
When you revoke an agent installation, it can no longer send or receive messages. However, you can still access the local database. Your agent can still run from any active installations on other deployment platforms.
12086

87+
:::danger[Important]
12188
Revoking an installation is permanent. You cannot recover access to a revoked installation.
122-
12389
:::
12490

125-
When you revoke an agent installation, it can no longer send or receive messages. However, you can still access the local database.
91+
1. Web tool: [xmtp.chat/inbox-tools](https://xmtp.chat/inbox-tools)
92+
2. CLI script: [revokeInstallations.ts](https://github.com/ephemeraHQ/xmtp-agent-examples/blob/eb1dc17e99570b77de906ba0d58094586a4af844/scripts/revokeInstallations.ts) in the xmtp-agent-examples repo
12693

127-
Your agent can still run from any active installations on other deployment platforms.
94+
```bash
95+
yarn revoke <inbox-id> <installations-to-exclude>
96+
```
12897

129-
To revoke an agent installation, use [revokeInstallations.ts](https://github.com/ephemeraHQ/xmtp-agent-examples/blob/eb1dc17e99570b77de906ba0d58094586a4af844/scripts/revokeInstallations.ts) in the xmtp-agent-examples repo. For example:
130-
131-
```bash
132-
yarn revoke <inbox-id> <installations-to-exclude>
133-
```

docs/pages/agents/concepts/context.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ agent.on('text', async (ctx) => {
7373
});
7474
```
7575

76+
### Get inbox ID by identifier
77+
78+
```typescript
79+
const inboxId = await ctx.client.getInboxIdByIdentifier({
80+
identifier: targetAddress,
81+
identifierKind: IdentifierKind.Ethereum,
82+
});
83+
```
84+
7685
### getSenderAddress()
7786

7887
Get the Ethereum address of the message sender:

docs/pages/agents/get-started/build-an-agent.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ await agent.start();
6060

6161
Each time you run your agent, XMTP creates local database files that must be **kept between restarts and between deployments**. Without persistent volumes, each restart creates a new installation and you're **limited to 10 installations per inbox**.
6262

63+
To learn more, see [Manage agent local database files and installations](/agents/build-agents/local-database).
64+
6365
:::
6466

65-
XMTP creates local database files in the `dbPath` (default is `'/'`) directory. These files store your device identity and message history. To learn more, see [Manage agent local database files and installations](/agents/build-agents/local-database).
67+
XMTP creates local database files in the `dbPath` (default is `'/'`) directory. These files store your device identity and message history.
6668

6769
### Set environment variables
6870

docs/pages/agents/get-started/faq.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,47 @@ Yes, messages are limited to just under 1MB. For larger content, use [remote att
9696

9797
No messaging fees currently. Messages are stored off-chain on the XMTP network.
9898

99+
100+
## Domains
101+
102+
### How do I register a domain for my agent?
103+
104+
#### 1. Register a new ENS domain
105+
106+
1. Go to https://app.ens.domains/
107+
2. Search for your desired name (e.g., "myagent.eth")
108+
3. If available, click "Request to register" → Complete registration (requires ETH for registration + gas fees)
109+
4. Wait ~1 minute for registration to complete
110+
111+
#### 2. Create agent wallet in MetaMask
112+
113+
1. Open MetaMask → Account selector → "Add account or hardware wallet" → "Add a new account"
114+
2. Name it (e.g., "Agent Wallet") → Create
115+
3. Click three dots → "Account details" → "Show private key" → enter password → **copy and save private key**
116+
4. Copy the wallet address
117+
118+
#### 3. Link ENS domain to agent wallet
119+
120+
1. Go to https://app.ens.domains/yourdomain.eth
121+
2. Click "Edit profile" → Under "ETH Address" → paste agent wallet address → Save
122+
3. Sign the transaction
123+
124+
#### 4. Set as primary name
125+
126+
1. Switch MetaMask to the agent wallet account
127+
2. Go to https://app.ens.domains/
128+
3. Click "My account" → Find your domain → Click "Set as primary name"
129+
4. Sign the transaction
130+
131+
#### 5. Transfer ownership (optional)
132+
133+
1. Switch back to owner account in MetaMask
134+
2. On the ENS page, click "Transfer" → paste agent address → sign transaction
135+
3. Agent now owns the domain (can update records using private key)
136+
137+
**Result**: Your agent can now use the private key to control the wallet/domain, reverse resolution works (address → name), and people can send funds to yourdomain.eth
138+
139+
99140
## Framework integration
100141

101142
### Does XMTP work with ElizaOS?

docs/pages/fund-agents-apps/calculate-fees.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Use this guide to understand XMTP fees and how to calculate estimated XMTP fees
4343

4444
## Understand XMTP fees
4545

46-
To support a decentralized and sustainable network, XMTP operates on a usage-based fee model. The fees paid by apps and agents (payers) directly compensate the independent node operators who run the infrastructure, ensuring the network remains resilient, secure, and censorship-resistant.
46+
To support a decentralized and sustainable network, XMTP operates on a usage-based fee model. **All XMTP network fees are paid in USDC** (USD Coin, a stablecoin pegged to the US dollar). The fees paid by apps and agents (payers) directly compensate the independent node operators who run the infrastructure, ensuring the network remains resilient, secure, and censorship-resistant.
4747

4848
:::tip[How to estimate your costs]
4949

@@ -70,7 +70,7 @@ Messages sent through the **XMTP Broadcast Network** incur these types of **mess
7070
- **Storage fee**: A fee charged per-byte-day of storage required.
7171
- **Congestion fee**: A dynamic fee computed by looking at the recent activity of an originator. Added only during periods of high network activity.
7272

73-
The fee rates for the base fee, storage fee, and congestion fee are denominated in dollars and stored as constants in a smart contract. These rates are set and adjusted through protocol governance and remain constant for a specified period of time.
73+
The fee rates for the base fee, storage fee, and congestion fee are denominated in USDC and stored as constants in a smart contract. These rates are set and adjusted through protocol governance and remain constant for a specified period of time.
7474

7575
Every message an app or agent sends through the XMTP Broadcast Network counts against its message allowance. These message types include:
7676

docs/pages/fund-agents-apps/run-gateway.mdx

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ You can provide the configuration options for your XMTP Gateway Service either d
159159
| Name | Required | Command line flag | Environment variable | Info |
160160
| ------------------------ | -------- | -------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
161161
| Payer Private Key | `true` | `--payer.private-key` | `XMTPD_PAYER_PRIVATE_KEY` | The `secp256k1` private key of the Ethereum Account you have already funded in the Funding Portal. Used to sign transactions and pay fees from your payer allowance in the Payer Registry smart contract. |
162+
| App Chain RPC URL | `true` | `--contracts.app-chain.rpc-url` | `XMTPD_APP_CHAIN_RPC_URL` | The RPC URL of your Blockchain RPC provider's endpoint for XMTP Chain |
163+
| Settlement Chain RPC URL | `true` | `--contracts.settlement-chain.rpc-url` | `XMTPD_SETTLEMENT_CHAIN_RPC_URL` | The RPC URL of your Blockchain RPC provider's endpoint for the Base chain |
162164
| App Chain WSS URL | `true` | `--contracts.app-chain.wss-url` | `XMTPD_APP_CHAIN_WSS_URL` | The websocket URL of your Blockchain RPC provider's endpoint for XMTP Chain |
163165
| Settlement Chain WSS URL | `true` | `--contracts.settlement-chain.wss-url` | `XMTPD_SETTLEMENT_CHAIN_WSS_URL` | The websocket URL of your Blockchain RPC provider's endpoint for the Base chain |
164-
| Environment | `true` | `--contracts.environment` | `XMTPD_CONTRACTS_ENVIRONMENT` | The environment your XMTP Gateway Service will run in. Valid values are `local`, `testnet`, and `mainnet` |
165-
| Enable Redis | `true` | `--redis.enable` | `XMTPD_REDIS_ENABLE` | Use Redis for nonce management and rate limiting. |
166+
| Environment | `true` | `--contracts.environment` | `XMTPD_CONTRACTS_ENVIRONMENT` | The environment your XMTP Gateway Service will run in. Valid values are `anvil`, `testnet`, and `mainnet` |
166167
| Redis Connection String | `false` | `--redis.connection-string` | `XMTPD_REDIS_CONNECTION_STRING` | The connection string for your Redis instance |
167168

168169
</div>
@@ -392,6 +393,48 @@ func main() {
392393

393394
```
394395

396+
```go [Rate Limiting]
397+
package main
398+
399+
import (
400+
"context"
401+
"log"
402+
"time"
403+
404+
"github.com/xmtp/xmtpd/pkg/gateway"
405+
"github.com/xmtp/xmtpd/pkg/gateway/authorizers"
406+
)
407+
408+
func main() {
409+
cfg := gateway.MustLoadConfig()
410+
redis := gateway.MustSetupRedisClient(context.Background(), cfg.Redis)
411+
412+
authorizer := authorizers.NewRateLimitBuilder().
413+
WithLogger(gateway.MustCreateLogger(cfg)).
414+
WithRedis(redis).
415+
// Set rate limits to 50 requests/minute and 250 requests/hour
416+
WithLimits(authorizers.RateLimit{
417+
Capacity: 50,
418+
RefillEvery: time.Minute,
419+
}, authorizers.RateLimit{
420+
Capacity: 250,
421+
RefillEvery: time.Hour,
422+
}).
423+
MustBuild()
424+
425+
gatewayService, err := gateway.NewGatewayServiceBuilder(cfg).
426+
WithRedisClient(redis).
427+
WithAuthorizers(authorizer).
428+
Build()
429+
if err != nil {
430+
log.Fatalf("Failed to build gateway service: %v", err)
431+
}
432+
433+
gatewayService.WaitForShutdown()
434+
}
435+
436+
```
437+
395438
:::
396439

397440
## Authorize requests
@@ -443,7 +486,7 @@ We provide a Docker image that corresponds to the bare bones example above that
443486
docker run -p 5050:5050 -p 5055:5055 -e XMTPD_PAYER_PRIVATE_KEY=... xmtp/xmtpd-gateway:main
444487
```
445488

446-
Most production apps will require some level of customization to authorize user requests. We provide a sample Dockerfile in the xmtpd [`dev/docker`](https://github.com/xmtp/xmtpd/blob/main/dev/docker/gateway.Dockerfile) directory that you can use as a starting point.
489+
Most production apps will require some level of customization to authorize user requests. You can fork our [example repository](https://github.com/xmtp/gateway-service-example), which includes a Dockerfile and a sample configuration.
447490

448491
The system is able to run without any external dependencies, but we recommend configuring a Redis instance to use for nonce management and rate limiting.
449492

0 commit comments

Comments
 (0)