README.md 7.0 K raw
1
# atlas
2
3
![cover](./cover.png)
4
5
A CLI for exploring ENS
6
7
## Installation
8
9
Install using your package manager of choice
10
11
```bash
12
npm i -g @stevedylandev/atlas
13
```
14
15
Make sure it worked by running `atlas`
16
17
```bash
18
atlas
19
```
20
21
## Usage
22
23
By default Atlas will use `https://eth.drpc.org` but you can use a custom RPC by setting the environment variable `ETH_RPC_URL` in your shell.
24
25
### `resolve`
26
Resolve an ENS name to an address or vice versa
27
28
```bash
29
# Resolve ENS name to address
30
atlas resolve vitalik.eth
31
# 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
32
33
# Resolve address to ENS name
34
atlas resolve 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
35
# vitalik.eth
36
37
# Get a specific TXT record
38
atlas resolve vitalik.eth --txt com.github
39
# vbuterin
40
41
# Get content hash
42
atlas resolve vitalik.eth --contenthash
43
# bafybeig5wyxzxlhleqtop6n3eevoscfvfwlijfuo6vfvyl3zskadapoglq
44
45
# Get address for a specific chain
46
atlas resolve vitalik.eth --chain ETH
47
# 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
48
```
49
50
### `profile`
51
Display a complete ENS profile with all records
52
53
Uses [ENSNode](https://ensnode.io) for fetching indexed data
54
55
```bash
56
# Show full profile for an ENS name or address
57
atlas profile vitalik.eth
58
atlas profile 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
59
60
# ENS Profile
61
# ============
62
#
63
# Name:        vitalik.eth
64
# Address:     0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
65
#
66
# Text Records:
67
# Website:     https://vitalik.ca
68
# Avatar:      https://euc.li/vitalik.eth
69
# Bio:         mi pinxe lo crino tcati
70
# Twitter:     VitalikButerin
71
# GitHub:      vbuterin
72
# Header:      https://pbs.twimg.com/profile_banners/295218901/1638557376/1500x500
73
# Avatar:      https://euc.li/vitalik.eth
74
# Bio:         mi pinxe lo crino tcati
75
# Website:     https://vitalik.ca
76
# GitHub:      vbuterin
77
# Twitter:     VitalikButerin
78
#
79
# Coin Records:
80
# ETH:       0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
81
#
82
# Content Hash:
83
# Type:        ipfs
84
# Hash:        bafybeig5wyxzxlhleqtop6n3eevoscfvfwlijfuo6vfvyl3zskadapoglq
85
#
86
# Resolver:    0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
87
```
88
89
### `namehash`
90
Generate a namehash for an ENS name
91
92
```bash
93
atlas namehash vitalik.eth
94
# 0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835
95
```
96
97
### `labelhash`
98
Generate a labelhash for an ENS name
99
100
```bash
101
atlas labelhash vitalik
102
# 0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc
103
```
104
105
### `resolver`
106
Get the current resolver address for an ENS name
107
108
```bash
109
atlas resolver vitalik.eth
110
# 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
111
```
112
113
### `deployments`
114
List deployed ENS contracts
115
116
```bash
117
atlas deployments
118
# Chain ID: 1
119
#   ensBaseRegistrarImplementation: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85
120
#   ensBulkRenewal: 0xa12159e5131b1eEf6B4857EEE3e1954744b5033A
121
#   ensDnsRegistrar: 0xB32cB5677a7C971689228EC835800432B339bA2B
122
#   ensDnssecImpl: 0x0fc3152971714E5ed7723FAFa650F86A4BaF30C5
123
#   ensEthRegistrarController: 0x253553366Da8546fC250F225fe3d25d0C782303b
124
#   ensNameWrapper: 0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401
125
#   ensPublicResolver: 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
126
#   ensRegistry: 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
127
#   ensReverseRegistrar: 0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb
128
#   ensUniversalResolver: 0xce01f8eee7E479C928F8919abD53E553a36CeF67
129
# Chain ID: 5
130
#   ensBaseRegistrarImplementation: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85
131
#   ....
132
```
133
134
## Edit Commands
135
136
Edit commands require setting the `ATLAS_PRIVATE_KEY` environment variable with your wallet's private key to sign transactions. A great way to do this is to use the Foundry `cast` utility within a shell session.
137
138
```bash
139
# By running the command below you export the env variable into your shell session
140
141
export ATLAS_PRIVATE_KEY=$(cast wallet private-key --account someaccount)
142
```
143
144
> [!WARNING]
145
> I would **not** recommend making this environment variable permanent in your shell configurtation files! Use it during the session then close the session to keep the key encrypted locally
146
147
### `edit txt`
148
Set or clear a text record for an ENS name
149
150
```bash
151
# Set a text record
152
atlas edit txt myname.eth com.github myusername
153
154
# Set a Discord username
155
atlas edit txt myname.eth com.discord mydiscord#1234
156
157
# Clear a text record by passing 'null'
158
atlas edit txt myname.eth com.github null
159
160
# Specify a custom resolver address
161
atlas edit txt myname.eth com.twitter myhandle --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
162
```
163
164
### `edit address`
165
Set or clear an address record for a specific coin/chain
166
167
```bash
168
# Set an ETH address
169
atlas edit address myname.eth ETH 0x1234567890123456789012345678901234567890
170
171
# Set a Bitcoin address
172
atlas edit address myname.eth BTC bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh
173
174
# Set a Solana address
175
atlas edit address myname.eth SOL 7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV
176
177
# Clear an address record by passing 'null'
178
atlas edit address myname.eth BTC null
179
180
# Specify a custom resolver address
181
atlas edit address myname.eth ETH 0x1234... --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
182
```
183
184
### `edit resolver`
185
Set the resolver for an ENS name
186
187
```bash
188
# Set resolver using registry contract (default)
189
atlas edit resolver myname.eth 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
190
191
# Set resolver using nameWrapper contract
192
atlas edit resolver myname.eth 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63 --contract nameWrapper
193
```
194
195
### `edit primary`
196
Set the primary ENS name for your address (reverse record)
197
198
```bash
199
# Set primary name
200
atlas edit primary myname.eth
201
```
202
203
### `edit abi`
204
Set or clear an ABI record for an ENS name
205
206
```bash
207
# Set ABI from a JSON file
208
atlas edit abi myname.eth ./contract-abi.json
209
210
# Set ABI with specific encoding
211
atlas edit abi myname.eth ./contract-abi.json --encode zlib
212
213
# Clear an ABI record by passing 'null'
214
atlas edit abi myname.eth null
215
216
# Specify a custom resolver address
217
atlas edit abi myname.eth ./contract-abi.json --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
218
```
219
220
### `edit contenthash`
221
Set or clear a content hash for an ENS name
222
223
```bash
224
# Set an IPFS content hash
225
atlas edit contenthash myname.eth ipfs://QmRAQB6YaCyidP37UdDnjFY5vQuiBrcqdyoW1CuDgwxkD4
226
227
# Set an IPNS content hash
228
atlas edit contenthash myname.eth ipns://k51qzi5uqu5djdczd6zw0grmo23j2vkj9uzvujencg15s5rlkq0ss4ivll8wqw
229
230
# Clear a content hash by passing 'null'
231
atlas edit contenthash myname.eth null
232
233
# Specify a custom resolver address
234
atlas edit contenthash myname.eth ipfs://QmHash --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
235
```
236
237
## Development
238
239
Make sure [Bun](https://bun.sh) is installed
240
241
```bash
242
bun --version
243
```
244
245
Clone the repo and install dependencies
246
247
```bash
248
git clone https://github.com/stevedylandev/atlas
249
cd atlas
250
bun install
251
```
252
253
After making changes use the `dev` command to create a symlink to test it
254
255
```bash
256
bun dev
257
258
atlas resolve vitalik.eth
259
```
260
261
> [!NOTE]
262
> If you don't see any changes, make sure you uninstall any previously installed versions. If you use Bun it should overwrite but you can always manually fix it:
263
> ```bash
264
> which atlas | xargs rm
265
> ```
266
267
## Feedback
268
269
If you have any issues or feature requests please feel free to [open an issue](https://github.com/stevedylandev/atlas/issues/new)!