From 02157bcc5136f83c98e228805dfa32e5460749d3 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Wed, 6 Jan 2021 20:50:24 -0800 Subject: [PATCH] Rename repl to bdk-cli and update related docs --- config.toml | 2 +- content/_index.md | 6 +- content/bdk-cli/_index.md | 13 +++ content/{repl => bdk-cli}/compiler.md | 2 +- content/{repl => bdk-cli}/concept.md | 4 +- content/bdk-cli/installation.md | 92 ++++++++++++++++++ content/{repl => bdk-cli}/interface.md | 67 +++++++------ content/{repl => bdk-cli}/playground.md | 0 content/{repl => bdk-cli}/regtest.md | 6 +- content/repl/_index.md | 12 --- content/repl/installation.md | 71 -------------- playground/www/index.html | 2 +- playground/www/webpack.config.js | 2 +- .../playground/1.playground.js | 0 .../playground/2.playground.js | 0 .../25cafba91a92f4b8098c.module.wasm | Bin .../playground/playground.js | 2 +- 17 files changed, 155 insertions(+), 126 deletions(-) create mode 100644 content/bdk-cli/_index.md rename content/{repl => bdk-cli}/compiler.md (99%) rename content/{repl => bdk-cli}/concept.md (92%) create mode 100644 content/bdk-cli/installation.md rename content/{repl => bdk-cli}/interface.md (88%) rename content/{repl => bdk-cli}/playground.md (100%) rename content/{repl => bdk-cli}/regtest.md (77%) delete mode 100644 content/repl/_index.md delete mode 100644 content/repl/installation.md rename static/{repl => bdk-cli}/playground/1.playground.js (100%) rename static/{repl => bdk-cli}/playground/2.playground.js (100%) rename static/{repl => bdk-cli}/playground/25cafba91a92f4b8098c.module.wasm (100%) rename static/{repl => bdk-cli}/playground/playground.js (95%) diff --git a/config.toml b/config.toml index a670f79e16..60e9bb6ab2 100644 --- a/config.toml +++ b/config.toml @@ -58,7 +58,7 @@ weight = 5 [[Languages.en.menu.shortcuts]] name = " Playground" -url = "/repl/playground" +url = "/bdk-cli/playground" weight = 10 [[Languages.en.menu.shortcuts]] diff --git a/content/_index.md b/content/_index.md index f256540f99..90fbd26b7f 100644 --- a/content/_index.md +++ b/content/_index.md @@ -20,11 +20,11 @@ server to chat with us. ## Playground -As a way of demonstrating the flexibly of this project, a minimalistic command line tool (also called "repl") is available as a debugging tool in the main [`bdk`](https://github.com/bitcoindevkit/bdk) -repo. It has been compiled to WebAssembly and can be used directly from the browser. See the [playground](/repl/playground) section to give it a try! +As a way of demonstrating the flexibly of this project, a minimalistic command line tool (called `bdk-cli`) is available as a debugging tool in the [`bdk-cli`](https://github.com/bitcoindevkit/bdk-cli) +repo. It has been compiled to WebAssembly and can be used directly from the browser. See the [playground](/bdk-cli/playground) section to give it a try! The playground relies on [Esplora](https://blockstream.info) to monitor the blockchain and is currently locked in testnet-only mode, for obvious safety reasons. The native command line tool can also be used in regtest mode when installed on -a computer. See the [REPL](/repl) section to learn more. +a computer. See the [bdk-cli](/bdk-cli) section to learn more. ## Descriptors diff --git a/content/bdk-cli/_index.md b/content/bdk-cli/_index.md new file mode 100644 index 0000000000..92b80b0b48 --- /dev/null +++ b/content/bdk-cli/_index.md @@ -0,0 +1,13 @@ ++++ +title = "BDK CLI" +date = 2020-04-28T17:03:00+02:00 +weight = 1 +chapter = true +pre = ' ' ++++ + +# BDK-CLI + +The [bdk-cli](https://github.com/bitcoindevkit/bdk-cli) repo has an example interactive shell built +using the `bdk` library called `bdk-cli` that acts both as a reference implementation of a wallet +and a tool to quickly experiment with descriptors and transactions. diff --git a/content/repl/compiler.md b/content/bdk-cli/compiler.md similarity index 99% rename from content/repl/compiler.md rename to content/bdk-cli/compiler.md index 9b717a3893..39ebea09c2 100644 --- a/content/repl/compiler.md +++ b/content/bdk-cli/compiler.md @@ -28,7 +28,7 @@ Once the command is done, you should have a `miniscriptc` command available. You In this case the interface is very simple: it accepts two arguments called "POLICY" and "TYPE", in this order. The first one, as the name implies, sets the spending policy to compile. The latter defines the type of address that should be used to encapsulate the produced script, like a P2SH, P2WSH, etc. -Optionally, the `--parsed_policy` flag can be enabled and it will make the compiler print the JSON "human-readable" version of the spending policy, as described in the [`policies subcommand`](/repl/interface/#policies) of the CLI. +Optionally, the `--parsed_policy` flag can be enabled and it will make the compiler print the JSON "human-readable" version of the spending policy, as described in the [`policies subcommand`](/bdk-cli/interface/#policies) of the CLI. The `--network` flag can be used to change the network encoding of the address shown. diff --git a/content/repl/concept.md b/content/bdk-cli/concept.md similarity index 92% rename from content/repl/concept.md rename to content/bdk-cli/concept.md index 9c9989f961..96078eacd1 100644 --- a/content/repl/concept.md +++ b/content/bdk-cli/concept.md @@ -10,13 +10,13 @@ Now, in order to better grasp some of the design choices made by BDK, it's impor achieve. BDK is aiming first of all to be a **set of libraries and tools**, all meant to be very reusable and adaptable. Developers working on their own wallets or other projects that are trying to integrate -Bitcoin can pick the tools they need and piece them together to prototype and quickly ship a working product. This means that the REPL that we've just installed is designed to be a **very thin layer** over the +Bitcoin can pick the tools they need and piece them together to prototype and quickly ship a working product. This means that the `bdk-cli` that we've just installed is designed to be a **very thin layer** over the APIs exposed by the various components of the library, **not a full, end-user-ready Bitcoin wallet**. This concept leads to a few design choices that are arguably very bad for the "UX" of this wallet, but that allow developers to work more directly with the underlying library. For instance: * BDK has an internal database that's used to store data about received transactions, spendable UTXOs, etc. This database is stored by default in your home folder, in `~/.bdk-bitcoin`. The database - **will never** contain any data that can't be recreated purely by looking at the blockchain. Keys, descriptors, Electrum endpoints **are not stored in there**. This explains why you'll have to specify them every + **will never** contain any data that can't be recreated purely by looking at the blockchain. Keys, descriptors, Electrum endpoints **are not stored in the database**. This explains why you'll have to specify them every time in the command line. It can be seen more like a *cache* and can be safely deleted without risking funds. * BDK doesn't automatically "monitor" the blockchain, instead there's a `sync` command that has to be called by the user. * When you create a transaction and then sign it, it's not automatically broadcast to the network. There's a `broadcast` command that does this. Moreover, the command doesn't accept a normal Bitcoin raw transaction, diff --git a/content/bdk-cli/installation.md b/content/bdk-cli/installation.md new file mode 100644 index 0000000000..4fa8b00c97 --- /dev/null +++ b/content/bdk-cli/installation.md @@ -0,0 +1,92 @@ +--- +title: "Installation" +date: 2020-04-28T17:11:29+02:00 +draft: false +weight: 1 +pre: "1. " +--- + +## Requirements + +The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust +toolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to +install the Rust compiler and Cargo is [rustup.rs](https://rustup.rs/). You can head there and +follow their instructions, after which you can test if everything went fine by running +`cargo version`, which should print something like: + +``` +cargo 1.45.0 (744bd1fbb 2020-06-15) +``` + +If you really don't want to pipe the output of `curl` into `sh`, you can also try using a +[Docker image](https://hub.docker.com/_/rust) and working inside of it, but that's meant for more +advanced users and won't be covered in this guide. + +{{% notice note %}} +At the time of writing, the project requires cargo >= 1.45.0, which is the latest stable as of +June 2020. If you have an older version installed with rustup.rs, you can upgrade it with +`rustup update`. +{{% /notice %}} + +## Installing the `bdk-cli` tool + +Once Cargo is installed, you can proceed to install the interactive `bdk-cli` tool directly from +the GitHub repository, by running: + +```bash +cargo install --git https://github.com/bitcoindevkit/bdk-cli --features=esplora +``` + +This command may take a while to finish, since it will fetch and compile all the +dependencies and the `bdk` library itself. Once it's done, you can check if everything went fine by +running `bdk-cli --help` which should print something like this: + +```text +BDK CLI 0.1.0 +Alekos Filini :Riccardo Casatta +A modern, lightweight, descriptor-based wallet + +USAGE: + bdk-cli [OPTIONS] --descriptor + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +OPTIONS: + -c, --change_descriptor Sets the descriptor to use for internal addresses + -d, --descriptor Sets the descriptor to use for the external addresses + --esplora_concurrency Concurrency of requests made to the esplora server [default: 4] + -e, --esplora Use the esplora server if given as parameter + -n, --network Sets the network [default: testnet] + -p, --proxy Sets the SOCKS5 proxy for the Electrum client + -s, --server + Sets the Electrum server to use [default: ssl://electrum.blockstream.info:60002] + + -w, --wallet Selects the wallet to use [default: main] + +SUBCOMMANDS: + broadcast Broadcasts a transaction to the network. Takes either a raw transaction or a PSBT to + extract + bump_fee Bumps the fees of an RBF transaction + combine_psbt Combines multiple PSBTs into one + create_tx Creates a new unsigned transaction + extract_psbt Extracts a raw transaction from a PSBT + finalize_psbt Finalizes a PSBT + get_balance Returns the current wallet balance + get_new_address Generates a new external address + help Prints this message or the help of the given subcommand(s) + list_transactions Lists all the incoming and outgoing transactions of the wallet + list_unspent Lists the available spendable UTXOs + policies Returns the available spending policies for the descriptor + public_descriptor Returns the public version of the wallet's descriptor(s) + repl Enter REPL command loop mode + sign Signs and tries to finalize a PSBT + sync Syncs with the chosen blockchain server +``` + +An example command to sync a testnet wallet looks like this: + +``` +bdk-cli --descriptor "wpkh(tprv8ZgxMBicQKsPexGYyaFwnAsCXCjmz2FaTm6LtesyyihjbQE3gRMfXqQBXKM43DvC1UgRVv1qom1qFxNMSqVAs88qx9PhgFnfGVUdiiDf6j4/0/*)" --network testnet --server ssl://electrum.blockstream.info:60002 sync +``` \ No newline at end of file diff --git a/content/repl/interface.md b/content/bdk-cli/interface.md similarity index 88% rename from content/repl/interface.md rename to content/bdk-cli/interface.md index 0de6b502df..83f966610d 100644 --- a/content/repl/interface.md +++ b/content/bdk-cli/interface.md @@ -6,23 +6,22 @@ weight: 3 pre: "3. " --- -Remember the `repl --help` command you ran before? Let's analyze its output here to figure out the interface: +Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface: ## Flags ```text FLAGS: -h, --help Prints help information - -v Sets the level of verbosity -V, --version Prints version information ``` -These are the optional flags that can be set with every command. The `-h` flag prints the help message, the `-V` flag only prints the version and the `-v` is actually ignored at the moment. +These are the optional flags that can be set with every command. The `-h` flag prints the help message, the `-V` flag only prints the version. ### Verbosity -If you want to increase the verbosity of the output, you should use the `RUST_LOG` environment variable. You can set it like so to see a lot more of what's going on behind the scenes, before running the `repl` -command. You only have to do this once when you open a new shell, after that you can run the `repl` command multiple times. +If you want to increase the verbosity of the output, you should use the `RUST_LOG` environment variable. You can set it like so to see a lot more of what's going on behind the scenes, before running the `bdk-cli` +command. You only have to do this once when you open a new shell, after that you can run the `bdk-cli` command multiple times. ```bash export RUST_LOG="bdk=debug" @@ -32,14 +31,16 @@ export RUST_LOG="bdk=debug" ```text OPTIONS: - -c, --change_descriptor Sets the descriptor to use for internal addresses - -d, --descriptor Sets the descriptor to use for the external addresses - -e, --esplora Use the esplora server if given as parameter - -n, --network Sets the network [default: testnet] [possible values: testnet, regtest] - -s, --server Sets the Electrum server to use [default: - ssl://electrum.blockstream.info:60002] - -w, --wallet Selects the wallet to use [default: main] - -p, --proxy Sets the SOCKS5 proxy for the Electrum client + -c, --change_descriptor Sets the descriptor to use for internal addresses + -d, --descriptor Sets the descriptor to use for the external addresses + --esplora_concurrency Concurrency of requests made to the esplora server [default: 4] + -e, --esplora Use the esplora server if given as parameter + -n, --network Sets the network [default: testnet] + -p, --proxy Sets the SOCKS5 proxy for the Electrum client + -s, --server + Sets the Electrum server to use [default: ssl://electrum.blockstream.info:60002] + + -w, --wallet Selects the wallet to use [default: main] ``` These are the global options that can be set. They are pretty much like the flags, but they also take a value. The only **required** one is the `--descriptor` or `-d` flag, since every wallet **must have an @@ -60,10 +61,10 @@ The `--esplora` flag can be used to connect to an Esplora instance instead of us and `https://blockstream.info/testnet/api` for testnet. The `--proxy` flag can be optionally used to specify a SOCKS5 proxy to use when connecting to the Electrum server. Spawning a local Tor daemon and using it as a proxy will allow you to connect to `.onion` Electrum -URLs. **Keep in mind that only plaintext server are supported over a proxy** +URLs. **Keep in mind that only plaintext server are supported over a proxy.** The `--wallet` flag can be used to select which wallet to use, if you have more than one of them. If you get a `ChecksumMismatch` error when you make some changes to your descriptor, it's because it does not -match anymore the one you've used to initialize the cache. One solution could be to switch to a new wallet name, or delete the cache directory at `~/.bdk` and start from scratch. +match anymore the one you've used to initialize the cache. One solution could be to switch to a new wallet name, or delete the cache directory at `~/.bdk-bitcoin` and start from scratch. ## Subcommands @@ -85,7 +86,7 @@ match anymore the one you've used to initialize the cache. One solution could be | [sign](#sign) | Signs and tries to finalize a PSBT | | [sync](#sync) | Syncs with the chosen Electrum server | -These are the main "functions" of the wallet. Most of them are pretty self explanatory, but we'll go over them quickly anyways. You can get more details about every single command by running `repl --help`. +These are the main "functions" of the wallet. Most of them are pretty self explanatory, but we'll go over them quickly anyways. You can get more details about every single command by running `bdk-cli --help`. ### broadcast @@ -129,29 +130,35 @@ Combines multiple PSBTs by merging metadata and partial signatures. It can be us ```text FLAGS: - -a, --send_all Sends all the funds (or all the selected utxos). Requires only one addressees of value 0 - -r, --enable_rbf Enables Replace-By-Fee (BIP125) + -r, --enable_rbf Enables Replace-By-Fee (BIP125) + --offline_signer Make a PSBT that can be signed by offline signers and hardware wallets. Forces the addition + of `non_witness_utxo` and more details to let the signer identify the change output + -a, --send_all Sends all the funds (or all the selected utxos). Requires only one recipients of value 0 OPTIONS: - --external_policy Selects which policy should be used to satisfy the external descriptor - -f, --fee_rate Fee rate to use in sat/vbyte - --internal_policy Selects which policy should be used to satisfy the internal descriptor - --to ... Adds an addressee to the transaction - --unspendable ... Marks an utxo as unspendable - --utxos ... Selects which utxos *must* be spent + --to ... Adds a recipient to the transaction + --unspendable ... Marks a utxo as unspendable + --external_policy + Selects which policy should be used to satisfy the external descriptor + + --internal_policy + Selects which policy should be used to satisfy the internal descriptor + + --utxos ... Selects which utxos *must* be spent + -f, --fee_rate Fee rate to use in sat/vbyte ``` Creates a new unsigned PSBT. The flags allow to set a custom fee rate (the default is 1.0 sat/vbyte) with `--fee_rate` or `-f`, the list of UTXOs that should be considered unspendable with `--unspendable` (this option can be specified multiple times) and a list of UTXOs that must be spent with `--utxos` (again, this option can also be specified multiple times). -The `--to` option sets the receiver address of the transaction, and should contain the address and amount in Satoshi separated by a colon, like: `--to --to 2NErbQPsooXRatRJdrXDm9wKR2fRiZDT9wL:50000`. This option +The `--to` option sets the receiver address of the transaction, and should contain the address and amount in Satoshi separated by a colon, like: `--to 2NErbQPsooXRatRJdrXDm9wKR2fRiZDT9wL:50000`. This option can also be specified multiple times to send to multiple addresses at once. The `--send_all` flag can be used to send the value of all the spendable UTXOs to a single address, without creating a change output. If this flag is set, there must be only one `--to` address, and its value will be ignored (it can be set to 0). The `--external_policy` and `--internal_policy` options are two advanced flags that can be used to select the spending policy that the sender intends to satisfy in this transaction. They are normally not required if there's no ambiguity, but sometimes -with complex descriptor one or both of them have to be specified, or you'll get a `SpendingPolicyRequired` error. Those flags should be set to a JSON object that maps a policy node id to the list of child indexes that +with a complex descriptor one or both of them have to be specified, or you'll get a `SpendingPolicyRequired` error. Those flags should be set to a JSON object that maps a policy node id to the list of child indexes that the user intends to satisfy for that node. This is probably better explained with an example: Let's assume our descriptor is: `sh(thresh(2,pk(A),sj:and_v(v:pk(B),n:older(6)),snj:and_v(v:pk(C),after(630000))))`. There are three conditions and we need to satisfy two of them to be able to spend. The conditions are: @@ -206,8 +213,8 @@ Extracts the global transaction from a PSBT. **Note that partial signatures are ```text OPTIONS: - --assume_height Assume the blockchain has reached a specific height --psbt Sets the PSBT to finalize + --assume_height Assume the blockchain has reached a specific height ``` Tries to finalize a PSBT by merging all the partial signatures and other elements back into the global transaction. This command fails if there are timelocks that have not yet expired, but the check can be overridden @@ -507,9 +514,9 @@ This subcommand has no extra flags and launches an interactive shell session. ```text OPTIONS: - --assume_height Assume the blockchain has reached a specific height. This affects the transaction - finalization, if there are timelocks in the descriptor - --psbt Sets the PSBT to sign + --psbt Sets the PSBT to sign + --assume_height Assume the blockchain has reached a specific height. This affects the transaction + finalization, if there are timelocks in the descriptor ``` Adds to the PSBT all the signatures it can produce with the secrets embedded in the descriptor (xprv or WIF keys). Returns the signed PSBT and, if there are enough item to satisfy the script, also the extracted raw diff --git a/content/repl/playground.md b/content/bdk-cli/playground.md similarity index 100% rename from content/repl/playground.md rename to content/bdk-cli/playground.md diff --git a/content/repl/regtest.md b/content/bdk-cli/regtest.md similarity index 77% rename from content/repl/regtest.md rename to content/bdk-cli/regtest.md index b626c9d043..c7ef600a4b 100644 --- a/content/repl/regtest.md +++ b/content/bdk-cli/regtest.md @@ -6,7 +6,7 @@ weight: 4 pre: "4. " --- -Running the REPL in regtest requires having a local Electrum server set-up. There are two main implementations, [`electrs`](https://github.com/romanz/electrs) in Rust and [`ElectrumX`](https://github.com/spesmilo/electrumx) in Python. Since the Rust toolchain is already required to +Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, [`electrs`](https://github.com/romanz/electrs) in Rust and [`ElectrumX`](https://github.com/spesmilo/electrumx) in Python. Since the Rust toolchain is already required to use BDK, this page will focus mostly on the former. Electrs can be installed by running: @@ -25,7 +25,7 @@ electrs -vv --timestamp --db-dir /tmp/electrs-db --electrum-rpc-addr="127.0.0.1: on macOS you should change the cookie-file to `$HOME/Library/Application Support/Bitcoin/regtest/.cookie`. -This will start the Electrum server on port 50001. You can then add the `-n regtest -s localhost:50001` the `repl` commands to switch to the local regtest. +This will start the Electrum server on port 50001. You can then add the `-n regtest -s localhost:50001` to the `bdk-cli` commands to switch to the local regtest. ## Troubleshooting @@ -49,4 +49,4 @@ $ nigiri start This will start electrum RPC interface on port `51401`, the REST interface on `3000` and the esplora UI on `5000` (You can visit with the browser and look for blocks, addresses and transactions) -You can then add the `-n regtest -s localhost:51401` to the `repl` commands to switch to the local regtest. +You can then add the `-n regtest -s localhost:51401` to the `bdk-cli` commands to switch to the local regtest. diff --git a/content/repl/_index.md b/content/repl/_index.md deleted file mode 100644 index fd9d9c762d..0000000000 --- a/content/repl/_index.md +++ /dev/null @@ -1,12 +0,0 @@ -+++ -title = "REPL" -date = 2020-04-28T17:03:00+02:00 -weight = 5 -chapter = true -pre = ' ' -+++ - -# REPL - -The [bdk](https://github.com/bitcoindevkit/bdk) repo has a very minimalistic interactive shell called `repl` that acts both as a reference implementation of a wallet and a tool to -quickly experiment with descriptors and transactions. diff --git a/content/repl/installation.md b/content/repl/installation.md deleted file mode 100644 index 9d0130cec1..0000000000 --- a/content/repl/installation.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "Installation" -date: 2020-04-28T17:11:29+02:00 -draft: false -weight: 1 -pre: "1. " ---- - -## Requirements - -The only requirement is a Linux/macOS system with a fairly recent Rust toolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to install the Rust compiler and Cargo is -[rustup.rs](https://rustup.rs/). You can head there and follow their instructions, after which you can test if everything went fine by running `cargo version`, which should print something like: - -``` -cargo 1.45.0 (744bd1fbb 2020-06-15) -``` - -**At the time of writing, the project requires cargo >= 1.45.0, which is the latest stable as of June 2020. If you have an older version installed with rustup.rs, you can upgrade it with `rustup update`.** - -If you really don't want to pipe the output of `curl` into `sh`, you can also try using a [Docker image](https://hub.docker.com/_/rust) and working inside of it, but that's meant for more advanced -users and won't be covered in this guide. - -## Installing BDK `repl` - -Once Cargo is installed, you can proceed to install the interactive BDK `repl` tool directly from the GitHub repository, by running: - -```bash -cargo install --git https://github.com/bitcoindevkit/bdk --features=cli-utils,esplora --example repl -``` - -This command will probably take a while to finish, since it will fetch and compile all the dependencies and the `bdk` library itself. Once it's done, you can check if everything went fine -by running `repl --help` which should print something like this: - -```text -Magical Bitcoin Wallet 0.1.0 -Riccardo Casatta :Alekos Filini -A modern, lightweight, descriptor-based wallet - -USAGE: - repl [FLAGS] [OPTIONS] --descriptor [SUBCOMMAND] - -FLAGS: - -h, --help Prints help information - -v Sets the level of verbosity - -V, --version Prints version information - -OPTIONS: - -c, --change_descriptor Sets the descriptor to use for internal addresses - -d, --descriptor Sets the descriptor to use for the external addresses - -n, --network Sets the network [default: testnet] [possible values: testnet, regtest] - -s, --server Sets the Electrum server to use [default: tn.not.fyi:55001] - -w, --wallet Selects the wallet to use [default: main] - -SUBCOMMANDS: - broadcast Extracts the finalized transaction from a PSBT and broadcasts it to the network - create_tx Creates a new unsigned tranasaction - get_balance Returns the current wallet balance - get_new_address Generates a new external address - help Prints this message or the help of the given subcommand(s) - list_unspent Lists the available spendable UTXOs - policies Returns the available spending policies for the descriptor - repl Opens an interactive shell - sign Signs and tries to finalize a PSBT - sync Syncs with the chosen Electrum server -``` - -An example command to sync a testnet wallet looks like this: - -``` -repl --descriptor "wpkh(tprv8ZgxMBicQKsPexGYyaFwnAsCXCjmz2FaTm6LtesyyihjbQE3gRMfXqQBXKM43DvC1UgRVv1qom1qFxNMSqVAs88qx9PhgFnfGVUdiiDf6j4/0/*)" --network testnet --server tcp://testnet.aranguren.org:51001 sync -``` diff --git a/playground/www/index.html b/playground/www/index.html index 20a22dc8bc..6f032210de 100644 --- a/playground/www/index.html +++ b/playground/www/index.html @@ -3,4 +3,4 @@ - + diff --git a/playground/www/webpack.config.js b/playground/www/webpack.config.js index a84f692a35..26a6652bee 100644 --- a/playground/www/webpack.config.js +++ b/playground/www/webpack.config.js @@ -4,7 +4,7 @@ module.exports = { entry: "./src/bootstrap.js", output: { path: path.resolve(__dirname, "dist"), - publicPath: "/repl/playground/", + publicPath: "/bdk-cli/playground/", filename: "playground.js", } }; diff --git a/static/repl/playground/1.playground.js b/static/bdk-cli/playground/1.playground.js similarity index 100% rename from static/repl/playground/1.playground.js rename to static/bdk-cli/playground/1.playground.js diff --git a/static/repl/playground/2.playground.js b/static/bdk-cli/playground/2.playground.js similarity index 100% rename from static/repl/playground/2.playground.js rename to static/bdk-cli/playground/2.playground.js diff --git a/static/repl/playground/25cafba91a92f4b8098c.module.wasm b/static/bdk-cli/playground/25cafba91a92f4b8098c.module.wasm similarity index 100% rename from static/repl/playground/25cafba91a92f4b8098c.module.wasm rename to static/bdk-cli/playground/25cafba91a92f4b8098c.module.wasm diff --git a/static/repl/playground/playground.js b/static/bdk-cli/playground/playground.js similarity index 95% rename from static/repl/playground/playground.js rename to static/bdk-cli/playground/playground.js index 5c4764d9b5..ab260a4b2b 100644 --- a/static/repl/playground/playground.js +++ b/static/bdk-cli/playground/playground.js @@ -1 +1 @@ -!function(e){function n(n){for(var t,o,_=n[0],u=n[1],c=0,f=[];c<_.length;c++)o=_[c],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&f.push(r[o][0]),r[o]=0;for(t in u)Object.prototype.hasOwnProperty.call(u,t)&&(e[t]=u[t]);for(b&&b(n);f.length;)f.shift()()}var t={},r={0:0};var o={};var _={12:function(){return{"./bdk_playground_bg.js":{__wbindgen_object_drop_ref:function(e){return t[2].exports.jb(e)},__wbg_walletwrapper_new:function(e){return t[2].exports.Y(e)},__wbindgen_string_new:function(e,n){return t[2].exports.lb(e,n)},__wbg_new_59cb74e423758ede:function(){return t[2].exports.A()},__wbg_stack_558ba5917b466edd:function(e,n){return t[2].exports.Q(e,n)},__wbg_error_4bb6c2a97407129a:function(e,n){return t[2].exports.l(e,n)},__wbindgen_json_serialize:function(e,n){return t[2].exports.gb(e,n)},__wbg_self_1c83eb4471d9eb9b:function(){return t[2].exports.N()},__wbg_require_5b2b5b594d809d9f:function(e,n,r){return t[2].exports.L(e,n,r)},__wbg_crypto_c12f14e810edcaa2:function(e){return t[2].exports.i(e)},__wbg_msCrypto_679be765111ba775:function(e){return t[2].exports.x(e)},__wbindgen_is_undefined:function(e){return t[2].exports.fb(e)},__wbg_getRandomValues_05a60bf171bfc2be:function(e){return t[2].exports.o(e)},__wbg_getRandomValues_3ac1b33c90b52596:function(e,n,r){return t[2].exports.p(e,n,r)},__wbg_randomFillSync_6f956029658662ec:function(e,n,r){return t[2].exports.K(e,n,r)},__wbg_static_accessor_MODULE_abf5ae284bffdf45:function(){return t[2].exports.R()},__wbg_fetch_f5b2195afedb6a6b:function(e){return t[2].exports.n(e)},__wbindgen_object_clone_ref:function(e){return t[2].exports.ib(e)},__wbg_debug_b443de592faba09f:function(e){return t[2].exports.j(e)},__wbg_error_7f083efc6bc6752c:function(e){return t[2].exports.m(e)},__wbg_info_6d4a86f0fd590270:function(e){return t[2].exports.s(e)},__wbg_log_3bafd82835c6de6d:function(e){return t[2].exports.w(e)},__wbg_warn_d05e82888b7fad05:function(e){return t[2].exports.Z(e)},__wbg_newwithu8arraysequenceandoptions_ae6479c676bebdcf:function(e,n){return t[2].exports.G(e,n)},__wbg_instanceof_Response_328c03967a8e8902:function(e){return t[2].exports.t(e)},__wbg_url_67bbdafba8ff6e85:function(e,n){return t[2].exports.W(e,n)},__wbg_status_eb6dbb31556c329f:function(e){return t[2].exports.S(e)},__wbg_headers_c736e1fe38752cff:function(e){return t[2].exports.r(e)},__wbg_arrayBuffer_dc33ab7b8cdf0d63:function(e){return t[2].exports.e(e)},__wbg_text_966d07536ca6ccdc:function(e){return t[2].exports.T(e)},__wbg_newwithstrandinit_d1de1bfcd175e38a:function(e,n,r){return t[2].exports.F(e,n,r)},__wbg_new_43d9cb1835f877ad:function(){return t[2].exports.z()},__wbg_append_f76809690e4b2f3a:function(e,n,r,o){return t[2].exports.d(e,n,r,o)},__wbg_append_eaa42b75460769af:function(e,n,r,o,_,u){return t[2].exports.c(e,n,r,o,_,u)},__wbg_new_8469604d5504c189:function(){return t[2].exports.B()},__wbg_append_cc6fe0273163a31b:function(e,n,r,o,_){return t[2].exports.b(e,n,r,o,_)},__wbindgen_cb_drop:function(e){return t[2].exports.ab(e)},__wbindgen_is_function:function(e){return t[2].exports.db(e)},__wbindgen_is_object:function(e){return t[2].exports.eb(e)},__wbg_next_edda7e0003e5daf9:function(e){return t[2].exports.I(e)},__wbg_done_037d0a173aef1834:function(e){return t[2].exports.k(e)},__wbg_value_e60bbfb7d52af62f:function(e){return t[2].exports.X(e)},__wbg_iterator_09191f8878ea9877:function(){return t[2].exports.u()},__wbg_call_8e95613cc6524977:function(e,n){return t[2].exports.g(e,n)},__wbg_call_d713ea0274dfc6d2:function(e,n,r){return t[2].exports.h(e,n,r)},__wbg_next_2966fa909601a075:function(e){return t[2].exports.H(e)},__wbg_now_4de5b53a19e45567:function(){return t[2].exports.J()},__wbg_new_3e06d4f36713e4cb:function(){return t[2].exports.y()},__wbg_new_d0c63652ab4d825c:function(e,n){return t[2].exports.D(e,n)},__wbg_resolve_2529512c3bb73938:function(e){return t[2].exports.M(e)},__wbg_then_4a7a614abbbe6d81:function(e,n){return t[2].exports.V(e,n)},__wbg_then_3b7ac098cfda2fa5:function(e,n,r){return t[2].exports.U(e,n,r)},__wbg_buffer_49131c283a06686f:function(e){return t[2].exports.f(e)},__wbg_newwithbyteoffsetandlength_c0f38401daad5a22:function(e,n,r){return t[2].exports.E(e,n,r)},__wbg_new_9b295d24cf1d706f:function(e){return t[2].exports.C(e)},__wbg_set_3bb960a9975f3cd2:function(e,n,r){return t[2].exports.P(e,n,r)},__wbg_length_2b13641a9d906653:function(e){return t[2].exports.v(e)},__wbg_get_0e3f2950cdf758ae:function(e,n){return t[2].exports.q(e,n)},__wbg_set_304f2ec1a3ab3b79:function(e,n,r){return t[2].exports.O(e,n,r)},__wbindgen_string_get:function(e,n){return t[2].exports.kb(e,n)},__wbindgen_debug_string:function(e,n){return t[2].exports.cb(e,n)},__wbindgen_throw:function(e,n){return t[2].exports.mb(e,n)},__wbindgen_memory:function(){return t[2].exports.hb()},__wbindgen_closure_wrapper7033:function(e,n,r){return t[2].exports.bb(e,n,r)}}}}};function u(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var n=[],t=r[e];if(0!==t)if(t)n.push(t[2]);else{var c=new Promise((function(n,o){t=r[e]=[n,o]}));n.push(t[2]=c);var f,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+""+e+".playground.js"}(e);var b=new Error;f=function(n){i.onerror=i.onload=null,clearTimeout(a);var t=r[e];if(0!==t){if(t){var o=n&&("load"===n.type?"missing":n.type),_=n&&n.target&&n.target.src;b.message="Loading chunk "+e+" failed.\n("+o+": "+_+")",b.name="ChunkLoadError",b.type=o,b.request=_,t[1](b)}r[e]=void 0}};var a=setTimeout((function(){f({type:"timeout",target:i})}),12e4);i.onerror=i.onload=f,document.head.appendChild(i)}return({2:[12]}[e]||[]).forEach((function(e){var t=o[e];if(t)n.push(t);else{var r,c=_[e](),f=fetch(u.p+""+{12:"25cafba91a92f4b8098c"}[e]+".module.wasm");if(c instanceof Promise&&"function"==typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(f),c]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"==typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(f,c);else{r=f.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,c)}))}n.push(o[e]=r.then((function(n){return u.w[e]=(n.instance||n).exports})))}})),Promise.all(n)},u.m=e,u.c=t,u.d=function(e,n,t){u.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,n){if(1&n&&(e=u(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)u.d(t,r,function(n){return e[n]}.bind(null,r));return t},u.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(n,"a",n),n},u.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},u.p="/repl/playground/",u.oe=function(e){throw console.error(e),e},u.w={};var c=window.webpackJsonp=window.webpackJsonp||[],f=c.push.bind(c);c.push=n,c=c.slice();for(var i=0;iconsole.error("Error importing `index.js`:",e))}]); \ No newline at end of file +!function(e){function n(n){for(var t,o,_=n[0],u=n[1],c=0,f=[];c<_.length;c++)o=_[c],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&f.push(r[o][0]),r[o]=0;for(t in u)Object.prototype.hasOwnProperty.call(u,t)&&(e[t]=u[t]);for(b&&b(n);f.length;)f.shift()()}var t={},r={0:0};var o={};var _={12:function(){return{"./bdk_playground_bg.js":{__wbindgen_object_drop_ref:function(e){return t[2].exports.jb(e)},__wbg_walletwrapper_new:function(e){return t[2].exports.Y(e)},__wbindgen_string_new:function(e,n){return t[2].exports.lb(e,n)},__wbg_new_59cb74e423758ede:function(){return t[2].exports.A()},__wbg_stack_558ba5917b466edd:function(e,n){return t[2].exports.Q(e,n)},__wbg_error_4bb6c2a97407129a:function(e,n){return t[2].exports.l(e,n)},__wbindgen_json_serialize:function(e,n){return t[2].exports.gb(e,n)},__wbg_self_1c83eb4471d9eb9b:function(){return t[2].exports.N()},__wbg_require_5b2b5b594d809d9f:function(e,n,r){return t[2].exports.L(e,n,r)},__wbg_crypto_c12f14e810edcaa2:function(e){return t[2].exports.i(e)},__wbg_msCrypto_679be765111ba775:function(e){return t[2].exports.x(e)},__wbindgen_is_undefined:function(e){return t[2].exports.fb(e)},__wbg_getRandomValues_05a60bf171bfc2be:function(e){return t[2].exports.o(e)},__wbg_getRandomValues_3ac1b33c90b52596:function(e,n,r){return t[2].exports.p(e,n,r)},__wbg_randomFillSync_6f956029658662ec:function(e,n,r){return t[2].exports.K(e,n,r)},__wbg_static_accessor_MODULE_abf5ae284bffdf45:function(){return t[2].exports.R()},__wbg_fetch_f5b2195afedb6a6b:function(e){return t[2].exports.n(e)},__wbindgen_object_clone_ref:function(e){return t[2].exports.ib(e)},__wbg_debug_b443de592faba09f:function(e){return t[2].exports.j(e)},__wbg_error_7f083efc6bc6752c:function(e){return t[2].exports.m(e)},__wbg_info_6d4a86f0fd590270:function(e){return t[2].exports.s(e)},__wbg_log_3bafd82835c6de6d:function(e){return t[2].exports.w(e)},__wbg_warn_d05e82888b7fad05:function(e){return t[2].exports.Z(e)},__wbg_newwithu8arraysequenceandoptions_ae6479c676bebdcf:function(e,n){return t[2].exports.G(e,n)},__wbg_instanceof_Response_328c03967a8e8902:function(e){return t[2].exports.t(e)},__wbg_url_67bbdafba8ff6e85:function(e,n){return t[2].exports.W(e,n)},__wbg_status_eb6dbb31556c329f:function(e){return t[2].exports.S(e)},__wbg_headers_c736e1fe38752cff:function(e){return t[2].exports.r(e)},__wbg_arrayBuffer_dc33ab7b8cdf0d63:function(e){return t[2].exports.e(e)},__wbg_text_966d07536ca6ccdc:function(e){return t[2].exports.T(e)},__wbg_newwithstrandinit_d1de1bfcd175e38a:function(e,n,r){return t[2].exports.F(e,n,r)},__wbg_new_43d9cb1835f877ad:function(){return t[2].exports.z()},__wbg_append_f76809690e4b2f3a:function(e,n,r,o){return t[2].exports.d(e,n,r,o)},__wbg_append_eaa42b75460769af:function(e,n,r,o,_,u){return t[2].exports.c(e,n,r,o,_,u)},__wbg_new_8469604d5504c189:function(){return t[2].exports.B()},__wbg_append_cc6fe0273163a31b:function(e,n,r,o,_){return t[2].exports.b(e,n,r,o,_)},__wbindgen_cb_drop:function(e){return t[2].exports.ab(e)},__wbindgen_is_function:function(e){return t[2].exports.db(e)},__wbindgen_is_object:function(e){return t[2].exports.eb(e)},__wbg_next_edda7e0003e5daf9:function(e){return t[2].exports.I(e)},__wbg_done_037d0a173aef1834:function(e){return t[2].exports.k(e)},__wbg_value_e60bbfb7d52af62f:function(e){return t[2].exports.X(e)},__wbg_iterator_09191f8878ea9877:function(){return t[2].exports.u()},__wbg_call_8e95613cc6524977:function(e,n){return t[2].exports.g(e,n)},__wbg_call_d713ea0274dfc6d2:function(e,n,r){return t[2].exports.h(e,n,r)},__wbg_next_2966fa909601a075:function(e){return t[2].exports.H(e)},__wbg_now_4de5b53a19e45567:function(){return t[2].exports.J()},__wbg_new_3e06d4f36713e4cb:function(){return t[2].exports.y()},__wbg_new_d0c63652ab4d825c:function(e,n){return t[2].exports.D(e,n)},__wbg_resolve_2529512c3bb73938:function(e){return t[2].exports.M(e)},__wbg_then_4a7a614abbbe6d81:function(e,n){return t[2].exports.V(e,n)},__wbg_then_3b7ac098cfda2fa5:function(e,n,r){return t[2].exports.U(e,n,r)},__wbg_buffer_49131c283a06686f:function(e){return t[2].exports.f(e)},__wbg_newwithbyteoffsetandlength_c0f38401daad5a22:function(e,n,r){return t[2].exports.E(e,n,r)},__wbg_new_9b295d24cf1d706f:function(e){return t[2].exports.C(e)},__wbg_set_3bb960a9975f3cd2:function(e,n,r){return t[2].exports.P(e,n,r)},__wbg_length_2b13641a9d906653:function(e){return t[2].exports.v(e)},__wbg_get_0e3f2950cdf758ae:function(e,n){return t[2].exports.q(e,n)},__wbg_set_304f2ec1a3ab3b79:function(e,n,r){return t[2].exports.O(e,n,r)},__wbindgen_string_get:function(e,n){return t[2].exports.kb(e,n)},__wbindgen_debug_string:function(e,n){return t[2].exports.cb(e,n)},__wbindgen_throw:function(e,n){return t[2].exports.mb(e,n)},__wbindgen_memory:function(){return t[2].exports.hb()},__wbindgen_closure_wrapper7033:function(e,n,r){return t[2].exports.bb(e,n,r)}}}}};function u(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var n=[],t=r[e];if(0!==t)if(t)n.push(t[2]);else{var c=new Promise((function(n,o){t=r[e]=[n,o]}));n.push(t[2]=c);var f,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+""+e+".playground.js"}(e);var b=new Error;f=function(n){i.onerror=i.onload=null,clearTimeout(a);var t=r[e];if(0!==t){if(t){var o=n&&("load"===n.type?"missing":n.type),_=n&&n.target&&n.target.src;b.message="Loading chunk "+e+" failed.\n("+o+": "+_+")",b.name="ChunkLoadError",b.type=o,b.request=_,t[1](b)}r[e]=void 0}};var a=setTimeout((function(){f({type:"timeout",target:i})}),12e4);i.onerror=i.onload=f,document.head.appendChild(i)}return({2:[12]}[e]||[]).forEach((function(e){var t=o[e];if(t)n.push(t);else{var r,c=_[e](),f=fetch(u.p+""+{12:"25cafba91a92f4b8098c"}[e]+".module.wasm");if(c instanceof Promise&&"function"==typeof WebAssembly.compileStreaming)r=Promise.all([WebAssembly.compileStreaming(f),c]).then((function(e){return WebAssembly.instantiate(e[0],e[1])}));else if("function"==typeof WebAssembly.instantiateStreaming)r=WebAssembly.instantiateStreaming(f,c);else{r=f.then((function(e){return e.arrayBuffer()})).then((function(e){return WebAssembly.instantiate(e,c)}))}n.push(o[e]=r.then((function(n){return u.w[e]=(n.instance||n).exports})))}})),Promise.all(n)},u.m=e,u.c=t,u.d=function(e,n,t){u.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,n){if(1&n&&(e=u(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)u.d(t,r,function(n){return e[n]}.bind(null,r));return t},u.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(n,"a",n),n},u.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},u.p="/bdk-cli/playground/",u.oe=function(e){throw console.error(e),e},u.w={};var c=window.webpackJsonp=window.webpackJsonp||[],f=c.push.bind(c);c.push=n,c=c.slice();for(var i=0;iconsole.error("Error importing `index.js`:",e))}]); \ No newline at end of file -- 2.49.0