This package provides Go bindings for the RGB Rust library via UniFFI. It supports macOS and Linux.
go get github.com/UTEXO-Protocol/rgb-lib-go@latestThis package is automatically rebuilt when a new version of rgb-lib is released. Pre-built binaries are available in the Releases section.
git clone https://github.com/UTEXO-Protocol/rgb-lib.git
cd rgb-lib/bindings/unifficargo build --releaseCopy the compiled .dylib (macOS) or .so (Linux) file from target/release into the lib directory:
mkdir -p lib
cp ../../target/release/librgblibuniffi.* lib/uniffi-bindgen-go src/rgb-lib.udlCopy the generated files (e.g., rgb_lib.go, rgb_lib.h) to the root of your Go package.
At the top of rgb_lib.go, insert:
/*
#cgo LDFLAGS: -lrgblibuniffi -L${SRCDIR}/lib -Wl,-rpath,${SRCDIR}/lib
*/install_name_tool -id @rpath/librgblibuniffi.dylib lib/librgblibuniffi.dylibpatchelf --set-rpath '$ORIGIN/lib' lib/librgblibuniffi.soTag the release and push:
git tag v0.3.5
git push origin v0.3.5