mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-03-30 16:03:13 +00:00
Update documentation
This commit is contained in:
parent
759cf15fd1
commit
70c4813465
@ -49,7 +49,7 @@ clean:
|
||||
First you need to `fetch` the artefacts for your `OS` and `ARCH`:
|
||||
|
||||
```sh
|
||||
OS=macos ARCH=arm64 make fetch
|
||||
OS=darwin ARCH=arm64 make fetch
|
||||
```
|
||||
|
||||
Then you can build your project using:
|
||||
|
||||
22
RELEASE.md
22
RELEASE.md
@ -23,7 +23,7 @@ git push --tags
|
||||
|
||||
Once published, the artifacts can be downloaded using the `version`, example:
|
||||
|
||||
`https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.16/storage-linux-amd64.zip`
|
||||
`https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-linux-amd64-v0.3.2.zip`
|
||||
|
||||
It is not recommended to use the `latest` URL because you may face cache issues.
|
||||
|
||||
@ -41,24 +41,24 @@ Then you can use the following `Makefile` command to fetch the artifact:
|
||||
LIBS_DIR := $(abspath ./libs)
|
||||
STORAGE_OS := linux
|
||||
STORAGE_ARCH := amd64
|
||||
STORAGE_VERSION := $(shell go list -m -f '{{.Version}}' github.com/logos-storage/logos-storage-go-bindings 2>/dev/null)
|
||||
STORAGE_DOWNLOAD_URL := "https://github.com/logos-storage/logos-storage-go-bindings/releases/download/$(STORAGE_VERSION)/storage-${STORAGE_OS}-${STORAGE_ARCH}.zip"
|
||||
STORAGE_VERSION := v0.3.2
|
||||
STORAGE_DOWNLOAD_URL := "https://github.com/logos-storage/logos-storage-nim/releases/download/$(STORAGE_VERSION)/storage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VERSION}.zip"
|
||||
|
||||
fetch-libstorage:
|
||||
mkdir -p $(LIBS_DIR); \
|
||||
curl -fSL --create-dirs -o $(LIBS_DIR)/storage-${STORAGE_OS}-${STORAGE_ARCH}.zip ${STORAGE_DOWNLOAD_URL}; \
|
||||
unzip -o -qq $(LIBS_DIR)/storage-${STORAGE_OS}-${STORAGE_ARCH}.zip -d $(LIBS_DIR); \
|
||||
rm -f $(LIBS_DIR)/storage*.zip;
|
||||
curl -fSL --create-dirs -o $(LIBS_DIR)/storage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VESION}.zip ${STORAGE_DOWNLOAD_URL}; \
|
||||
unzip -o -qq $(LIBS_DIR)/libstorage-${STORAGE_OS}-${STORAGE_ARCH}-${STORAGE_VESION}.zip -d $(LIBS_DIR); \
|
||||
rm -f $(LIBS_DIR)/libstorage*.zip;
|
||||
```
|
||||
|
||||
`STORAGE_VERSION` uses the same version as the Logos Storage Go dependency declared in your project.
|
||||
`STORAGE_VERSION` is the release version from Logos Storage Nim.
|
||||
|
||||
### Nix
|
||||
|
||||
If you use Nix in a sandboxed environment, you cannot use curl to download the artifacts, so you have to prefetch them using the artifacts `SHA-256` hash. To generate the hash, you can use the following command:
|
||||
|
||||
```bash
|
||||
nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.26/storage-macos-arm64.zip | jq -r .hash
|
||||
nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-darwin-arm64-v0.3.2.zip | jq -r .hash
|
||||
|
||||
# [10.4 MiB DL] sha256-3CHIWoSjo0plsYqzXQWm1EtY1STcljV4yfXTPon90uE=
|
||||
```
|
||||
@ -76,14 +76,14 @@ let
|
||||
os = if stdenv.isDarwin then "macos" else "Linux";
|
||||
hash =
|
||||
if stdenv.hostPlatform.isDarwin
|
||||
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.26/storage-macos-arm64.zip | jq -r .hash
|
||||
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-darwin-arm64-v0.3.2.zip | jq -r .hash
|
||||
then "sha256-3CHIWoSjo0plsYqzXQWm1EtY1STcljV4yfXTPon90uE="
|
||||
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-go-bindings/releases/download/v0.0.26/storage-Linux-amd64.zip | jq -r .hash
|
||||
# nix store prefetch-file --json --unpack https://github.com/logos-storage/logos-storage-nim/releases/download/v0.3.2/libstorage-linux-amd64-v0.3.2.zip | jq -r .hash
|
||||
else "sha256-YxW2vFZlcLrOx1PYgWW4MIstH/oFBRF0ooS0sl3v6ig=";
|
||||
|
||||
# Pre-fetch libstorage to avoid network during build
|
||||
storageLib = pkgs.fetchzip {
|
||||
url = "https://github.com/logos-storage/logos-storage-go-bindings/releases/download/${storageVersion}/storage-${os}-${arch}.zip";
|
||||
url = "https://github.com/logos-storage/logos-storage-nim/releases/download/${storageVersion}/storage-${os}-${arch}-${storageVersion}.zip";
|
||||
hash = hash;
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user