Skip to content

Commit

Permalink
Init nostr-sdk-fbs crate
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 24, 2023
1 parent 9259493 commit 7071c29
Show file tree
Hide file tree
Showing 6 changed files with 567 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ clean:
book:
cd book && make build

flatbuffers:
cd crates/nostr-sdk-fbs && make

loc:
@echo "--- Counting lines of .rs files (LOC):" && find crates/ bindings/ -type f -name "*.rs" -exec cat {} \; | wc -l
11 changes: 11 additions & 0 deletions crates/nostr-sdk-fbs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "nostr-sdk-fbs"
version = "0.1.0"
edition = "2021"
homepage.workspace = true
repository.workspace = true
license.workspace = true

[dependencies]
flatbuffers = "23.5"
nostr = { version = "0.24", path = "../nostr", default-features = false, features = ["std"] }
4 changes: 4 additions & 0 deletions crates/nostr-sdk-fbs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all: build

build:
flatc --rust -o ./src/ ./fbs/event.fbs
21 changes: 21 additions & 0 deletions crates/nostr-sdk-fbs/fbs/event.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace EventFbs;

struct Fixed32Bytes {
val: [ubyte:32];
}

struct Fixed64Bytes {
val: [ubyte:64];
}

table Event {
id: Fixed32Bytes;
pubkey: Fixed32Bytes;
created_at: ulong;
kind: ulong;
tags: [string];
content: string;
sig: Fixed64Bytes;
}

root_type Event;
Loading

0 comments on commit 7071c29

Please sign in to comment.