bitcoindevkit / bdk-old Goto Github PK
View Code? Open in Web Editor NEWREPLACED BY REPO: bitcoindevkit/bdk
Home Page: https://bitcoindevkit.org/
License: Apache License 2.0
REPLACED BY REPO: bitcoindevkit/bdk
Home Page: https://bitcoindevkit.org/
License: Apache License 2.0
See related murmel MRs:
rust-bitcoin/murmel#42
It's marked as "optional" in Cargo.toml
. Perhaps you could create a "simple_logger" feature and enable it like this?
version: commit 3d695d0
Wallet balance is not always shown and wallet.log not created when starting a fresh regtest
wallet. I had this happen once, but then not happen on a second test.
steps to reproduce:
$ nigiri stop
$ rm -rf regtest
$ nigiri start
$ cargo run --example wallet -- -n regtest -p testpass -a 127.0.0.1:18432
$ docker exec -it resources_bitcoin_1 bitcoin-cli -regtest -rpcport=19001 -rpcuser=admin1 -rpcpassword=123 generatetoaddress 100 2NCks2FrsbaEbovz7YUYttFVc94SYpgwat7
>> balance
balance: 0, confirmed: 0
>> stop
>> balance
balance: 246250000000, confirmed: 246250000000
>>
The following are a few issues that occurred to me while parsing the Readme as a fresh starter.
Clone bitcoindevkit/murmel to directory ../murmel relative to the ./bdk project repo.
This line felt a little confusing. Maybe change it to something like
Clone bitcoindevkit/murmel in the same directory with bdk folder.
Or better give explicit command-line instructions.
Install Android Studio and NDK
Open Android Studio -> SDK Manager
Select SDK Tools tab Install "NDK (Side by side)"
This can be simplified as
Open Android Studio -> Tools -> SDK Manager -> SDK Tools -> install "NDK (Side by side)"
There should be a cargo build
and cargo test
instruction at the end.
Currently, the Regtest Box in bitcoindevkit/bitcoin-regtest-box compiles bitcoin core. I don't see how the user can test bdk with it. Maybe something for the future, but a newcomer can spend unnecessary time there which doesn't relate to bdk as of now.
Also, the dependency list felt too high for my comfort level. I understand its probably because of all the android stuffs, but generally, in Bitcoin, it's preferred to keep dependencies as low as possible. Is that something this repo will work towards in the future, or it will adopt different philosophy?
running cargo test --features java
gives the following failure.
running 5 tests
[2020-07-10T13:26:31Z INFO bdk::api::test] TEST init_update_remove_config()
test config::test::save_load_delete ... ok
test config::test::save_update_load_delete ... ok
test wallet::test::process_blocks_balance ... ok
test api::test::init_start_stop_remove_config ... FAILED
test api::test::init_update_remove_config ... ok
failures:
---- api::test::init_start_stop_remove_config stdout ----
thread 'api::test::init_start_stop_remove_config' panicked at 'Builder::init should not be called after logger initialized: SetLoggerError(())', /home/raj/.cargo/registry/src/github.com-1ecc6299db9ec823/env_logger-0.7.1/src/lib.rs:703:9
Failure backtrace
14: core::option::expect_none_failed
at src/libcore/option.rs:1268
15: core::result::Result<T,E>::expect
at /home/raj/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs:963
16: env_logger::Builder::init
at /home/raj/.cargo/registry/src/github.com-1ecc6299db9ec823/env_logger-0.7.1/src/lib.rs:703
17: bdk::api::test::init_start_stop_remove_config
at src/api.rs:350
18: bdk::api::test::init_start_stop_remove_config::{{closure}}
at src/api.rs:349
19: core::ops::function::FnOnce::call_once
at /home/raj/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ops/function.rs:232
Curiously, the test passes as a stand-alone.
$ cargo test init_start_stop_remove_config --features java
running 1 test
[2020-07-10T13:30:28Z INFO bdk::api::test] TEST init_start_stop_remove_config()
[2020-07-10T13:30:29Z INFO bdk::api::test] start 1
[2020-07-10T13:30:29Z INFO bdk::api::test] start 2
[2020-07-10T13:30:29Z INFO bdk::api] config file path: ./regtest/bdk.cfg
[2020-07-10T13:30:29Z INFO murmel::chaindb] no header tip found
[2020-07-10T13:30:29Z INFO murmel::chaindb] initialized with genesis header 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
[2020-07-10T13:30:30Z INFO bdk::api] Wallet balance: 0 satoshis 0 available
[2020-07-10T13:30:30Z INFO bdk::api] start check_stopped
[2020-07-10T13:30:30Z INFO bdk::api] stopping
[2020-07-10T13:30:30Z INFO bdk::api::test] stop returned
[2020-07-10T13:30:30Z INFO bdk::api::test] removed config
test api::test::init_start_stop_remove_config ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out
Following build failure was observed while running cargo build --features android
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/raj/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/raj/github-repo/bdk/target/debug/deps/bdk.10hfp1s7chj5zacr.rcgu.o"
--Long linking list---
x86_64-unknown-linux-gnu/lib/libcore-7ea8ebc630055039.rlib" "-Wl,--end-group" "/home/raj/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f7cd12d3ecd59a89.rlib" "-Wl,-Bdynamic" "-llog" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil" "-shared"
= note: /usr/bin/ld: cannot find -llog
collect2: error: ld returned 1 exit status
$uname -smpor
Linux 5.3.0-62-generic x86_64 x86_64 GNU/Linux
Verified cargo build
is working fine.
Verified cargo build --features java
is working fine.
There is a compilation error while performing api
tests
error: cannot find macro `debug` in this scope
--> src/api.rs:369:13
|
369 | debug!("start 2 returned")
| ^^^^^
Which is easily solvable. log::debug
is not imported in api
tests. Will open a PR with a fix.
Setting up Flutter on my Ubuntu machine I'm getting a small problem with what I think is the overwrite of an environment variable with bdk
.
Flutter comes with this tool called flutter doctor which checks your environment and displays a report of the status of your Flutter installation. In my case, it's telling me it can't find the Android sdk, and that is because it is using $ANDROID_HOME
, where it expects to find the sdk, and I have redefined that $ANDROID_HOME
environment variable as per the readme in bdk. The sdk is actually one level down at /home/username/Android/Sdk/
, and so when I change my variable in my .bashrc
, it fixes my issue and the flutter doctor report comes back clean.
I am posting this here as an issue because I'm not sure of how that environment variable comes into play for bdk, and whether the readme should/could be adapted to not mess with those, and whether that environment variable could create other problems elsewhere for other folks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.