https://github.com/scroll-tech/da-codec
scroll's DA encoding/decoding libraries
https://github.com/scroll-tech/da-codec
Last synced: 3 months ago
JSON representation
scroll's DA encoding/decoding libraries
- Host: GitHub
- URL: https://github.com/scroll-tech/da-codec
- Owner: scroll-tech
- License: mit
- Created: 2024-04-29T06:40:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-26T11:24:18.000Z (5 months ago)
- Last Synced: 2025-10-01T20:48:36.716Z (3 months ago)
- Language: Go
- Homepage:
- Size: 44.1 MB
- Stars: 17
- Watchers: 19
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# da-codec
Scroll's DA encoding/decoding libraries.
## Running unit tests
```
go test -v -race ./...
```
## FAQ
**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:
1. Build the legacy encoder:
```bash
cd libzstd/encoder-legacy
make install
```
2. Build the standard encoder:
```bash
cd libzstd/encoder-standard
make install
```
3. Add symbol prefixes to avoid conflicts:
```bash
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:
```bash
# 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:
```bash
# 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
```