nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit 017e1430d7a3366ab9a15e577655e91faef7133e
parent d385bc0bb3d4bb6700483657c04b1649c41d4861
Author: William Casarin <jb55@jb55.com>
Date:   Fri,  4 Aug 2023 08:57:38 -0700

schema: add profile flatbuffers schema

Diffstat:
MMakefile | 37++++++++++++++++++++++++++++++++++++-
Aschemas/profile.fbs | 20++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -7,12 +7,20 @@ ARS = libsecp256k1.a DEPS = $(SRCS) $(HEADERS) $(ARS) PREFIX ?= /usr/local SUBMODULES = deps/secp256k1 +C_BINDINGS_PROFILE=bindings/c/profile_builder.h bindings/c/profile_reader.h bindings/c/profile_verifier.h +C_BINDINGS_COMMON=bindings/c/flatbuffers_common_builder.h bindings/c/flatbuffers_common_reader.h +C_BINDINGS=$(C_BINDINGS_COMMON) $(C_BINDINGS_PROFILE) +BINDINGS=bindings + +all: bench test + +bindings: bindings-swift bindings-c check: test ./test clean: - rm -f test bench + rm -rf test bench bindings tags: ctags *.c *.h @@ -26,6 +34,33 @@ configurator: configurator.c config.h: configurator ./configurator > $@ +bindings-c: $(C_BINDINGS) + +bindings/%: + mkdir -p $@ + +bindings/c/profile_builder.h: schemas/profile.fbs bindings/c + flatcc --builder $< + @mv profile_builder.h $@ + +bindings/c/profile_verifier.h bindings/c/profile_reader.h: schemas/profile.fbs bindings/c + flatcc --verifier $< + @mv profile_verifier.h profile_reader.h bindings/c + +bindings/c/flatbuffers_common_reader.h: bindings/c + flatcc --common_reader + @mv flatbuffers_common_reader.h $@ + +bindings/c/flatbuffers_common_builder.h: bindings/c + flatcc --common_builder + @mv flatbuffers_common_builder.h $@ + +bindings-swift: bindings/swift/NdbProfile.swift + +bindings/swift/NdbProfile.swift: schemas/profile.fbs bindings/swift + flatc --swift $< + @mv profile_generated.swift $@ + deps/secp256k1/.git: @devtools/refresh-submodules.sh $(SUBMODULES) diff --git a/schemas/profile.fbs b/schemas/profile.fbs @@ -0,0 +1,20 @@ + +table NdbProfile { + json:string; + + name:string; + website:string; + about:string; + lud16:string; + banner:string; + display_name:string; + reactions:bool = true; + picture:string; + nip05:string; + + + damus_donation:int; + damus_donation_v2:int; +} + +root_type NdbProfile;