This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (53 loc) · 1.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Makefile for building the allora-inference-extension
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
BINARY_NAME=allora-inference-extension
SOURCE_FILE=main.go
# Detect the operating system and architecture
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Linux)
OS := linux
ifeq ($(UNAME_M),x86_64)
ARCH := x86_64
endif
ifeq ($(UNAME_M),aarch64)
ARCH := aarch64
endif
endif
ifeq ($(UNAME_S),Darwin)
OS := macos
ifeq ($(UNAME_M),x86_64)
ARCH := x86_64
endif
ifeq ($(UNAME_M),arm64)
ARCH := aarch64
endif
endif
ifeq ($(OS_ARCH),windows)
OS := windows
ARCH := x86_64
endif
# Define the URL based on the detected OS and architecture
RUNTIME_URL := https://github.com/blocklessnetwork/runtime/releases/download/v0.3.1/blockless-runtime.$(OS)-latest.$(ARCH).tar.gz
all: build
$(BINARY_NAME): $(SOURCE_FILE)
$(GOBUILD) -o $(BINARY_NAME) $(SOURCE_FILE)
build: $(BINARY_NAME)
clean:
$(GOCLEAN)
rm -rf $(BINARY_NAME)
example:
cd allora-inference-function && npm run build:release
setup:
@echo "\n📥 Downloading and extracting runtime...\n"
mkdir -p /tmp/runtime
wget -O /tmp/blockless-runtime.tar.gz $(RUNTIME_URL)
tar -xzf /tmp/blockless-runtime.tar.gz -C /tmp/runtime
@echo "\n✅ Done.\n"
test: example build
export ALLORA_ARG_PARAMS=yuga TOPIC_ID=1 BLS_LIST_VARS="ALLORA_ARG_PARAMS;TOPIC_ID"; \
/tmp/runtime/bls-runtime allora-inference-function/build/release.wasm - --drivers-root-path=$(PWD)
.PHONY: all build clean example setup test