Skip to content

Commit 98d32f9

Browse files
committed
chore: working with arns
1 parent c20ff98 commit 98d32f9

18 files changed

+1162
-15
lines changed

content/build/guides/meta.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
"depin",
77
"hosting-decentralized-websites",
88
"deploy-dapp-with-ardrive-web",
9-
"arns-primary-names",
10-
"arns-undernames-versioning",
119
"crossmint-nft-minting-app",
10+
"working-with-arns",
1211
"using-turbo-in-a-browser"
1312
]
1413
}

content/build/guides/arns-primary-names.mdx renamed to content/build/guides/working-with-arns/arns-primary-names.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,26 @@ console.log(nameData.name); // e.g., "jonniesparkles"
119119

120120
<Cards>
121121
<Card
122-
href="/build/guides/arns-marketplace"
123-
title="Trade Domains"
122+
href="/build/guides/working-with-arns/arns-undernames-versioning"
123+
title="Undername Versioning"
124124
icon={<Globe />}
125125
>
126-
Check out ArNS Marketplace for buying and selling.
126+
Learn about using undernames for website versioning.
127127
</Card>
128128

129129
<Card
130-
href="/build/guides/hosting-decentralized-websites"
131-
title="Deploy Websites"
130+
href="/build/guides/working-with-arns/set-arns-records-programmatically"
131+
title="Set Records Programmatically"
132132
icon={<Code />}
133133
>
134-
See hosting decentralized websites for website setup.
134+
Use the ArIO SDK to programmatically manage ArNS records.
135135
</Card>
136136

137137
<Card
138-
href="/learn/arns"
139-
title="Technical Details"
138+
href="/build/guides/hosting-decentralized-websites"
139+
title="Deploy Websites"
140140
icon={<Book />}
141141
>
142-
Explore the ArNS documentation for advanced features.
142+
Learn how to deploy and host permanent websites on Arweave.
143143
</Card>
144144
</Cards>

content/build/guides/arns-undernames-versioning.mdx renamed to content/build/guides/working-with-arns/arns-undernames-versioning.mdx

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,92 @@ npx permaweb-deploy --arns-name myapp --undername v2 --deploy-folder ./v2-build
168168
- `v1_myapp.arweave.dev` - Version 1
169169
- `v2_myapp.arweave.dev` - Version 2
170170

