Giter Site home page Giter Site logo

bdk-old's People

Contributors

notmandatory avatar thunderbiscuit avatar tiero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bdk-old's Issues

Must restart example wallet to sync and show balance

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:

  1. start with no prior data
    $ nigiri stop
    $ rm -rf regtest
    $ nigiri start
    
  2. start example wallet in regtest mode and send regtest coins to it's deposit address
    $ cargo run --example wallet -- -n regtest -p testpass -a 127.0.0.1:18432 
    
    note: no regtest/wallet.log file greated
    $ docker exec -it resources_bitcoin_1 bitcoin-cli -regtest -rpcport=19001 -rpcuser=admin1 -rpcpassword=123 generatetoaddress 100 2NCks2FrsbaEbovz7YUYttFVc94SYpgwat7
    
  3. check wallet balance and is 0
    >> balance 
    balance: 0, confirmed: 0
    >> stop
    
  4. restart wallet and balance is displayed, also regtest/wallet.log is created
    >> balance
    balance: 246250000000, confirmed: 246250000000
    >> 
    

Some Readme Issues.

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?

Test failure in `cargo test --features java`

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

Build failure with `--features android`

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.

Compile error in tests with`cargo test --features java`

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.

$ANDROID_HOME env variable collides with expected default from Flutter

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.