diff --git a/Makefile b/Makefile index b5fea5f..8c1d844 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,21 @@ VERSION := $(shell git describe --tags --always) +CONFIG_URL := https://cfg.rpchub.io/agg/op-default.json -GOLDFLAGS += -X github.com/BlockPILabs/aggregator/version.Version=$(VERSION) +GOLDFLAGS := -X github.com/BlockPILabs/aggregator/version.Version=$(VERSION) +GO_OPLDFLAGS := -X github.com/BlockPILabs/aggregator/config.DefaultConfigUrl=$(CONFIG_URL) GOFLAGS = -ldflags "$(GOLDFLAGS)" + all: build .PHONY: build build: - go build $(GOFLAGS) -o ./build/ ./cmd/aggregator + CGO_ENABLED=0 go build -ldflags "$(GOLDFLAGS)" -o ./build/ ./cmd/aggregator +build-op: + CGO_ENABLED=0 go build -ldflags "$(GOLDFLAGS) $(GO_OPLDFLAGS)" -o ./build/ ./cmd/aggregator +#build-windows: +# CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build $(GOFLAGS) -o ./build/ ./cmd/aggregator +#build-mac: +# CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build $(GOFLAGS) -o ./build/ ./cmd/aggregator clean: rm -rf build/* diff --git a/README.md b/README.md index e4d3836..7bb25ee 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ curl -u rpchub: -X POST 'http://localhost:8012/config' --header 'Conte ## Reset configuration 1. Stop the aggregator. 2. Delete the configuration directory `rm -rf $HOME/.rpchub/aggregator/`. -3. Restart the aggregator +3. Restart the aggregator \ No newline at end of file diff --git a/config/config.go b/config/config.go index a45a943..b1bde1c 100644 --- a/config/config.go +++ b/config/config.go @@ -18,7 +18,7 @@ import ( var ( logger = log.Module("config") locker = sync.Mutex{} - defaultConfigUrl = "https://cfg.rpchub.io/agg/default.json" + DefaultConfigUrl = "https://cfg.rpchub.io/agg/default.json" defaultPhishingDb = "https://cfg.rpchub.io/agg/scam-addresses.json" _Config = &Config{ @@ -94,7 +94,7 @@ func LoadDefault() *Config { retries := 0 for { - statusCode, data, err := (&fasthttp.Client{}).GetTimeout(nil, defaultConfigUrl, time.Second*5) + statusCode, data, err := (&fasthttp.Client{}).GetTimeout(nil, DefaultConfigUrl, time.Second*5) if err == nil && statusCode == 200 { err = json.Unmarshal(data, &cfg) if err == nil { diff --git a/funding.json b/funding.json new file mode 100644 index 0000000..a8c8dbd --- /dev/null +++ b/funding.json @@ -0,0 +1,5 @@ +{ + "opRetro": { + "projectId": "0xc8baf94c13404f1f5f1fb13de286c052bae58919ca80fd2be5d61312be096b35" + } +}