diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eea2e3e --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work + +# Generated dependencies and cache +third_party +nimcache \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1e64416 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/waku-org/waku-go-bindings + +go 1.22.10 diff --git a/sds/Makefile b/sds/Makefile new file mode 100644 index 0000000..8976491 --- /dev/null +++ b/sds/Makefile @@ -0,0 +1,43 @@ +# Makefile for Waku Go Bindings + +# Directories +THIRD_PARTY_DIR := ../third_party +NIM_SDS_REPO := https://github.com/waku-org/nim-sds +NIM_SDS_DIR := $(THIRD_PARTY_DIR)/nim-sds + +.PHONY: all clean prepare build-libsds build + +# Default target +all: build + +# Prepare third_party directory and clone nim-sds +# TODO: remove the "git checkout gabrielmer-feat-init-implementation" part +prepare: + @echo "Creating third_party directory..." + @mkdir -p $(THIRD_PARTY_DIR) + + @echo "Cloning nim-sds repository..." + @if [ ! -d "$(NIM_SDS_DIR)" ]; then \ + cd $(THIRD_PARTY_DIR) && \ + git clone $(NIM_SDS_REPO) && \ + cd $(NIM_SDS_DIR) && \ + git checkout gabrielmer-feat-init-implementation; \ + else \ + echo "nim-sds repository already exists."; \ + fi + +# Build libsds +build-libsds: prepare + @echo "Building libsds..." + @cd $(NIM_SDS_DIR) && make libsds + +# Build SDS Go Bindings +build: build-libsds + @echo "Building SDS Go Bindings..." + go build ./... + +# Clean up generated files +clean: + @echo "Cleaning up..." + @rm -rf $(THIRD_PARTY_DIR) + @rm -f sds-go-bindings \ No newline at end of file diff --git a/sds/sds.go b/sds/sds.go new file mode 100644 index 0000000..bc13b40 --- /dev/null +++ b/sds/sds.go @@ -0,0 +1 @@ +package sds