README.md 6.4 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
```bash
54
# Show full profile for an ENS name or address
55
atlas profile vitalik.eth
56
atlas profile 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
57
58
# ENS Profile
59
# ============
60
#
61
# Name:        vitalik.eth
62
# Address:     0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
63
#
64
# Text Records:
65
# Website:     https://vitalik.ca
66
# Avatar:      https://euc.li/vitalik.eth
67
# Bio:         mi pinxe lo crino tcati
68
# Twitter:     VitalikButerin
69
# GitHub:      vbuterin
70
# Header:      https://pbs.twimg.com/profile_banners/295218901/1638557376/1500x500
71
# Avatar:      https://euc.li/vitalik.eth
72
# Bio:         mi pinxe lo crino tcati
73
# Website:     https://vitalik.ca
74
# GitHub:      vbuterin
75
# Twitter:     VitalikButerin
76
#
77
# Coin Records:
78
# ETH:       0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
79
#
80
# Content Hash:
81
# Type:        ipfs
82
# Hash:        bafybeig5wyxzxlhleqtop6n3eevoscfvfwlijfuo6vfvyl3zskadapoglq
83
#
84
# Resolver:    0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
85
```
86
87
### `namehash`
88
Generate a namehash for an ENS name
89
90
```bash
91
atlas namehash vitalik.eth
92
# 0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835
93
```
94
95
### `labelhash`
96
Generate a labelhash for an ENS name
97
98
```bash
99
atlas labelhash vitalik
100
# 0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc
101
```
102
103
### `resolver`
104
Get the current resolver address for an ENS name
105
106
```bash
107
atlas resolver vitalik.eth
108
# 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
109
```
110
111
### `deployments`
112
List deployed ENS contracts
113
114
```bash
115
atlas deployments
116
# Chain ID: 1
117
#   ensBaseRegistrarImplementation: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85
118
#   ensBulkRenewal: 0xa12159e5131b1eEf6B4857EEE3e1954744b5033A
119
#   ensDnsRegistrar: 0xB32cB5677a7C971689228EC835800432B339bA2B
120
#   ensDnssecImpl: 0x0fc3152971714E5ed7723FAFa650F86A4BaF30C5
121
#   ensEthRegistrarController: 0x253553366Da8546fC250F225fe3d25d0C782303b
122
#   ensNameWrapper: 0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401
123
#   ensPublicResolver: 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
124
#   ensRegistry: 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
125
#   ensReverseRegistrar: 0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb
126
#   ensUniversalResolver: 0xce01f8eee7E479C928F8919abD53E553a36CeF67
127
# Chain ID: 5
128
#   ensBaseRegistrarImplementation: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85
129
#   ....
130
```
131
132
## Edit Commands
133
134
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.
135
136
```bash
137
# By running the command below you export the env variable into your shell session
138
139
export ATLAS_PRIVATE_KEY=$(cast wallet private-key --account someaccount)
140
```
141
142
> [!WARNING]
143
> 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
144
145
### `edit txt`
146
Set or clear a text record for an ENS name
147
148
```bash
149
# Set a text record
150
atlas edit txt myname.eth com.github myusername
151
152
# Set a Discord username
153
atlas edit txt myname.eth com.discord mydiscord#1234
154
155
# Clear a text record by passing 'null'
156
atlas edit txt myname.eth com.github null
157
158
# Specify a custom resolver address
159
atlas edit txt myname.eth com.twitter myhandle --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
160
```
161
162
### `edit address`
163
Set or clear an address record for a specific coin/chain
164
165
```bash
166
# Set an ETH address
167
atlas edit address myname.eth ETH 0x1234567890123456789012345678901234567890
168
169
# Set a Bitcoin address
170
atlas edit address myname.eth BTC bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh
171
172
# Set a Solana address
173
atlas edit address myname.eth SOL 7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV
174
175
# Clear an address record by passing 'null'
176
atlas edit address myname.eth BTC null
177
178
# Specify a custom resolver address
179
atlas edit address myname.eth ETH 0x1234... --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
180
```
181
182
### `edit resolver`
183
Set the resolver for an ENS name
184
185
```bash
186
# Set resolver using registry contract (default)
187
atlas edit resolver myname.eth 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
188
189
# Set resolver using nameWrapper contract
190
atlas edit resolver myname.eth 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63 --contract nameWrapper
191
```
192
193
### `edit primary`
194
Set the primary ENS name for your address (reverse record)
195
196
```bash
197
# Set primary name
198
atlas edit primary myname.eth
199
```
200
201
### `edit abi`
202
Set or clear an ABI record for an ENS name
203
204
```bash
205
# Set ABI from a JSON file
206
atlas edit abi myname.eth ./contract-abi.json
207
208
# Set ABI with specific encoding
209
atlas edit abi myname.eth ./contract-abi.json --encode zlib
210
211
# Clear an ABI record by passing 'null'
212
atlas edit abi myname.eth null
213
214
# Specify a custom resolver address
215
atlas edit abi myname.eth ./contract-abi.json --resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63
216
```
217
218
## Development
219
220
Make sure [Bun](https://bun.sh) is installed
221
222
```bash
223
bun --version
224
```
225
226
Clone the repo and install dependencies
227
228
```bash
229
git clone https://github.com/stevedylandev/atlas
230
cd atlas
231
bun install
232
```
233
234
After making changes use the `dev` command to create a symlink to test it
235
236
```bash
237
bun dev
238
239
atlas resolve vitalik.eth
240
```
241
242
> [!NOTE]
243
> 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:
244
> ```bash
245
> which atlas | xargs rm
246
> ```
247
248
## Feedback
249
250
If you have any issues or feature requests please feel free to [open an issue](https://github.com/stevedylandev/atlas/issues/new)!