Skip to content

Commit

Permalink
chore: rename project and lib (#10)
Browse files Browse the repository at this point in the history
* chore: rename project, lib and module to bitcoin-primitives

* feat: re-export secp256k1
  • Loading branch information
tdelabro authored Sep 6, 2024
1 parent de74bb3 commit 17430ab
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# bitcoin-zig
# bitcoin-primitives

Libraries and primitives for Bitcoin, written in Zig.

# Zig Official Package Manager

To install `bitcoin-zig`, you need to run the following command in your root folder with `build.zig`:
To install `bitcoin-primitives`, you need to run the following command in your root folder with `build.zig`:

```bash
zig fetch --save git+https://github.com/zig-bitcoin/bitcoin-zig#f3af13008b088796697fc656e26d8c2ddf73dc18
zig fetch --save git+https://github.com/zig-bitcoin/bitcoin-primitives#f3af13008b088796697fc656e26d8c2ddf73dc18
```

where `f3af13008b088796697fc656e26d8c2ddf73dc18` is the commit hash.

Then, in your `build.zig`, you need to add our module:

```zig
const bitcoin_zig = b.dependency("bitcoin-zig", .{
const bitcoin_primitives = b.dependency("bitcoin-primitives", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("bitcoin", bitcoin_zig.module("bitcoin"));
exe.root_module.addImport("bitcoin-primitives", bitcoin_primitives.module("bitcoin-primitives"));
```
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn build(b: *std.Build) void {
});

const lib = b.addStaticLibrary(.{
.name = "bitcoin-zig",
.name = "bitcoin-primitives",
// In this case the main source file is merely a path, however, in more
// complicated build scripts, this could be a generated file.
.root_source_file = b.path("src/root.zig"),
Expand All @@ -37,7 +37,7 @@ pub fn build(b: *std.Build) void {
b.installArtifact(lib);

// expose library as module
const module = b.addModule("bitcoin", .{
const module = b.addModule("bitcoin-primitives", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// It is redundant to include "zig" in this name because it is already
// within the Zig package namespace.
.name = "bitcoin-zig",
.name = "bitcoin-primitives",

// This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/root.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pub const base58 = @import("base58/encode.zig");
pub const bech32 = @import("bech32/bech32.zig");
pub const bitcoin = @import("bitcoin/lib.zig");
pub const bips = @import("bips/lib.zig");
pub const hashes = @import("hashes/lib.zig");
pub const secp256k1 = @import("secp256k1");

test {
const std = @import("std");
Expand Down

0 comments on commit 17430ab

Please sign in to comment.