Scroll's DA encoding/decoding libraries.
go test -v -race ./...
Q: Why the repo contains libscroll_zstd*.a
binary files?
A: This simplifies package installation with go get
without the need to perform additional steps for building the libscroll_zstd*.a
.
Q: Which platforms/architectures are supported?
A: linux/amd64
, linux/arm64
, darwin/arm64
. Pull requests for other platforms/architectures are accepted.
Q: I don't trust libscroll_zstd*.a
binary files from the repo or these files don't work on my OS/ARCH. How to rebuild them?
A: To rebuild the libraries for your platform:
-
Build the legacy encoder:
cd libzstd/encoder-legacy make install
-
Build the standard encoder:
cd libzstd/encoder-standard make install
-
Add symbol prefixes to avoid conflicts:
cd encoding/zstd ./add_symbol_prefix.sh
Note: The symbol prefix script currently only works on macOS. For Linux builds, perform steps 1-2 in Docker, then run step 3 on macOS.
For macOS builds, ensure you have Rust and necessary build tools installed:
# Install Rust if not already installed curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
For Linux builds, use Docker with build dependencies:
# Linux ARM64 docker run -it --rm --platform linux/arm64 -v $(pwd):/workspace -w /workspace rust:1.75-slim bash apt update && apt install -y build-essential # Linux AMD64 docker run -it --rm --platform linux/amd64 -v $(pwd):/workspace -w /workspace rust:1.75-slim bash apt update && apt install -y build-essential