Integration/0.21.1.2 (#15)

* upgrade to 0.3.0 and fix LICENSE

* add config script

* address review comments and update Makefile

* address review comments

* update manifest and move config to assets

* Update manifest.yaml

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Update manifest.yaml

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Update manifest.yaml

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>

* add rpc health check

* get bitcoin running

* address pr comments

* fix reindex action

* add synced health check

* allow pruning to be disabled; fix backups and health checks

* fix backups

* add indexes and testnet3 to .backupignore, and add change warning for disabling pruning

* Fix EMBASSY_IP env var references
Update submodule (even though we just re-download from bitcoincore.org. The submodule does nothing.)
Remove change-warning from pruning disabled variant until I can figure out how to properly add it

* add starting phase to health checks

* add progress pct to sync healthck

* update to new healthck spec; update change-warning to warning; redirect gbci call stderr to stdout

* fix case where verification progress contains an exponent

* remove redirect from gbci; add tini to see if that fixes the 137s

* bump max dbcache to 8192

* convert synced hck to inject, remove severity

* add sigterm-timeout, lower max dbcache, and add more info about dbcache

* attempt to fix blank error messages (#29)

* attempt to fix blank error messages

* address pr comments, remove exit 0 since that happens anyway

* Bugfix/blank hck msgs (#33)

* attempt to fix blank error messages

* address pr comments, remove exit 0 since that happens anyway

* don't crash on auto-reindex

* also redirect stdout to fix running arm; add reindex.sh to Makefile

* actually stop after autoreindex (#35)

* cap dbcache at 1024 until a dynamic cap can be implemented

* remove softfork info from properties after active for 3 months (#40)

* Linux Sparrow Guide

* Wallets.md update

* Added note to instructions about default archival mode

* change -geinfo call to getrpcinfo, returns way faster

* add txindex

* reverse lan config

* enable ssl on rpc interface

* update sdk verify command in makefile

* Update Makefile to remove unnecessary build step

* update language for untested wallets

Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
Co-authored-by: kn0wmad <kn0wmad@protonmail.com>
Co-authored-by: Lucy C <12953208+elvece@users.noreply.github.com>
This commit is contained in:
Chris Guida 2022-02-11 16:52:07 -06:00 committed by GitHub
parent b1ec64aed5
commit 33350fdb87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 439 additions and 85 deletions

View File

@ -4,7 +4,7 @@
FROM lncm/berkeleydb as berkeleydb
# Build stage for Bitcoin Core
FROM arm32v7/alpine:3.12 as bitcoin-core
FROM arm64v8/alpine:3.12 as bitcoin-core
COPY --from=berkeleydb /opt /opt
@ -71,7 +71,7 @@ RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# Build stage for compiled artifacts
FROM arm32v7/alpine:3.12
FROM arm64v8/alpine:3.13
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
maintainer.1="Pedro Branco (@pedrobranco)" \
@ -81,13 +81,17 @@ LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
RUN apk update
RUN apk --no-cache add \
bash \
curl \
boost-filesystem=1.72.0-r6 \
boost-system=1.72.0-r6 \
boost-thread=1.72.0-r6 \
libevent \
libzmq \
sqlite-libs \
su-exec
su-exec \
tini
RUN wget https://github.com/mikefarah/yq/releases/download/v4.12.2/yq_linux_arm.tar.gz -O - |\
tar xz && mv yq_linux_arm /usr/bin/yq
ENV BITCOIN_DATA=/root/.bitcoin
ARG BITCOIN_VERSION
@ -96,12 +100,16 @@ ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
COPY --from=bitcoin-core /opt /opt
ADD ./manager/target/armv7-unknown-linux-musleabihf/release/bitcoind-manager /usr/local/bin/bitcoind-manager
ADD ./manager/target/aarch64-unknown-linux-musl/release/bitcoind-manager /usr/local/bin/bitcoind-manager
RUN chmod a+x /usr/local/bin/bitcoind-manager
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
RUN chmod a+x /usr/local/bin/docker_entrypoint.sh
ADD ./actions/reindex.sh /usr/local/bin/reindex.sh
RUN chmod a+x /usr/local/bin/reindex.sh
ADD ./check-rpc.sh /usr/local/bin/check-rpc.sh
RUN chmod a+x /usr/local/bin/check-rpc.sh
ADD ./check-synced.sh /usr/local/bin/check-synced.sh
RUN chmod a+x /usr/local/bin/check-synced.sh
EXPOSE 8332 8333

View File

@ -1 +1 @@
./bitcoin/LICENSE
./bitcoin/COPYING

View File

@ -1,27 +1,26 @@
ASSETS := $(shell yq e ".assets.[].src" manifest.yaml)
ASSET_PATHS := $(addprefix assets/,$(ASSETS))
VERSION := $(shell yq e ".version" manifest.yaml)
VERSION_STRIPPED := $(shell echo $(VERSION) | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/g')
MANAGER_SRC := $(shell find ./manager -name '*.rs') manager/Cargo.toml manager/Cargo.lock
.DELETE_ON_ERROR:
all: bitcoind.s9pk
all: verify
clean:
rm bitcoind.s9pk
rm image.tar
bitcoind.s9pk: manifest.yaml assets/compat/config_spec.yaml assets/compat/config_rules.yaml image.tar instructions.md
embassy-sdk pack
verify: bitcoind.s9pk
embassy-sdk verify s9pk bitcoind.s9pk
install: bitcoind.s9pk
appmgr install bitcoind.s9pk
embassy-cli package install bitcoind.s9pk
bitcoind.s9pk: manifest.yaml config_spec.yaml config_rules.yaml image.tar instructions.md $(ASSET_PATHS)
appmgr -vv pack $(shell pwd) -o bitcoind.s9pk
appmgr -vv verify bitcoind.s9pk
image.tar: Dockerfile docker_entrypoint.sh manager/target/aarch64-unknown-linux-musl/release/bitcoind-manager manifest.yaml check-rpc.sh check-synced.sh actions/reindex.sh
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/bitcoind/main:$(VERSION) --build-arg BITCOIN_VERSION=$(VERSION_STRIPPED) --build-arg N_PROC=$(shell nproc) --platform=linux/arm64 -o type=docker,dest=image.tar .
image.tar: Dockerfile docker_entrypoint.sh manager/target/armv7-unknown-linux-musleabihf/release/bitcoind-manager manifest.yaml
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --tag start9/bitcoind --build-arg BITCOIN_VERSION=$(VERSION_STRIPPED) --build-arg N_PROC=$(shell nproc) --platform=linux/arm/v7 -o type=docker,dest=image.tar .
manager/target/armv7-unknown-linux-musleabihf/release/bitcoind-manager: $(MANAGER_SRC)
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/manager:/home/rust/src start9/rust-musl-cross:armv7-musleabihf cargo build --release
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/manager:/home/rust/src start9/rust-musl-cross:armv7-musleabihf musl-strip target/armv7-unknown-linux-musleabihf/release/bitcoind-manager
manager/target/aarch64-unknown-linux-musl/release/bitcoind-manager: $(MANAGER_SRC)
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/manager:/home/rust/src start9/rust-musl-cross:aarch64-musl cargo build --release

View File

@ -3,4 +3,18 @@
set -e
touch /root/.bitcoin/requires.reindex
bitcoin-cli stop 2>/dev/null && echo "Bitcoin Core restarting in reindex mode" || echo "Bitcoin Core will reindex the next time the service is started"
action_result_running=" {
\"version\": \"0\",
\"message\": \"Bitcoin Core restarting in reindex mode\",
\"value\": null,
\"copyable\": false,
\"qr\": false
}"
action_result_stopped=" {
\"version\": \"0\",
\"message\": \"Bitcoin Core will reindex the next time the service is started\",
\"value\": null,
\"copyable\": false,
\"qr\": false
}"
bitcoin-cli -rpcconnect=bitcoind.embassy stop >/dev/null 2>/dev/null && echo $action_result_running || echo $action_result_stopped

View File

@ -91,3 +91,8 @@ discardfee={{wallet.discardfee}}
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
}}
## TXINDEX
{{#IF txindex
txindex=1
}}

View File

@ -1,3 +1,5 @@
---
- rule: 'rpc.enable? OR !(''advanced.pruning.mode = "manual")'
description: "RPC must be enabled for manual pruning."
- rule: '!(txindex?) OR ''advanced.pruning.mode = "disabled"'
description: "Txindex not allowed on pruned nodes."

View File

@ -1,3 +1,19 @@
peer-tor-address:
name: Peer Tor Address
description: The Tor address of the peer interface
type: pointer
subtype: package
package-id: bitcoind
target: tor-address
interface: peer
rpc-tor-address:
name: RPC Tor Address
description: The Tor address of the RPC interface
type: pointer
subtype: package
package-id: bitcoind
target: tor-address
interface: rpc
rpc:
type: object
nullable: false
@ -17,7 +33,7 @@ rpc:
default: "bitcoin"
masked: true
pattern: "^[a-zA-Z0-9_]+$"
patternDescription: "Must be alphanumeric (can contain underscore)."
pattern-description: "Must be alphanumeric (can contain underscore)."
password:
type: string
nullable: false
@ -27,7 +43,7 @@ rpc:
charset: "a-z,2-7"
len: 20
pattern: '^[^\n"]*$'
patternDescription: "Must not contain newline or quote characters."
pattern-description: "Must not contain newline or quote characters."
copyable: true
masked: true
advanced:
@ -46,7 +62,7 @@ rpc:
default: []
spec:
pattern: "^[a-zA-Z0-9_-]+:([0-9a-fA-F]{2})+\\$([0-9a-fA-F]{2})+$"
patternDescription: 'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".'
pattern-description: 'Each item must be of the form "<USERNAME>:<SALT>$<HASH>".'
range: "[0,*)"
serialversion:
name: Serialization Version
@ -88,6 +104,11 @@ zmq-enabled:
name: ZeroMQ Enabled
description: Enable the ZeroMQ interface
default: true
txindex:
type: boolean
name: Transaction Index
description: Enable the Transaction Index (txindex)
default: false
wallet:
type: object
nullable: false
@ -182,14 +203,15 @@ advanced:
default: []
spec:
pattern: "(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$)|((^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$)|(^[a-z2-7]{16}\\.onion$)|(^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$))"
patternDescription: Must be either an IPv4 or IPv6 address or domain name
pattern-description: Must be either an IPv4 or IPv6 address or domain name
range: "[0,*)"
dbcache:
type: number
nullable: true
name: "Database Cache"
description: "How much RAM to allocate for caching the TXO set. Higher values improve syncing performance."
range: "(0,4096]"
description: "How much RAM to allocate for caching the TXO set. Higher values improve syncing performance, but increase your chance of using up all your system's memory or corrupting your database in the event of an ungraceful shutdown. Set this high but comfortably below your system's total RAM during IBD, then turn down to 450 (or leave blank) once the sync completes."
warning: "WARNING: Increasing this value results in a higher chance of ungraceful shutdowns, which can leave your node unusable if it happens during the initial block download. Use this setting with caution. Be sure to set this back to the default (450 or leave blank) once your node is synced."
range: "(0,1024]"
integral: true
units: MiB
pruning:
@ -198,26 +220,31 @@ advanced:
description: |
Blockchain Pruning Options
Reduce the blockchain size on disk
changeWarning: If you set pruning to Manual, you MUST have something running that prunes these blocks or you may overfill your disk!
warning: |
If you set pruning to Manual and your disk is smaller than the total size of the blockchain, you MUST have something running that prunes these blocks or you may overfill your disk!
Disabling pruning will convert your node into a full archival node. This requires a resync of the entire blockchain, a process that may take several days. Make sure you have enough free disk space or you may fill up your disk.
tag:
id: mode
name: Pruning Mode
description: |
- Disabled: Disable pruning
- Automatic: Limit blockchain size on disk to a certain number of megabytes
- Manual: Prune blockchain with the "pruneblockchain" RPC
variantNames:
variant-names:
disabled: Disabled
automatic: Automatic
manual: Manual
variants:
disabled: {}
automatic:
size:
type: number
nullable: false
name: "Max Chain Size"
description: "Limit of blockchain size on disk."
changeWarning: "Increasing this value will require re-syncing your node."
warning: "Increasing this value will require re-syncing your node."
default: 550
range: "[550,100000)"
range: "[550,1000000)"
integral: true
units: MiB
manual:
@ -227,7 +254,7 @@ advanced:
name: "Failsafe Chain Size"
description: "Prune blockchain if size expands beyond this."
default: 65536
range: "[550,100000)"
range: "[550,1000000)"
integral: true
units: MiB
default: automatic
default: disabled

@ -1 +1 @@
Subproject commit 7d8a10a6f4d61df1f4afb138e379149565afa02d
Subproject commit 194b9b8792d9b0798fdb570b79fa51f1d1f5ebaf

14
check-rpc.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# set -e
gi_result=$(bitcoin-cli getrpcinfo 2>&1)
error_code=$?
if [ "$error_code" -eq 28 ]; then
# Starting
exit 60
else
echo $gi_result >&2
exit $error_code
fi

27
check-synced.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
username=$(yq e '.rpc.username' /root/.bitcoin/start9/config.yaml)
password=$(yq e '.rpc.password' /root/.bitcoin/start9/config.yaml)
gbci_result=$(curl -s --user $username:$password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://bitcoind.embassy:8332/ )
error_code=$?
if [ $error_code -ne 0 ]; then
echo $gbci_result >&2
exit $error_code
fi
res=$(echo "$gbci_result" | yq e '.result' -)
err=$(echo "$gbci_result" | yq e '.error' -)
if [ "$res" = "null" ]; then
# Starting
exit 60
elif [ $(echo "$res" | yq e '.initialblockdownload' -) = "true" ]; then
progress=$(echo "$res" | yq e '.verificationprogress' -)
if [[ "$progress" = *"e"* ]]; then
progress="0"
fi
progress_pct=$( bc -l <<<"100*$progress" )
echo "Syncing blockchain. This may take several days. Progress: $(printf "%.2f" $progress_pct)%" >&2
exit 61
fi

View File

@ -2,7 +2,10 @@
set -euo pipefail
export HOST_IP=$(ip -4 route list match 0/0 | awk '{print $3}')
export EMBASSY_IP=$(ip -4 route list match 0/0 | awk '{print $3}')
export PEER_TOR_ADDRESS=$(yq e '.peer-tor-address' /root/.bitcoin/start9/config.yaml)
export RPC_TOR_ADDRESS=$(yq e '.rpc-tor-address' /root/.bitcoin/start9/config.yaml)
# lighttpd -f /root/.bitcoin/httpd.conf
exec /usr/local/bin/bitcoind-manager
# exec /usr/local/bin/bitcoind-manager
exec tini -p SIGTERM -- bitcoind-manager

View File

@ -16,6 +16,8 @@ Enter your QuickConnect QR code **OR** your raw RPC credentials (both located in
## Pruning
By default, Bitcoin is now set to be an "archival" node. This means that it will download and verify the entire blockchain, and will not prune. Be aware that this takes approximately 400GB as of early 2022.
Pruning is a process by which your node discards old blocks and transactions after it verifies them. Pruned nodes and archival nodes are both "full nodes" in that they are fully validating - they validate every block and transaction. Archival nodes store the entire blockchain and are useful to people interested in doing general or historical analysis, or being a provider of blockchain data to others (eg. a blockexplorer).
The target of pruning on your Embassy is configurable and set by default to the minimum of 550MB (0.55 GB!), meaning the resulting blockchain will occupy a negligible amount of storage space. The maximum amount of blockchain data you can retain depends on the storage capacity your device. The config menu will not permit you to select a target that exceeds a certain percentage of your device's available capacity.

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -0,0 +1,57 @@
# Sparrow Wallet Setup Guide
You have several options for connecting Sparrow to your Embassy. You may connect via the Bitcoin Proxy service, which will allow you to make an RPC user and password specifically for Sparrow. This is the recommended method. THe next option is to use your Bitcoin Core service directly. In future, Embassy will also have an Electrum Server service for even greater flexibility. This guide will be added when available.
## Using Bitcoin Proxy
You will need to have Tor running natively on your device in order to use Sparrow. You can find the relevant setup documentation in the Resources section at the bottom of this page.
1. First install the Bitcoin Core and Bitcoin Proxy services to your Embassy from the Marketplace. (Alternatively, you may use Bitcoin Proxy to point to another Bitcoin node that you control)
2. Configure Bitcoin Core and allow it to begin the Initial Blockchain Download if you have not already. You may continue even if this is still in progress, but you will need to let the sync complete before creating your first transaction.
3. Configure Bitcoin Proxy and create a new user. You may call it "sparrow," for example, or anything you will remember for use with your Sparrow wallet. Embassy will generate a unique password for you, but you may change it if you wish (this will always be available to view or change as you wish). Make sure the option for "Fetch Blocks" is turned off.
![Sparrow Server Setup](./assets/sparrow-server-setup0.png "Setup Bitcoin Proxy")
4. Next, download, install, and launch Sparrow. If this is the first time you have run Sparrow, you will be guided to a screen where you will be asked to configure your Bitcoin server. Otherwise, you can find the server setup in Preferences. Select the option for "Bitcoin Core" as the "Server Type."
![Sparrow Server Setup](./assets/sparrow-server-setup2.png "Setup Your Bitcoin Server")
5. From your Bitcoin Proxy service page, click "Interfaces," and copy your Tor address. Paste this into the "URL" field, removing the `http://` prefix, as Sparrow does not require it. In the "Port" field, type `8332`.
![Sparrow Server Setup](./assets/sparrow-server-setup3.png "Enter URL & Port")
6. Select "User/Pass" as the Authentication method. Return to the Proxy service page again, click "Properties" -> "RPC Users" -> and select the Sparrow user you created earlier. Copy the password. Enter the user's name where indicated in the Sparrow server setup, and paste in the password.
![Sparrow Server Setup](./assets/sparrow-server-setup4.png "Add RPC User & Password")
7. Select "Use Proxy," and enter the default values of `127.0.0.1` and `9050` for the URL and Port, respectively.
![Sparrow Server Setup](./assets/sparrow-server-setup5.png "Use Tor Proxy")
8. Finally, click "Test Connection" to verify that you are able to reach your Bitcoin node. If your node is not yet synced, Sparrow will let you know, as shown in our example
![Sparrow Server Setup](./assets/sparrow-server-setup6.png "Test Connection")
From here you can complete your wallet setup and begin using Sparrow Wallet!
**NOTE** Sparrow has a dependency that has not yet added Taproot support, so only Segwit wallets (the default) are currently available with this platform. The only existing workaround at this time is to use an Electrum Server.
## Using Bitcoin Core
The steps are the same as above, with 2 changes:
In Step 5: instead of using your Bitcoin Proxy Tor address, you will use your Bitcoin Core Tor address.
In Step 6: instead of using the Proxy User and Password, you will use the Bitcoin Core credentials, found under "Properties" in the Bitcoin Core Service page.
## Using an Electrum Server
Coming soon.
## Resources
[Run Tor on Your Device](https://start9.com/support/user-manual/configuration/tor-setup/tor-os/)
[Sparrow Wallet](https://sparrowwallet.com/)

View File

@ -1,23 +1,59 @@
# Compatible Wallets
# Tested Bitcoin Wallets
## Blockstream Green
**Not Possible at this time - No ability to connect to a Bitcoin node**
## BlueWallet
**Not Possible at this time - Requires Electrum Server**
## Fully Noded
### Available for
### Available For
- iOS
- MacOS
### Instructions
1. In Fully Noded, go to `Settings > Node Manager > +`
1. Enter your Bitcoin Core credentials. You can do this in one of two ways: (1) Use Fully Noded to scan your QuickConnect QR code (located in `Services > Bitcoin Core > properties`); or (2) copy/paste your Bitcoin Core Tor Address (located in `Services > Bitcoin Core`) _with :8332 appended_, as well as you rpc username and password (located in `Services > Bitcoin Core > Config > RPC Settings`).
2. Enter your Bitcoin Core credentials. You can do this in one of two ways: (1) Use Fully Noded to scan your QuickConnect QR code (located in `Services > Bitcoin Core > properties`); or (2) copy/paste your Bitcoin Core Tor Address (located in `Services > Bitcoin Core`) _with :8332 appended_, as well as you rpc username and password (located in `Services > Bitcoin Core > Config > RPC Settings`).
---
## Ledger Live
**NOTE:** Built for use with Ledger hardware devices
Verification still needed.
## Samourai
**NOTE:** Android only
**Not Possible at this time - Requires Dojo Stack**
## Sparrow
### Available For
- Linux
- Mac
- Windows
### Instructions
Follow the [guide](/docs/integrations/sparrow/guide.md)
## Specter
### Available for
- Linux
- MacOS
- Windows
- Linux (x86_64)
### Instructions
1. Follow this [tutorial](/docs/integrations/specter)
Follow the [guide](/docs/integrations/specter) for your OS
Verification still needed.
## Trezor Suite
**NOTE:** Built for use with Trezor hardware devices
Verification still needed.

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,3 +1,4 @@
use std::sync::Arc;
use std::{borrow::Cow, sync::Mutex};
use std::{env::var, sync::atomic::AtomicBool};
use std::{error::Error, sync::atomic::Ordering};
@ -263,7 +264,7 @@ fn sidecar(config: &Mapping, addr: &str) -> Result<(), Box<dyn Error>> {
height: _,
} => continue,
SoftFork::Bip9 { bip9, active: _ } => {
let (status, start, end, since) = match bip9 {
let (status, start, end, _since) = match bip9 {
Bip9::Defined {
start_time,
timeout,
@ -298,6 +299,10 @@ fn sidecar(config: &Mapping, addr: &str) -> Result<(), Box<dyn Error>> {
timeout,
since,
} => {
// stop showing soft fork info when it's been active for ~12 weeks
if info.blocks >= since + 12096 {
continue;
}
let start_time_pretty = human_readable_timestamp(start_time);
let end_time_pretty = human_readable_timestamp(timeout);
("Active", start_time_pretty, end_time_pretty, since)
@ -547,13 +552,17 @@ where
}
fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
while !Path::new("/root/.bitcoin/start9/config.yaml").exists() {
std::thread::sleep(std::time::Duration::from_secs(1));
}
let config: Mapping =
serde_yaml::from_reader(std::fs::File::open("/root/.bitcoin/start9/config.yaml")?)?;
let sidecar_poll_interval = std::time::Duration::from_secs(5);
let addr = var("TOR_ADDRESS")?;
let peer_addr = var("PEER_TOR_ADDRESS")?;
let rpc_addr = var("RPC_TOR_ADDRESS")?;
let mut btc_args = vec![
format!("-onion={}:9050", var("HOST_IP")?),
format!("-externalip={}", addr),
format!("-onion={}:9050", var("EMBASSY_IP")?),
format!("-externalip={}", peer_addr),
"-datadir=/root/.bitcoin".to_owned(),
"-conf=/root/.bitcoin/bitcoin.conf".to_owned(),
];
@ -566,13 +575,15 @@ fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
.and_then(|v| v.as_bool())
.unwrap_or(false)
{
btc_args.push(format!("-proxy={}:9050", var("HOST_IP")?));
btc_args.push(format!("-proxy={}:9050", var("EMBASSY_IP")?));
}
{
// disable chain data backup
let mut f = std::fs::File::create("/root/.bitcoin/.backupignore")?;
writeln!(f, "blocks/")?;
writeln!(f, "chainstate/")?;
writeln!(f, "indexes/")?;
writeln!(f, "testnet3/")?;
f.flush()?;
}
if reindex {
@ -581,7 +592,7 @@ fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
std::io::copy(
&mut TemplatingReader::new(
std::fs::File::open("/root/.bitcoin/bitcoin.conf.template")?,
std::fs::File::open("/mnt/assets/bitcoin.conf.template")?,
&config,
&"{{var}}".parse()?,
b'%',
@ -593,6 +604,7 @@ fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.spawn()?;
let child_running = Arc::new(AtomicBool::new(true));
let raw_child = child.id();
*CHILD_PID.lock().unwrap() = Some(raw_child);
let child_stdout = child.stdout.take();
@ -608,11 +620,13 @@ fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
}
});
let child_stderr = child.stderr.take();
let _stderr_handle = std::thread::spawn(move || {
let thread_child_running = child_running.clone();
let stderr_handle = std::thread::spawn(move || {
if let Some(stderr) = child_stderr {
let mut r = StdErrReader::new(stderr);
let mut w = std::io::stderr();
loop {
while thread_child_running.load(Ordering::SeqCst) {
// exit when child terminates
std::io::copy(&mut r, &mut w)
.err()
.map(|e| eprintln!("ERROR IN LOG PARSER: {}", e));
@ -620,12 +634,14 @@ fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
}
});
let _sidecar_handle = std::thread::spawn(move || loop {
sidecar(&config, &addr)
sidecar(&config, &rpc_addr)
.err()
.map(|e| eprintln!("ERROR IN SIDECAR: {}", e));
std::thread::sleep(sidecar_poll_interval);
});
let code = child.wait()?.code().unwrap_or(0);
child_running.store(false, Ordering::SeqCst);
stderr_handle.join().unwrap();
if code != 0 {
publish_notification(&Notification {
time: std::time::UNIX_EPOCH
@ -639,7 +655,12 @@ fn inner_main(reindex: bool) -> Result<(), Box<dyn Error>> {
})?;
}
if REQUIRES_REINDEX.load(Ordering::SeqCst) {
inner_main(true) // restart
if reindex {
REQUIRES_REINDEX.store(false, Ordering::SeqCst);
std::process::exit(code)
} else {
inner_main(true) // restart
}
} else {
std::process::exit(code)
}

View File

@ -1,44 +1,183 @@
compat: v0
id: bitcoind
version: "0.21.1.1"
title: "Bitcoin Core"
version: 0.21.1.2
release-notes: Upgrade to EmbassyOS v0.3.0
license: mit
wrapper-repo: https://github.com/Start9Labs/bitcoind-wrapper
upstream-repo: https://github.com/bitcoin/bitcoin
support-site: https://github.com/bitcoin/bitcoin/issues
marketing-site: https://bitcoincore.org/
build: ["make"]
min-os-version: 0.3.0
description:
short: "A Bitcoin Full Node by Bitcoin Core"
long: "Bitcoin is an innovative payment network and a new kind of money. Bitcoin uses peer-to-peer technology to operate with no central authority or banks; managing transactions and the issuing of bitcoins is carried out collectively by the network. Bitcoin is open-source; its design is public, nobody owns or controls Bitcoin and everyone can take part. Through many of its unique properties, Bitcoin allows exciting uses that could not be covered by any previous payment system."
release-notes: |
Whitelists service IP addresses.
ports:
- internal: 8332
tor: 8332
lan:
custom:
port: 8332
- internal: 8333
tor: 8333
- internal: 28332
tor: 28332
- internal: 28333
tor: 28333
image:
type: tar
mount: /root/.bitcoin
has-instructions: true
os-version-required: "^0.2.9"
os-version-recommended: "^0.2.9"
uninstall-alert: Uninstalling Bitcoin Core will result in permanent loss of data. Without a backup, any funds stored on your node's default hot wallet will be lost forever. If you are unsure, we recommend making a backup, just to be safe.
restore-alert: Restoring Bitcoin Core will overwrite its current data. You will lose any transactions recorded in watch-only wallets, and any funds you have received to the hot wallet, since the last backup.
short: A Bitcoin Full Node by Bitcoin Core
long: Bitcoin is an innovative payment network and a new kind of money. Bitcoin uses peer-to-peer technology to operate with no central authority or banks; managing transactions and the issuing of bitcoins is carried out collectively by the network. Bitcoin is open-source; its design is public, nobody owns or controls Bitcoin and everyone can take part. Through many of its unique properties, Bitcoin allows exciting uses that could not be covered by any previous payment system.
assets:
- src: bitcoin.conf.template
dst: "."
overwrite: true
hidden-service-version: v3
license: LICENSE
icon: icon.png
instructions: instructions.md
docker-images: image.tar
main:
type: docker
image: main
entrypoint: "docker_entrypoint.sh"
args: []
mounts:
main: /root/.bitcoin
compat: /mnt/assets
io-format: yaml
sigterm-timeout: 5m
health-checks:
rpc:
name: RPC
description: Indicates when the RPC server is alive and listening for commands. Dependent services that need the RPC interface will not work until this health check passes.
type: docker
image: main
system: false
entrypoint: check-rpc.sh
args: []
mounts: {}
io-format: yaml
inject: true
synced:
name: Synced
description: Indicates sync progress. Once your node is fully synced to the tip (most recent block) of the blockchain, this health check will pass.
type: docker
image: main
system: false
entrypoint: check-synced.sh
args: []
mounts: {}
io-format: yaml
inject: true
config:
get:
type: docker
image: compat
system: true
entrypoint: compat
args:
- config
- get
- /root/.bitcoin
- "/mnt/assets/config_spec.yaml"
mounts:
compat: /mnt/assets
main: /root/.bitcoin
io-format: yaml
set:
type: docker
image: compat
system: true
entrypoint: compat
args:
- config
- set
- bitcoind
- /root/.bitcoin
- "/mnt/assets/config_rules.yaml"
mounts:
compat: /mnt/assets
main: "/root/.bitcoin"
io-format: yaml
properties:
type: docker
image: compat
system: true
entrypoint: compat
args:
- properties
- /root/.bitcoin
mounts:
main: /root/.bitcoin
io-format: yaml
volumes:
main:
type: data
compat:
type: assets
alerts:
uninstall: Uninstalling Bitcoin Core will result in permanent loss of data. Without a backup, any funds stored on your node's default hot wallet will be lost forever. If you are unsure, we recommend making a backup, just to be safe.
restore: Restoring Bitcoin Core will overwrite its current data. You will lose any transactions recorded in watch-only wallets, and any funds you have received to the hot wallet, since the last backup.
interfaces:
rpc:
name: RPC Interface
description: Listens for JSON-RPC commands
tor-config:
port-mapping:
8332: "8332"
lan-config:
443:
ssl: true
internal: 8332
ui: false
protocols:
- tcp
- http
- json-rpc
peer:
name: Peer Interface
description: Listens for incoming connections from peers on the bitcoin network
tor-config:
port-mapping:
8333: "8333"
ui: false
protocols:
- tcp
- bitcoin
zmq:
name: ZeroMQ Interface
description: Listens for subscriptions to the ZeroMQ raw block and raw transaction event streams
tor-config:
port-mapping:
28332: "28332"
28333: "28333"
ui: false
protocols:
- tcp
- zmq
dependencies: {}
backup:
create:
type: docker
image: compat
system: true
entrypoint: compat
args:
- duplicity
- create
- /mnt/backup
- /root/.bitcoin
mounts:
BACKUP: /mnt/backup
main: /root/.bitcoin
restore:
type: docker
image: compat
system: true
entrypoint: compat
args:
- duplicity
- restore
- /mnt/backup
- /root/.bitcoin
mounts:
BACKUP: /mnt/backup
main: /root/.bitcoin
actions:
- id: "reindex"
reindex:
name: "Reindex Blockchain"
description: "Rebuilds the block and chainstate databases starting from genesis. If blocks already exist on disk, these are used rather than being redownloaded. However, since embassy bitcoin nodes are pruned by default, this usually means downloading the entire blockchain over again."
warning: Blocks not stored on disk will be redownloaded in order to rebuild the database. If your node is pruned (embasssy nodes are pruned by default), this action is equivalent to syncing the node from scratch, so this process could take a couple of weeks.
allowed-statuses:
- "RUNNING"
- "STOPPED"
command:
- reindex.sh
- running
- stopped
implementation:
type: docker
image: main
system: false
entrypoint: reindex.sh
args: []
mounts:
main: /root/.bitcoin
io-format: json