diff --git a/getting-started/installation.md b/getting-started/installation.md index 902812e..753677e 100644 --- a/getting-started/installation.md +++ b/getting-started/installation.md @@ -5,58 +5,7 @@ description: You can try the Bitcoin Spaces protocol on testnet4 🎉 # Installation ### Install Bitcoin Core - -{% hint style="info" %} -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. -{% endhint %} - -The following instructions is for compiling Bitcoin core from source to access `testnet4` - -{% tabs %} -{% tab title="MacOS" %} -Setup environment xcode & brew - -```sh -xcode-select --install - -brew install automake libtool boost pkg-config libevent llvm -``` - -Compile Bitcoin core - -```sh -git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin -./autogen.sh -CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ ./configure --with-gui=no -make -make install # optional -``` - -If you need further help, check the main [guide](https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md) -{% endtab %} - -{% tab title="Linux" %} -#### Ubuntu/debian - -Install dependencies - -```sh -sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libevent-dev libboost-dev libsqlite3-dev -``` - -Compile - -```sh -git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin -./autogen.sh -./configure -make # use "-j N" for N parallel jobs -make install # optional -``` - -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) -{% endtab %} -{% endtabs %} +Bitcoin Core of version 28+ is required. It can be installed from the official [download page](https://bitcoincore.org/en/download/). ### Install Spaces Daemon diff --git a/space-daemon/configuration.md b/space-daemon/configuration.md index 495f4bb..3af0540 100644 --- a/space-daemon/configuration.md +++ b/space-daemon/configuration.md @@ -15,5 +15,5 @@ The Spaces daemon listens on the following ports by default: All these arguments can be specified as environment variables with `SPACED_` prefix and `UPPER_SNAKE_CASE` -
OptionDescriptionDefault
--chainNetwork to useNone (Required)
--bitcoin-rpc-urlBitcoin RPC URLBitcoin core default URL based on the specified chaine.g. http://127.0.0.1:8332 for mainnet
--bitcoin-rpc-cookieBitcoin RPC cookie file pathNone
--bitcoin-rpc-userBitcoin RPC userNone
--bitcoin-rpc-passwordBitcoin RPC passwordNone
--block_indexEnable block indexingfalse
--data_dirCustom data directory to store spaced stateNone
--jobsNumber of concurrent workers during sync8
--rpc_bindBind address for JSON-RPC connections127.0.0.1, ::1
--rpc_portPort for JSON-RPC connectionsNone
--configPath to a configuration fileNone
+
OptionDescriptionDefault
--bitcoin-rpc-cookieBitcoin RPC cookie file pathNone
--bitcoin-rpc-passwordBitcoin RPC passwordNone
--bitcoin-rpc-urlBitcoin RPC URLBitcoin core default URL based on the specified --chain e.g.http://127.0.0.1:8332 for mainnet
--bitcoin-rpc-userBitcoin RPC userNone
--block_indexEnable block indexingfalse
--chainNetwork to useNone (Required)
--configPath to a configuration fileNone
--data_dirCustom data directory to store spaced stateNone
--jobsNumber of concurrent workers during sync8
--rpc_bindBind address for JSON-RPC connections127.0.0.1, ::1
--rpc_portPort for JSON-RPC connectionsNone
diff --git a/space-daemon/server-api.md b/space-daemon/server-api.md index 42f86f3..d020cd4 100644 --- a/space-daemon/server-api.md +++ b/space-daemon/server-api.md @@ -19,7 +19,23 @@ The daemon implements [JSON RPC](https://www.jsonrpc.org/specification), so you **Params** None -**Response** +{% tabs %} +{% tab title="CLI" %} +``` +space-cli --chain testnet4 getserverinfo +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"getserverinfo","params":[],"id":1}' +``` +{% endtab %} +{% endtabs %} + +**Example Response** ```json "chain": "testnet4", @@ -37,6 +53,22 @@ The daemon implements [JSON RPC](https://www.jsonrpc.org/specification), so you
NameTypeDescription
spacestringCanonical space name e.g. @bitcoin
+{% tabs %} +{% tab title="CLI" %} +``` +space-cli --chain testnet4 getspace @bitcoin +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"getspace","params":["@bitcoin"],"id":1}' +``` +{% endtab %} +{% endtabs %} + **Example Response** {% tabs %} @@ -102,7 +134,23 @@ The daemon implements [JSON RPC](https://www.jsonrpc.org/specification), so you | ------- | ------ | ---------------------------------- | | `space` | string | Canonical space name e.g. @bitcoin | -**Example Response**\ +{% tabs %} +{% tab title="CLI" %} +``` +only available via JSON-RPC +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"getspaceowner","params":["@bitcoin"],"id":1}' +``` +{% endtab %} +{% endtabs %} + +**Example Response** Responds with an outpoint with `txid:vout` format. ```json @@ -118,13 +166,30 @@ b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1
NameTypeDescription
outpointstring

An Outpoint which is a specific output within a transaction using txid:vout format e.g.

b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1
 
+{% tabs %} +{% tab title="CLI" %} +``` +space-cli --chain testnet4 getspaceout "b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1" +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"getspaceout","params":["b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1"],"id":1}' +``` +{% endtab %} +{% endtabs %} + **Example Response** {% tabs %} {% tab title="Space UTXO" %} -
{ 
-  "value": 662,
-  "script_pubkey": "5120882cd5b0ef333be2efd7efd9bea0953f894677f1d5a638c8a3d13734e99d22e6",
+```json
+{ 
+  "value": 662,
+  "script_pubkey": "5120882cd5b0ef333be2efd7efd9bea0953f894677f1d5a638c8a3d13734e99d22e6",
   "name": "@bitcoin",
   "covenant": {
      "type": "transfer",
@@ -132,7 +197,7 @@ b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1
      "data": null
   }
 }
-
+``` {% endtab %} {% tab title="Other UTXOs" %} @@ -155,7 +220,23 @@ b2819258b2416314a36e8f66840ebb5682e2600a07c28a04b4e27fe0b51b46fc:1 | -------- | ------ | ------------------------ | | `target` | number | The target rollout block | -**Example Response**\ +{% tabs %} +{% tab title="CLI" %} +``` +space-cli --chain testnet4 estimatebid 14400 +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"estimatebid","params":[144],"id":1}' +``` +{% endtab %} +{% endtabs %} + +**Example Response** Responds with an amount in Satoshis ```json @@ -170,25 +251,35 @@ Responds with an amount in Satoshis
NameTypeDescription
targetnumberThe target interval e.g. specify 0 for the coming rollout, 1 for the day after and so on.
-**Example Response**\ +{% tabs %} +{% tab title="CLI" %} +``` +space-cli --chain testnet4 getrollout 0 +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"getrollout","params":[0],"id":1}' +``` +{% endtab %} +{% endtabs %} + +**Example Response** An array of spaces expected to be in auctions within the given `target` ```json [ - { - "outpoint": "1ea73982abb36cf2c62deced717fbe944c3af89abe768aa454642879b29e5adc:1", - "value": 662, - "script_pubkey": "51202a7267b047254ad41e87458b902c286434e3764ffd2f2fdb46a9c8fafa6135e3", - "name": "@btc", - "covenant": { - "type": "bid", - "burn_increment": 1000, - "signature": "........", - "total_burned": 1000, - "claim_height": null - } - } -] + [ + "@bitcoin", + 1000 + ], + [ + "@mytestspace", + 1000 + ], ``` ## Get Block Data @@ -201,6 +292,22 @@ An array of spaces expected to be in auctions within the given `target` | ------------ | ------ | ---------------------------- | | `block_hash` | string | The block hash as hex string | +{% tabs %} +{% tab title="CLI" %} +``` +space-cli --chain testnet4 getblockdata 0000000012982b6d5f621229286b880e909984df669c2afabb102ce311b13f28 +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST http://127.0.0.1:7224 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"getblockdata","params":["0000000012982b6d5f621229286b880e909984df669c2afabb102ce311b13f28"],"id":1}' +``` +{% endtab %} +{% endtabs %} + **Example Response** ```json @@ -388,3 +495,4 @@ An array of spaces expected to be in auctions within the given `target` [^1]: Checkout this outpoint here\ [https://mempool.space/testnet4/tx/1ea73982abb36cf2c62deced717fbe944c3af89abe768aa454642879b29e5adc#vout=](https://mempool.space/testnet4/tx/1ea73982abb36cf2c62deced717fbe944c3af89abe768aa454642879b29e5adc#vout=1) +