File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -51,3 +51,7 @@ UTXO Set Tools
51
51
This script converts a compact-serialized UTXO set (as generated by Bitcoin Core with ` dumptxoutset ` )
52
52
to a SQLite3 database. For more details like e.g. the created table name and schema, refer to the
53
53
module docstring on top of the script, which is also contained in the command's ` --help ` output.
54
+
55
+ ### [ Dump-to-SQLite] ( /contrib/utxo-tools/dump_to_sqlite.sh ) ###
56
+ This script creates an UTXO set dump in SQLite3 format on the fly from a running bitcoind instance,
57
+ i.e. with the intermediate step of storing the compact-serialized UTXO set on disk is skipped.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Copyright (c) 2024-present The Bitcoin Core developers
3
+ # Distributed under the MIT software license, see the accompanying
4
+ # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
+
6
+ export LC_ALL=C
7
+ set -e
8
+
9
+ if [ $# -ne 2 ]; then
10
+ echo " Usage: $0 <bitcoin-cli-path> <output-file>"
11
+ exit 1
12
+ fi
13
+
14
+ BITCOIN_CLI=$1
15
+ OUTPUT_FILE=$2
16
+ UTXO_TO_SQLITE=$( dirname " $0 " ) /utxo_to_sqlite.py
17
+
18
+ # create named pipe in unique temporary folder
19
+ TEMPPATH=$( mktemp -d)
20
+ FIFOPATH=$TEMPPATH /utxos.fifo
21
+ mkfifo " $FIFOPATH "
22
+
23
+ # start dumping UTXO set to the pipe in background
24
+ $BITCOIN_CLI dumptxoutset " $FIFOPATH " latest &
25
+ BITCOIN_CLI_PID=$!
26
+
27
+ # start UTXO to SQLite conversion tool, reading from pipe
28
+ $UTXO_TO_SQLITE " $FIFOPATH " " $OUTPUT_FILE "
29
+
30
+ # wait and cleanup
31
+ wait $BITCOIN_CLI_PID
32
+ rm -r " $TEMPPATH "
You can’t perform that action at this time.
0 commit comments