@@ -60,12 +60,14 @@ uris:
6060COMMENT
6161
6262# ping the local cluster
63- curl -X POST --data ' {
63+ curl --location --request POST ' http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL/public' \
64+ --header ' Content-Type: application/json' \
65+ --data-raw ' {
6466 "jsonrpc": "2.0",
6567 "method": "quarkvm.ping",
6668 "params":{},
6769 "id": 1
68- }' -H ' content-type:application/json; ' 127.0.0.1:56239/ext/bc/2VCAhX6vE3UnXC6s1CBPE6jJ4c4cHWMfPgCptuWS59pQ9vbeLM
70+ }'
6971<< COMMENT
7072{"jsonrpc":"2.0","result":{"success":true},"id":1}
7173COMMENT
@@ -74,22 +76,163 @@ COMMENT
7476kill 12811
7577```
7678
77- ## Claim a Prefix (work done automatically)
79+ # CLI Usage
80+ ## Create Genesis
81+ ``` bash
82+ ./build/quark-cli genesis
83+ ```
84+
85+ ## Create Private Key
86+ ``` bash
87+ ./build/quark-cli create
88+ ```
89+
90+ ## Claim a Prefix
91+ ``` bash
92+ ./build/quark-cli \
93+ --private-key-file .quark-cli-pk \
94+ --endpoint http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL \
95+ claim patrick.avax
96+
97+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/201]... (elapsed=1.01s, est. remaining=1m54.3s, threads=16)
98+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/3329621]... (elapsed=3.01s, est. remaining=1m52.3s, threads=16)
99+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/6640466]... (elapsed=5.01s, est. remaining=1m50.3s, threads=16)
100+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/9938320]... (elapsed=7.01s, est. remaining=1m48.3s, threads=16)
101+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/13222800]... (elapsed=9.01s, est. remaining=1m46.3s, threads=16)
102+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/16473949]... (elapsed=11.01s, est. remaining=1m44.3s, threads=16)
103+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/19307265]... (elapsed=13.01s, est. remaining=1m42.3s, threads=16)
104+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/22151737]... (elapsed=15.01s, est. remaining=1m40.3s, threads=16)
105+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/25580779]... (elapsed=17.01s, est. remaining=1m38.3s, threads=16)
106+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/28485504]... (elapsed=19.01s, est. remaining=1m36.3s, threads=16)
107+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/31685345]... (elapsed=21.01s, est. remaining=1m34.3s, threads=16)
108+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/34616110]... (elapsed=23.01s, est. remaining=1m32.3s, threads=16)
109+ mining in progress[ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh/37668727]... (elapsed=25.01s, est. remaining=1m30.3s, threads=16)
110+ mining complete[40596778] (difficulty=188, surplus=541200, elapsed=26.97s)
111+ issuing tx 7Y5voKiHGvytF7ddroV7UvgW8LgmxPR7EzZSyJY1MwQJ4yC9x (fee units=6150, load units=50, difficulty=188, blkID=ShWhojqb9FYqf2cWTYWauv1QFuT6igUxLjqATntvq3E52kdLh)
112+ issued transaction 7Y5voKiHGvytF7ddroV7UvgW8LgmxPR7EzZSyJY1MwQJ4yC9x (now polling)
113+ transaction 7Y5voKiHGvytF7ddroV7UvgW8LgmxPR7EzZSyJY1MwQJ4yC9x confirmed
114+ raw prefix M9Jh5DMRXwMwaTHciFLVAMpc9dZKFpuGE: units=1 expiry=2022-02-09 02:17:33 -0800 PST (719h59m58.807801s remaining)
115+ ```
116+
117+ ## Set Key in Prefix
118+ ``` bash
119+ ./build/quark-cli \
120+ --private-key-file .quark-cli-pk \
121+ --endpoint http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL \
122+ set patrick.avax/twitter @_patrickogrady
123+
124+ mining in progress[2QsEbN4VgFjeMMfxU1T9KWUFMLtyTpYT7Ud8fw4kZ7hZfMMWhA/37]... (elapsed=1.01s, threads=16)
125+ mining complete[1145609] (difficulty=165, surplus=715, elapsed=1.76s)
126+ issuing tx APWDpcgjUcDDP8P4L97x3BbKkvJ4NzZfESXc2AcNjQV99aRqw (fee units=11, load units=11, difficulty=165, blkID=2QsEbN4VgFjeMMfxU1T9KWUFMLtyTpYT7Ud8fw4kZ7hZfMMWhA)
127+ issued transaction APWDpcgjUcDDP8P4L97x3BbKkvJ4NzZfESXc2AcNjQV99aRqw (now polling)
128+ transaction APWDpcgjUcDDP8P4L97x3BbKkvJ4NzZfESXc2AcNjQV99aRqw confirmed
129+ raw prefix M9Jh5DMRXwMwaTHciFLVAMpc9dZKFpuGE: units=2 expiry=2022-01-25 02:18:47 -0800 PST (359h59m58.948798s remaining)
130+ ```
131+
132+ ## Get Key in Preifx
133+ ``` bash
134+ ./build/quark-cli \
135+ --private-key-file .quark-cli-pk \
136+ --endpoint http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL \
137+ get patrick.avax/twitter
138+
139+ range success 1 key-values
140+ key: " twitter" , value: " @_patrickogrady"
141+ ```
142+
143+ ## Delete Key in Preifx
144+ ``` bash
145+ ./build/quark-cli \
146+ --private-key-file .quark-cli-pk \
147+ --endpoint http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL \
148+ delete patrick.avax/twitter
149+
150+ mining in progress[g5rmmSRrCMZDUsg5KBzNR4wpeX6Ph6xaXoNCPwUWj7xHM7epD/333]... (elapsed=1.01s, threads=16)
151+ mining complete[222163] (difficulty=127, surplus=297, elapsed=1.16s)
152+ issuing tx 2AmF6zY1mTdniwXrifoKCfzPGEqrKyJv21S8k5gSa1MYbhFR3h (fee units=11, load units=11, difficulty=127, blkID=g5rmmSRrCMZDUsg5KBzNR4wpeX6Ph6xaXoNCPwUWj7xHM7epD)
153+ issued transaction 2AmF6zY1mTdniwXrifoKCfzPGEqrKyJv21S8k5gSa1MYbhFR3h (now polling)
154+ transaction 2AmF6zY1mTdniwXrifoKCfzPGEqrKyJv21S8k5gSa1MYbhFR3h confirmed
155+ raw prefix M9Jh5DMRXwMwaTHciFLVAMpc9dZKFpuGE: units=1 expiry=2022-02-09 02:20:55 -0800 PST (719h59m58.687729s remaining)
156+ ```
78157
158+ ## Extend Prefix Life
79159``` bash
80160./build/quark-cli \
81161--private-key-file .quark-cli-pk \
82- --url http://127.0.0.1:9650 \
83- --endpoint /ext/bc/2VCAhX6vE3UnXC6s1CBPE6jJ4c4cHWMfPgCptuWS59pQ9vbeLM \
84- claim pat
85-
86- >>>>>
87- creating requester with URL http://127.0.0.1:9650 and endpoint " /ext/bc/2VCAhX6vE3UnXC6s1CBPE6jJ4c4cHWMfPgCptuWS59pQ9vbeLM"
88- Submitting tx NpfRjXRGRCXGxfqq6vcvH3GAm3yijJyxYD7QBxQFDS6YvSnXw with BlockID (zgvHpznxkG7xAh2qgsQFVkrioB4ENdKYfum6KWe6rZGiuzdPf): & {0xc00011a0c8 [175 87 123 222 38 232 10 27 198 13 215 107 60 56 102 21 11 12 195 39 191 122 160 156 155 11 183 164 202 22 22 76 231 28 232 58 18 187 198 249 170 168 232 227 43 85 90 54 94 76 49 184 59 9 194 205 222 162 20 67 208 185 115 12] 0}
89- issued transaction NpfRjXRGRCXGxfqq6vcvH3GAm3yijJyxYD7QBxQFDS6YvSnXw (success true)
90- polling transaction " NpfRjXRGRCXGxfqq6vcvH3GAm3yijJyxYD7QBxQFDS6YvSnXw"
91- confirmed transaction " NpfRjXRGRCXGxfqq6vcvH3GAm3yijJyxYD7QBxQFDS6YvSnXw"
92- prefix pat info & {Owner:0xc00011dd70 LastUpdated:1638591044 Expiry:1638591074 Keys:1}
162+ --endpoint http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL \
163+ lifeline patrick.avax
164+
165+ mining in progress[2ty1GmQAatedGd3CeUXzj5YUYVaqeMawpvCRPxqCf12u7fNfM/39]... (elapsed=1.01s, threads=16)
166+ mining complete[469870] (difficulty=169, surplus=690, elapsed=1.31s)
167+ issuing tx 2bJPjSWyr6NoDUE9ZyyamDetjNYDQ87G4dtZnT3LVf4uGYtFtU (fee units=10, load units=10, difficulty=169, blkID=2ty1GmQAatedGd3CeUXzj5YUYVaqeMawpvCRPxqCf12u7fNfM)
168+ issued transaction 2bJPjSWyr6NoDUE9ZyyamDetjNYDQ87G4dtZnT3LVf4uGYtFtU (now polling)
169+ transaction 2bJPjSWyr6NoDUE9ZyyamDetjNYDQ87G4dtZnT3LVf4uGYtFtU confirmed
170+ raw prefix M9Jh5DMRXwMwaTHciFLVAMpc9dZKFpuGE: units=1 expiry=2022-02-09 04:07:07 -0800 PST (721h44m47.312056s remaining)
171+ ```
172+
173+ # HTTP Examples
174+ ## Get Prefix Info
175+ _ cGF0cmljay5hdmF4 is "patrick.avax" in base64_
176+ ``` bash
177+ curl --location --request POST ' http://localhost:61858/ext/bc/BJfusM2TpHCEfmt5i7qeE1MwVCbw5jU1TcZNz8MYUwG1PGYRL/public' \
178+ --header ' Content-Type: application/json' \
179+ --data-raw ' {
180+ "jsonrpc": "2.0",
181+ "method": "quarkvm.prefixInfo",
182+ "params":{
183+ "prefix":"cGF0cmljay5hdmF4"
184+ },
185+ "id": 1
186+ }'
187+
188+ {
189+ " jsonrpc" : " 2.0" ,
190+ " result" : {
191+ " info" : {
192+ " owner" : [
193+ 3,
194+ 74,
195+ 255,
196+ 247,
197+ 51,
198+ 219,
199+ 231,
200+ 3,
201+ 243,
202+ 231,
203+ 100,
204+ 99,
205+ 245,
206+ 34,
207+ 43,
208+ 222,
209+ 16,
210+ 61,
211+ 202,
212+ 99,
213+ 39,
214+ 113,
215+ 85,
216+ 197,
217+ 4,
218+ 185,
219+ 122,
220+ 214,
221+ 117,
222+ 141,
223+ 45,
224+ 98,
225+ 196
226+ ],
227+ " created" : 1641809853,
228+ " lastUpdated" : 1641810055,
229+ " expiry" : 1644408427,
230+ " units" : 1,
231+ " rawPrefix" : " M9Jh5DMRXwMwaTHciFLVAMpc9dZKFpuGE"
232+ }
233+ },
234+ " id" : 1
235+ }
93236```
94237
95238# Difficulty Estiamtes
@@ -104,10 +247,10 @@ goos: darwin
104247goarch: amd64
105248pkg: github.com/ava-labs/quarkvm/pow
106249cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
107- BenchmarkDifficulty1-16 1145233 1047 ns/op
108- BenchmarkDifficulty10-16 113216 10335 ns/op
109- BenchmarkDifficulty50-16 23011 52336 ns/op
110- BenchmarkDifficulty100-16 11540 102029 ns/op
111- BenchmarkDifficulty500-16 1962 535265 ns/op
112- BenchmarkDifficulty1000-16 1132 1082758 ns/op
250+ BenchmarkDifficulty1-16 1300 921956 ns/op
251+ BenchmarkDifficulty10-16 100 11083185 ns/op
252+ BenchmarkDifficulty50-16 100 50243796 ns/op
253+ BenchmarkDifficulty100-16 12 84529354 ns/op
254+ BenchmarkDifficulty500-16 7 251526615 ns/op
255+ BenchmarkDifficulty1000-16 7 571905766 ns/op
113256```
0 commit comments