mirror of https://github.com/lukechilds/docs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
153 lines
12 KiB
153 lines
12 KiB
<p>Welcome!</p>
|
|
|
|
<p>In this tutorial, we’re going to walk through the basics of the Blockstack command line interface.</p>
|
|
|
|
<h3 id="lookups">Lookups</h3>
|
|
|
|
<p>Now, to perform a name lookup, run this command:</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>blockstack lookup timblee.id
|
|
</code></pre>
|
|
</div>
|
|
|
|
<p>You should get a response like this:</p>
|
|
|
|
<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"profile"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Person"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"account"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
|
</span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Account"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"timbl"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"proofType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"proofUrl"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://gist.github.com/timbl/04e8ac7c81cd2dee2f51a5e8c672188d"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"service"</span><span class="p">:</span><span class="w"> </span><span class="s2">"github"</span><span class="w">
|
|
</span><span class="p">},</span><span class="w">
|
|
</span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Account"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"timberners_lee"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"proofType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"proofUrl"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://twitter.com/timberners_lee/status/740677355950080001"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"service"</span><span class="p">:</span><span class="w"> </span><span class="s2">"twitter"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span><span class="p">],</span><span class="w">
|
|
</span><span class="nt">"image"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
|
</span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"@type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ImageObject"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"contentUrl"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://s3.amazonaws.com/97p/lUU.jpeg"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"cover"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span><span class="p">]</span><span class="w">
|
|
</span><span class="p">},</span><span class="w">
|
|
</span><span class="nt">"zonefile"</span><span class="p">:</span><span class="w"> </span><span class="s2">"$ORIGIN timblee.id\n$TTL 3600\n_http._tcp URI 10 1 \"https://blockstack.s3.amazonaws.com/timblee.id\"\n"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre>
|
|
</div>
|
|
|
|
<h3 id="price-estimations">Price Estimations</h3>
|
|
|
|
<p>Every name costs a certain amount of money to register, and each namespace has it’s own name pricing rules.</p>
|
|
|
|
<p>As an example, in the <code class="highlighter-rouge">.id</code> namespace 6-letter alphabetic-only names cost 0.001 bitcoins, but with every additional letter the names get 4x cheaper and with every fewer letter the names get 4x more expensive. In addition, names without vowels and names with numbers and special characters get a special discount.</p>
|
|
|
|
<p>To determine how much a name will cost to order a name (including all transaction fees), use the <code class="highlighter-rouge">price</code> command:</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>blockstack price <YOUR NAME>.id
|
|
</code></pre>
|
|
</div>
|
|
|
|
<p>Example response:</p>
|
|
|
|
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"name_price"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"btc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.00025"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"satoshis"</span><span class="p">:</span><span class="w"> </span><span class="s2">"25000"</span><span class="w">
|
|
</span><span class="p">},</span><span class="w">
|
|
</span><span class="nt">"preorder_tx_fee"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"btc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.00047406"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"satoshis"</span><span class="p">:</span><span class="w"> </span><span class="s2">"47406"</span><span class="w">
|
|
</span><span class="p">},</span><span class="w">
|
|
</span><span class="nt">"register_tx_fee"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"btc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.00046184"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"satoshis"</span><span class="p">:</span><span class="w"> </span><span class="s2">"46184"</span><span class="w">
|
|
</span><span class="p">},</span><span class="w">
|
|
</span><span class="nt">"total_estimated_cost"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"btc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.00188394"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"satoshis"</span><span class="p">:</span><span class="w"> </span><span class="s2">"188394"</span><span class="w">
|
|
</span><span class="p">},</span><span class="w">
|
|
</span><span class="nt">"update_tx_fee"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"btc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.00069804"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"satoshis"</span><span class="p">:</span><span class="w"> </span><span class="s2">"69804"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre>
|
|
</div>
|
|
|
|
<h3 id="deposits">Deposits</h3>
|
|
|
|
<p>Name registrations and name management operations cost money, so before you can do these things, you’ll need to deposit bitcoins in your account.</p>
|
|
|
|
<p><em>Note that in some cases you’ll need to wait for one or more confirmations (about 10-60 minutes) before the Blockstack CLI will register the funds as fully deposited and allow you to proceed with registering names.</em></p>
|
|
|
|
<p>To get the Bitcoin address where you should deposit your bitcoins, run the <code class="highlighter-rouge">deposit</code> command:</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>blockstack deposit
|
|
</code></pre>
|
|
</div>
|
|
|
|
<p>Example response:</p>
|
|
|
|
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"address"</span><span class="p">:</span><span class="w"> </span><span class="s2">"13aUoeUtQnHUTfRwbksKvyvMRMzN3Qf2iR"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Send bitcoins to the address specified."</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre>
|
|
</div>
|
|
|
|
<h3 id="registrations">Registrations</h3>
|
|
|
|
<p>After you get comfortable with looking up names, take the next step and register and manage a name for yourself. Run the following command:</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>blockstack register <YOUR NAME>.id
|
|
</code></pre>
|
|
</div>
|
|
|
|
<p>If the name hasn’t been registered yet, you’ll get a confirmation that your registration is pending:</p>
|
|
|
|
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"success"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"transaction_hash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"f576313b2ff4cc7cb0d25545e1e38e2d0d48a6ef486b7118e5ca0f8e8b98ae45"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"The name has been queued up for registration and will take a few hours to go through. You can check on the status at any time by running 'blockstack info'."</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre>
|
|
</div>
|
|
|
|
<p>After a few hours, your registration should go through and you’ll be able to update your DNS records for the name.</p>
|
|
|
|
<h3 id="updates">Updates</h3>
|
|
|
|
<p>To update the data record associated with a name you own, run the <code class="highlighter-rouge">blockstack update</code> command:</p>
|
|
|
|
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>cat > new_zone_file.txt <span class="sh"><<EOF
|
|
\$ORIGIN swiftonsecurity.id
|
|
\$TTL 3600
|
|
pubkey TXT "pubkey:data:04cabba0b5b9a871dbaa11c044066e281c5feb57243c7d2a452f06a0d708613a46ced59f9f806e601b3353931d1e4a98d7040127f31016311050bedc0d4f1f62ff"
|
|
_file IN URI 10 1 "file:///Users/TaylorSwift/.blockstack/storage-disk/mutable/swiftonsecurity.id"
|
|
_https._tcp IN URI 10 1 "https://blockstack.s3.amazonaws.com/swiftonsecurity.id"
|
|
_http._tcp IN URI 10 1 "http://node.blockstack.org:6264/RPC2#swiftonsecurity.id"
|
|
_dht._udp IN URI 10 1 "dht+udp://fc4d9c1481a6349fe99f0e3dd7261d67b23dadc5"
|
|
EOF
|
|
|
|
</span><span class="gp">$ </span>blockstack update swiftonsecurity.id new_zone_file.txt
|
|
</code></pre>
|
|
</div>
|
|
|
|
<p>Expected response:</p>
|
|
|
|
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nt">"success"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"transaction_hash"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4e1f292c09ad8e03a5f228b589d9a7dc3699b495862bee3b40f2432ac497b134"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"The name has been queued up for update and will take ~1 hour to process. You can check on the status at any time by running 'blockstack info'."</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre>
|
|
</div>
|
|
|