Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ cd go-bitcoinkernel

### Step 2: Build the Native Library

On Nix: `nix develop` to get all the build and runtime dependencies.

```bash
make build-kernel
```
Expand Down Expand Up @@ -96,4 +98,4 @@ The library uses structured error types for better error handling (see [errors.g

### Runtime Dependencies

Your Go application will have a runtime dependency on the shared `libbitcoinkernel` library produced by `make build-kernel` in `/path/to/go-bitcoinkernel/depend/bitcoin/build`. Do not delete or move these built library files as your application needs them to run.
Your Go application will have a runtime dependency on the shared `libbitcoinkernel` library produced by `make build-kernel` in `/path/to/go-bitcoinkernel/depend/bitcoin/build`. Do not delete or move these built library files as your application needs them to run.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
description = "Development shell for go-bitcoinkernel";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/b3d51a0365f6695e7dd5cdf3e180604530ed33b4";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
nativeDeps = with pkgs; [
cmake
ninja
pkg-config
go
python3
git
];
runtimeDeps = with pkgs; [
boost
libevent
zlib
];
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = nativeDeps;
buildInputs = runtimeDeps;
shellHook = ''
export PKG_CONFIG_PATH=${pkgs.lib.makeSearchPath "lib/pkgconfig" runtimeDeps}''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath runtimeDeps}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export CGO_CFLAGS="-I${pkgs.lib.makeIncludePath runtimeDeps}''${CGO_CFLAGS:+ ''${CGO_CFLAGS}}"
export CGO_LDFLAGS="-L${pkgs.lib.makeLibraryPath runtimeDeps}''${CGO_LDFLAGS:+ ''${CGO_LDFLAGS}}"
'';
};
});
}
Loading