Blockstream / gdk_rpc

gdk_rpc for bitcoind/liquidd
MIT License
6 stars 7 forks source link

Build not finding Libwally #37

Open nharmon9 opened 4 years ago

nharmon9 commented 4 years ago
ld: warning: directory not found for option '-L./bld/lib'
          ld: library not found for -lwallycore
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
nharmon9 commented 4 years ago

I manually created the bld/lib directory and now it is having trouble finding secp256k1

|Message: --- Failed to run command (stderr) ---
|Message: configure.ac:10: installing 'build-aux/compile'
|configure.ac:9: installing 'build-aux/missing'
|Makefile.am: installing 'build-aux/depcomp'
|configure.ac:28: installing 'tools/build-aux/compile'
|configure.ac:7: installing 'tools/build-aux/config.guess'
|configure.ac:7: installing 'tools/build-aux/config.sub'
|configure.ac:27: installing 'tools/build-aux/install-sh'
|configure.ac:27: installing 'tools/build-aux/missing'
|src/Makefile.am: installing 'tools/build-aux/depcomp'
|parallel-tests: installing 'tools/build-aux/test-driver'
|configure: WARNING: using cross tools not prefixed with host triplet
|make[1]: /Applications/Android: No such file or directory
|make[1]: *** [swig_java/src/com/blockstream/libwally/Wally.class] Error 1
|make: *** [all-recursive] Error 1
|

subprojects/libwally-core-dbb5e11a76fc4e09ad6381ce695f740bc536ed9b/meson.build:33:0: ERROR: C library 'secp256k1' not found
jb55 commented 4 years ago

btw there is a much newer version of this library, integrated directly into gdk at https://github.com/jb55/gdk/tree/gdk-rpc

It has fullnode support for sending/receiving, viewing balances and transactions.

I plan on someday moving the fullnode parts out of gdk and gdk-rpc so that they are a standalone library, but perhaps someone else could take a stab at that until then :)

nharmon9 commented 4 years ago

Hey @jb55 is it possible to use with an elements regtest node?

jb55 commented 4 years ago

Hey @jb55 is it possible to use with an elements regtest node?

We only have bitcoin regtest set up for now. This is mainly for testing electrum on the jb55/gdk-electrum branch. We've moved on to supporting both electrum and rpc, with the focus on electrum for now. In the next few weeks we'll be looking into elements regtest, but it should be able to support testing rpc as well when we get back to that.

nharmon9 commented 4 years ago

The elements electrum server is electrs?

jb55 commented 4 years ago

yes, but blockstream's fork: https://github.com/Blockstream/electrs

nharmon9 commented 4 years ago

Right. I have that running with my elements regtest. Does the gdk-electrum branch work with an elements regtest?

nharmon9 commented 4 years ago

Oh I see there is an elements-regtest network-param in there.

jb55 commented 4 years ago

like I mentioned, we haven't got there yet, but its something we're going to need soon. check out tests/{test-runner,test_rust.cpp} to see progress on that front, since we're going to eventually test all configurations with that: {rpc,electrum} x {liquid, bitcoin} x {regtest, testnet}

oh and to fix your original issue, you just need this build.rs, and then set WALLY_DIR to the build-clang/libwally-core/build/lib/ dir. This is already on the gdk-electrum branch

// build.rs

use std::env;

fn main() {
    if let Ok(wally_dir) = env::var("WALLY_DIR") {
        println!("cargo:rustc-link-lib=static=wallycore");
        println!("cargo:rustc-link-lib=static=secp256k1");
        println!("cargo:rustc-link-search=native={}", wally_dir);
    }
}
nharmon9 commented 4 years ago

Cool thanks maybe I can help with this. I have been helping test NBitcoin and NBXplorer with elements. So I will take a look and try to catch up. You're a champ

jb55 commented 4 years ago

It might be a good thing to test against different electrum servers, does your NBXplorer fork support the electrum server protocol, or is it rpc based? If so I can look into testing against it.

nharmon9 commented 4 years ago

This is the problem I ran into NBX and NBitcoin can't sign elements transactions at the moment, so it only has rpc support.

nharmon9 commented 4 years ago

Also I have had trouble building electrs on mac. It fails at compiling librocksdb.

jb55 commented 4 years ago

nharmon9 notifications@github.com writes:

Also I have had trouble building electrs on mac. It fails at compiling librocksdb.

yeah I've definitely run into build issues for librocksdb. This PR is a bit offtopic now. Feel free to email me (jb55@jb55.com) about any elements regtesting/rpc stuff since I'm deep into that right now. There's also #elements channel on the Blockstream slack. Looking forward to extracting a lot of this stuff into a standalone lib again.

nharmon9 commented 4 years ago

Thanks for the invite. Will do.