171-
## Ready to Version Your Site?
171+
## Direct Code Implementation
172+
173+
For more control, you can manage undernames programmatically:
174+
175+
```javascript
176+
const { ARIO, ANT } = require("@ar.io/sdk");
177+
const { ArweaveSigner } = require("@ardrive/turbo-sdk");
178+
const fs = require("fs");
179+
180+
async function updateArNSRecord(arnsName, manifestId, undername) {
181+
// Load your wallet JSON file
182+
const jwk = JSON.parse(fs.readFileSync("./wallet.json", "utf8"));
183+
184+
const ario = ARIO.mainnet();
185+
const pid = await ario.getArNSRecord({ name: arnsName });
186+
187+
const signer = new ArweaveSigner(jwk);
188+
const ant = ANT.init({ processId: pid.processId, signer });
189+
190+
if (undername === "@") {
191+
return await ant.setBaseNameRecord({
192+
transactionId: manifestId,
193+
ttlSeconds: 900,
194+
});
195+
} else {
196+
return await ant.setUndernameRecord({
197+
undername: undername,
198+
transactionId: manifestId,
199+
ttlSeconds: 900,
200+
});
201+
}
202+
}
203+
```
204+
205+
**Complete deployment example:**
206+
207+
```javascript
208+
const { TurboFactory } = require("@ardrive/turbo-sdk");
209+
const fs = require("fs");
210+
211+
async function deployWithUndername(arnsName, undername, distFolderPath) {
212+
// Load your wallet JSON file
213+
const jwk = JSON.parse(fs.readFileSync("./wallet.json", "utf8"));
172214

173-
**Want to learn more?** Check out [ArNS Primary Names](/build/guides/arns-primary-names) for identity management.
215+
const turbo = TurboFactory.authenticated({ privateKey: jwk });
174216

175-
**Need deployment help?** See [Hosting Decentralized Websites](/build/guides/hosting-decentralized-websites) for setup guides.
217+
const { manifestResponse } = await turbo.uploadFolder({
218+
folderPath: distFolderPath,
219+
dataItemOpts: { tags: [{ name: "App-Name", value: "ar.io docs deploy" }] },
220+
manifestOptions: { fallbackFile: "index.html" },
221+
});
222+
223+
await updateArNSRecord(arnsName, manifestResponse.id, undername);
224+
console.log(
225+
`Deployed to: https://${arnsName}.ar-io.dev${undername === "@" ? "" : `/${undername}`}`
226+
);
227+
}
228+
229+
// Usage
230+
await deployWithUndername("myapp", "v1", "./build-v1");
231+
```
232+
233+
## Ready to Version Your Site?
176234

177-
**Want to trade domains?** Explore [ArNS Marketplace](/build/guides/arns-marketplace) for buying and selling.
235+
<Cards>
236+
<Card
237+
href="/build/guides/working-with-arns/set-arns-records-programmatically"
238+
title="Set Records Programmatically"
239+
icon={<Code />}
240+
>
241+
Use the ArIO SDK to programmatically manage ArNS records.
242+
</Card>
243+
244+
<Card
245+
href="/build/guides/working-with-arns/arns-primary-names"
246+
title="Primary Names"
247+
icon={<Book />}
248+
>
249+
Set up web3 identity with primary names.
250+
</Card>
251+
252+
<Card
253+
href="/build/guides/hosting-decentralized-websites"
254+
title="Deploy Websites"
255+
icon={<Globe />}
256+
>
257+
Learn how to deploy and host permanent websites on Arweave.
258+
</Card>
259+
</Cards>
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: "Working with ArNS"
3+
description: "Complete guide to managing Arweave Name System (ArNS) names and records"
4+
---
5+
6+
import { Card, Cards } from "fumadocs-ui/components/card";
7+
import { Globe, Code, Book, Settings, ShoppingCart } from "lucide-react";
8+
9+
The **Arweave Name System (ArNS)** provides human-readable names for Arweave content, making it easy to access and manage your permanent websites and applications. Learn how to register, manage, and use ArNS names effectively.
10+
11+
## What is ArNS?
12+
13+
ArNS is a decentralized naming system that allows you to:
14+
15+
- **Register human-readable names** like `myapp` instead of using long transaction IDs
16+
- **Point names to content** stored on Arweave for permanent access
17+
- **Create subdomains** (undernames) for organizing different versions and components
18+
- **Establish web3 identity** with primary names linked to wallet addresses
19+
- **Transfer ownership** of names through the ANT (Arweave Name Token) system
20+
21+
## Getting Started
22+
23+
<Cards>
24+
<Card
25+
icon={<ShoppingCart className="w-6 h-6" />}
26+
title="Purchase an ArNS Name"
27+
description="Learn how to register and purchase ArNS names using the arns.app interface"
28+
href="/build/guides/working-with-arns/purchase-arns-ui"
29+
/>
30+
<Card
31+
icon={<Settings className="w-6 h-6" />}
32+
title="Manage ArNS Names"
33+
description="Update records, transfer ownership, and configure your ArNS names"
34+
href="/build/guides/working-with-arns/manage-arns-ui"
35+
/>
36+
<Card
37+
icon={<Book className="w-6 h-6" />}
38+
title="Primary Names"
39+
description="Set up web3 identity using ArNS names that resolve to wallet addresses"
40+
href="/build/guides/working-with-arns/arns-primary-names"
41+
/>
42+
</Cards>
43+
44+
## Advanced Usage
45+
46+
<Cards>
47+
<Card
48+
icon={<Code className="w-6 h-6" />}
49+
title="Register ArNS Names Programmatically"
50+
description="Use the ArIO SDK to programmatically register and purchase ArNS names"
51+
href="/build/guides/working-with-arns/register-arns-programmatically"
52+
/>
53+
<Card
54+
icon={<Code className="w-6 h-6" />}
55+
title="Set Records Programmatically"
56+
description="Use the ArIO SDK to programmatically set and manage ArNS records"
57+
href="/build/guides/working-with-arns/set-arns-records-programmatically"
58+
/>
59+
<Card
60+
icon={<Globe className="w-6 h-6" />}
61+
title="Undername Versioning"
62+
description="Use undernames to manage different versions and components of your permanent website"
63+
href="/build/guides/working-with-arns/arns-undernames-versioning"
64+
/>
65+
</Cards>
66+
67+
## Key Concepts
68+
69+
### ArNS Names
70+
71+
Human-readable identifiers that point to Arweave content, making it easy to access your permanent websites and applications.
72+
73+
### Undernames
74+
75+
Subdomains under your main ArNS name that allow you to organize different versions, components, and content types.
76+
77+
### Primary Names
78+
79+
ArNS names used as web3 identity that resolve to wallet addresses, enabling human-readable usernames across applications.
80+
81+
### ANT (Arweave Name Token)
82+
83+
The smart contract system that manages ArNS name ownership, transfers, and record updates.
84+
85+
## Common Use Cases
86+
87+
- **Permanent websites** - Host decentralized websites with memorable names
88+
- **Application versioning** - Maintain multiple versions of your app using undernames
89+
- **Web3 identity** - Use primary names as your identity across the ecosystem
90+
- **Content organization** - Structure different types of content using undernames
91+
- **API endpoints** - Create dedicated subdomains for different services
92+
93+
## Next Steps
94+
95+
<Cards>
96+
<Card
97+
title="Host Decentralized Websites"
98+
description="Learn how to deploy and host permanent websites on Arweave"
99+
href="/build/guides/hosting-decentralized-websites"
100+
/>
101+
<Card
102+
title="Access Data"
103+
description="Start accessing Arweave content through multiple gateways"
104+
href="/build/access"
105+
/>
106+
<Card
107+
title="ArIO SDK Documentation"
108+
description="Explore the full ArIO SDK for advanced ArNS operations"
109+
href="/sdks/ar-io-sdk"
110+
/>
111+
<Card
112+
title="Join the Community"
113+
description="Connect with other developers building on AR.IO"
114+
href="https://discord.gg/cuCqBb5v"
115+
/>
116+
</Cards>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: "Managing ArNS names using arns.app"
3+
description: "Manage your ArNS names using the arns.app UI"
4+
---
5+
6+
import { Card, Cards } from "fumadocs-ui/components/card";
7+
import { Book, Code } from "lucide-react";
8+
9+
## Arns.app
10+
11+
The simplest way to register or manage an ArNS name is by using the user interface maintained by the AR.IO team at [arns.app](https://arns.app). This site can also be accessed as an ArNS name itself on any AR.IO gateway via ar://arns.
12+
13+
<Steps>
14+
<Step>
15+
Visit [arns.app](https://arns.app) in your browser and connect your wallet using the "Connect" button at the top right of the screen.
16+
17+
<img src="/arns-connect.png" alt="Connect Wallet" className="max-w-md rounded-lg" />
18+
</Step>
19+
20+
<Step>
21+
Use the "Manage Assets" button at the top right of the screen to view and manage your registered ArNS names.
22+
23+
<img src="/arns-manage-assets.png" alt="Manage Assets" className="max-w-md rounded-lg" />
24+
</Step>
25+
26+
<Step>
27+
The "Manage Assets" page will display a list of your registered ArNS names. You can click on an ArNS name to view the details of the name, or click the "gear" icon to the right of the name to view the settings for the name.
28+
29+
<img src="/arns-manage-gear.png" alt="Manage Gear" className="max-w-md rounded-lg" />
30+
</Step>
31+
<Step>
32+
The "Settings" page will display the settings for the selected ArNS name. You can transfer the name to a different wallet, add or remove controllers, set info about the name like the description, keywords, and logo, extend the lease duration, and more from this page.
33+
34+
The most common setting you will want to change is the data that the name is pointing to. You can change this by using the "Target ID" field.
35+
36+
<img src="/arns-target-id.png" alt="Target ID" className="max-w-md rounded-lg" />
37+
38+
</Step>
39+
<Step>
40+
Once you have copied in a new Arweave transaction ID to the "Target ID" field, you can click the "Save" button to save and deploy the changes.
41+
42+
Any updates to the ArNS name will require a signature from the wallet that owns the name, or an authorized controller.
43+
44+
<img src="/arns-target-save.png" alt="Save" className="max-w-md rounded-lg" />
45+
46+
</Step>
47+
</Steps>
48+
49+
## Next Steps
50+
51+
<Cards>
52+
<Card
53+
href="/build/guides/working-with-arns/register-arns-programmatically"
54+
title="Register Programmatically"
55+
icon={<Code />}
56+
>
57+
Use the ArIO SDK to programmatically register ArNS names.
58+
</Card>
59+
60+
<Card
61+
href="/build/guides/working-with-arns/set-arns-records-programmatically"
62+
title="Set Records Programmatically"
63+
icon={<Code />}
64+
>
65+
Use the ArIO SDK to programmatically manage ArNS records.
66+
</Card>
67+
68+
<Card
69+
href="/build/guides/working-with-arns/arns-primary-names"
70+
title="Primary Names"
71+
icon={<Book />}
72+
>
73+
Set up web3 identity with primary names.
74+
</Card>
75+
</Cards>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"title": "Working with ArNS",
3+
"icon": "Globe",
4+
"defaultOpen": false,
5+
"pages": [
6+
"purchase-arns-ui",
7+
"manage-arns-ui",
8+
"register-arns-programmatically",
9+
"set-arns-records-programmatically",
10+
"arns-primary-names",
11+
"arns-undernames-versioning"
12+
]
13+
}

0 commit comments

Comments
 (0)