Skip to content

Commit 0841462

Browse files
authored
Merge pull request #1 from randomlogin/main
Added curl equivalents, updated bitcoin installation info
2 parents 6ee9ef9 + a1bbcb1 commit 0841462

File tree

3 files changed

+132
-75
lines changed

3 files changed

+132
-75
lines changed

getting-started/installation.md

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,7 @@ description: You can try the Bitcoin Spaces protocol on testnet4 🎉
55
# Installation
66

77
### Install Bitcoin Core
8-
9-
{% hint style="info" %}
10-
Bitcoin Core version 28+ is required for testnet4 and it's not yet released at the time of this writing. Check the [website](https://bitcoin.org/en/bitcoin-core/) to see if it's released otherwise follow instructions below to compile from source.
11-
{% endhint %}
12-
13-
The following instructions is for compiling Bitcoin core from source to access `testnet4`
14-
15-
{% tabs %}
16-
{% tab title="MacOS" %}
17-
Setup environment xcode & brew
18-
19-
```sh
20-
xcode-select --install
21-
22-
brew install automake libtool boost pkg-config libevent llvm
23-
```
24-
25-
Compile Bitcoin core
26-
27-
```sh
28-
git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin
29-
./autogen.sh
30-
CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ ./configure --with-gui=no
31-
make
32-
make install # optional
33-
```
34-
35-
If you need further help, check the main [guide](https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md)
36-
{% endtab %}
37-
38-
{% tab title="Linux" %}
39-
#### Ubuntu/debian
40-
41-
Install dependencies
42-
43-
```sh
44-
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libevent-dev libboost-dev libsqlite3-dev
45-
```
46-
47-
Compile
48-
49-
```sh
50-
git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin
51-
./autogen.sh
52-
./configure
53-
make # use "-j N" for N parallel jobs
54-
make install # optional
55-
```
56-
57-
If you need further help or use a different distro, check the main [guide](https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md)
58-
{% endtab %}
59-
{% endtabs %}
8+
Bitcoin Core of version 28+ is required. It can be installed from the official [download page](https://bitcoincore.org/en/download/).
609

6110
### Install Spaces Daemon
6211

space-daemon/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ The Spaces daemon listens on the following ports by default:
1515

1616
All these arguments can be specified as environment variables with `SPACED_` prefix and `UPPER_SNAKE_CASE`
1717

18-
<table><thead><tr><th width="270">Option</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td>--<code>chain</code></td><td>Network to use</td><td>None (Required)</td></tr><tr><td>--<code>bitcoin-rpc-url</code></td><td>Bitcoin RPC URL</td><td>Bitcoin core default URL based on the specified <code>chain</code>e.g. <a href="http://127.0.0.1:8332"><code>http://127.0.0.1:8332</code></a> for mainnet</td></tr><tr><td>--<code>bitcoin-rpc-cookie</code></td><td>Bitcoin RPC cookie file path</td><td>None</td></tr><tr><td>--<code>bitcoin-rpc-user</code></td><td>Bitcoin RPC user</td><td>None</td></tr><tr><td>--<code>bitcoin-rpc-password</code></td><td>Bitcoin RPC password</td><td>None</td></tr><tr><td>--<code>block_index</code></td><td>Enable block indexing</td><td><code>false</code></td></tr><tr><td>--<code>data_dir</code></td><td>Custom data directory to store spaced state</td><td>None</td></tr><tr><td>--<code>jobs</code></td><td>Number of concurrent workers during sync</td><td><code>8</code></td></tr><tr><td>--<code>rpc_bind</code></td><td>Bind address for JSON-RPC connections</td><td><code>127.0.0.1, ::1</code></td></tr><tr><td>--<code>rpc_port</code></td><td>Port for JSON-RPC connections</td><td>None</td></tr><tr><td>--<code>config</code></td><td>Path to a configuration file</td><td>None</td></tr></tbody></table>
18+
<table><thead><tr><th width="270">Option</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td><code>--bitcoin-rpc-cookie</code></td><td>Bitcoin RPC cookie file path</td><td>None</td></tr><tr><td><code>--bitcoin-rpc-password</code></td><td>Bitcoin RPC password</td><td>None</td></tr><tr><td><code>--bitcoin-rpc-url</code></td><td>Bitcoin RPC URL</td><td>Bitcoin core default URL based on the specified <code>--chain</code> e.g.<a href="http://127.0.0.1:8332"><code>http://127.0.0.1:8332</code></a> for mainnet</td></tr><tr><td><code>--bitcoin-rpc-user</code></td><td>Bitcoin RPC user</td><td>None</td></tr><tr><td><code>--block_index</code></td><td>Enable block indexing</td><td><code>false</code></td></tr><tr><td><code>--chain</code></td><td>Network to use</td><td>None (Required)</td></tr><tr><td><code>--config</code></td><td>Path to a configuration file</td><td>None</td></tr><tr><td><code>--data_dir</code></td><td>Custom data directory to store spaced state</td><td>None</td></tr><tr><td><code>--jobs</code></td><td>Number of concurrent workers during sync</td><td><code>8</code></td></tr><tr><td><code>--rpc_bind</code></td><td>Bind address for JSON-RPC connections</td><td><code>127.0.0.1, ::1</code></td></tr><tr><td><code>--rpc_port</code></td><td>Port for JSON-RPC connections</td><td>None</td></tr></tbody></table>
1919

space-daemon/server-api.md

Lines changed: 130 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@ The daemon implements [JSON RPC](https://www.jsonrpc.org/specification), so you
1919

2020
**Params** None
2121

22-
**Response**
22+
{% tabs %}
23+
{% tab title="CLI" %}
24+
```
25+
space-cli --chain testnet4 getserverinfo
26+
```
27+
{% endtab %}
28+
29+
{% tab title="cURL" %}
30+
```bash
31+
curl -X POST http://127.0.0.1:7224 \
32+
-H "Content-Type: application/json" \
33+
-d '{"jsonrpc":"2.0","method":"getserverinfo","params":[],"id":1}'
34+
```
35+
{% endtab %}
36+
{% endtabs %}
37+
38+
**Example Response**
2339

2440
```json
2541
"chain": "testnet4",
@@ -37,6 +53,22 @@ The daemon implements [JSON RPC](https://www.jsonrpc.org/specification), so you
3753

3854
<table><thead><tr><th width="223">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>space</code></td><td>string</td><td>Canonical space name e.g. @bitcoin</td></tr></tbody></table>
3955

56+
{% tabs %}
57+
{% tab title="CLI" %}
58+
```
59+
space-cli --chain testnet4 getspace @bitcoin
60+
```
61+
{% endtab %}
62+
63+
{% tab title="cURL" %}
64+
```bash
65+
curl -X POST http://127.0.0.1:7224 \
66+
-H "Content-Type: application/json" \
67+
-d '{"jsonrpc":"2.0","method":"getspace","params":["@bitcoin"],"id":1}'
68+
```
69+
{% endtab %}
70+
{% endtabs %}
71+
4072
**Example Response**
4173

4274
{% tabs %}
@@ -102,7 +134,23 @@ The daemon implements [JSON RPC](https://www.jsonrpc.org/specification), so you
102134
| ------- | ------ | ---------------------------------- |
103135
| `space` | string | Canonical space name e.g. @bitcoin |
104136

105-
**Example Response**\
137+
{% tabs %}
138+
{% tab title="CLI" %}
139+
```
140+
only available via JSON-RPC
141+
```
142+
{% endtab %}
143+
144+
{% tab title="cURL" %}
145+
```bash
146+
curl -X POST http://127.0.0.1:7224 \
147+
-H "Content-Type: application/json" \
148+
-d '{"jsonrpc":"2.0","method":"getspaceowner","params":["@bitcoin"],"id":1}'
149+
```
150+
{% endtab %}
151+
{% endtabs %}
152+
153+
**Example Response**
106154
Responds with an outpoint with `txid:vout` format.
107155

108156
```json
@@ -118,21 +166,38 @@ b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1
118166
<table><thead><tr><th width="137">Name</th><th width="87">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>outpoint</code></td><td>string</td><td><p>An Outpoint which is a specific output within a transaction using <code>txid:vout</code> format e.g.</p><pre class="language-json"><code class="lang-json">b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1
119167
</code></pre></td></tr></tbody></table>
120168

169+
{% tabs %}
170+
{% tab title="CLI" %}
171+
```
172+
space-cli --chain testnet4 getspaceout "b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1"
173+
```
174+
{% endtab %}
175+
176+
{% tab title="cURL" %}
177+
```bash
178+
curl -X POST http://127.0.0.1:7224 \
179+
-H "Content-Type: application/json" \
180+
-d '{"jsonrpc":"2.0","method":"getspaceout","params":["b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1"],"id":1}'
181+
```
182+
{% endtab %}
183+
{% endtabs %}
184+
121185
**Example Response**
122186

123187
{% tabs %}
124188
{% tab title="Space UTXO" %}
125-
<pre class="language-json"><code class="lang-json"><strong>{
126-
</strong><strong> "value": 662,
127-
</strong> "script_pubkey": "5120882cd5b0ef333be2efd7efd9bea0953f894677f1d5a638c8a3d13734e99d22e6",
189+
```json
190+
{
191+
"value": 662,
192+
"script_pubkey": "5120882cd5b0ef333be2efd7efd9bea0953f894677f1d5a638c8a3d13734e99d22e6",
128193
"name": "@bitcoin",
129194
"covenant": {
130195
"type": "transfer",
131196
"expire_height": 93050,
132197
"data": null
133198
}
134199
}
135-
</code></pre>
200+
```
136201
{% endtab %}
137202

138203
{% tab title="Other UTXOs" %}
@@ -155,7 +220,23 @@ b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1
155220
| -------- | ------ | ------------------------ |
156221
| `target` | number | The target rollout block |
157222

158-
**Example Response**\
223+
{% tabs %}
224+
{% tab title="CLI" %}
225+
```
226+
space-cli --chain testnet4 estimatebid 14400
227+
```
228+
{% endtab %}
229+
230+
{% tab title="cURL" %}
231+
```bash
232+
curl -X POST http://127.0.0.1:7224 \
233+
-H "Content-Type: application/json" \
234+
-d '{"jsonrpc":"2.0","method":"estimatebid","params":[144],"id":1}'
235+
```
236+
{% endtab %}
237+
{% endtabs %}
238+
239+
**Example Response**
159240
Responds with an amount in Satoshis
160241

161242
```json
@@ -170,25 +251,35 @@ Responds with an amount in Satoshis
170251

171252
<table><thead><tr><th width="208">Name</th><th width="172">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>target</code></td><td>number</td><td>The target interval e.g. specify 0 for the coming rollout, 1 for the day after and so on.</td></tr></tbody></table>
172253

173-
**Example Response**\
254+
{% tabs %}
255+
{% tab title="CLI" %}
256+
```
257+
space-cli --chain testnet4 getrollout 0
258+
```
259+
{% endtab %}
260+
261+
{% tab title="cURL" %}
262+
```bash
263+
curl -X POST http://127.0.0.1:7224 \
264+
-H "Content-Type: application/json" \
265+
-d '{"jsonrpc":"2.0","method":"getrollout","params":[0],"id":1}'
266+
```
267+
{% endtab %}
268+
{% endtabs %}
269+
270+
**Example Response**
174271
An array of spaces expected to be in auctions within the given `target`
175272

176273
```json
177274
[
178-
{
179-
"outpoint": "1ea73982abb36cf2c62deced717fbe944c3af89abe768aa454642879b29e5adc:1",
180-
"value": 662,
181-
"script_pubkey": "51202a7267b047254ad41e87458b902c286434e3764ffd2f2fdb46a9c8fafa6135e3",
182-
"name": "@btc",
183-
"covenant": {
184-
"type": "bid",
185-
"burn_increment": 1000,
186-
"signature": "........",
187-
"total_burned": 1000,
188-
"claim_height": null
189-
}
190-
}
191-
]
275+
[
276+
"@bitcoin",
277+
1000
278+
],
279+
[
280+
"@mytestspace",
281+
1000
282+
],
192283
```
193284

194285
## Get Block Data
@@ -201,6 +292,22 @@ An array of spaces expected to be in auctions within the given `target`
201292
| ------------ | ------ | ---------------------------- |
202293
| `block_hash` | string | The block hash as hex string |
203294

295+
{% tabs %}
296+
{% tab title="CLI" %}
297+
```
298+
space-cli --chain testnet4 getblockdata 0000000012982b6d5f621229286b880e909984df669c2afabb102ce311b13f28
299+
```
300+
{% endtab %}
301+
302+
{% tab title="cURL" %}
303+
```bash
304+
curl -X POST http://127.0.0.1:7224 \
305+
-H "Content-Type: application/json" \
306+
-d '{"jsonrpc":"2.0","method":"getblockdata","params":["0000000012982b6d5f621229286b880e909984df669c2afabb102ce311b13f28"],"id":1}'
307+
```
308+
{% endtab %}
309+
{% endtabs %}
310+
204311
**Example Response**
205312

206313
```json
@@ -388,3 +495,4 @@ An array of spaces expected to be in auctions within the given `target`
388495

389496
[^1]: Checkout this outpoint here\
390497
[https://mempool.space/testnet4/tx/1ea73982abb36cf2c62deced717fbe944c3af89abe768aa454642879b29e5adc#vout=](https://mempool.space/testnet4/tx/1ea73982abb36cf2c62deced717fbe944c3af89abe768aa454642879b29e5adc#vout=1)
498+

0 commit comments

Comments
 (0)