From 91bfd9d6d08d43f225f954361567738208d1cb23 Mon Sep 17 00:00:00 2001 From: zhaochengpro <147230368+NeganZhao@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:34:18 +0800 Subject: [PATCH 1/4] Add op chain --- Makefile | 2 ++ README.md | 2 +- config/config.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b5fea5f..4d41476 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ 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/config.DefaultConfigUrl=$(CONFIG_URL) GOFLAGS = -ldflags "$(GOLDFLAGS)" all: 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..7b30d27 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 = "" 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 { From d5501298ad0bd23598c17a4f09775fdd03af2f9a Mon Sep 17 00:00:00 2001 From: zhaochengpro <147230368+NeganZhao@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:28:46 +0800 Subject: [PATCH 2/4] edit makefile --- Makefile | 13 ++++++++++--- config/config.go | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4d41476..00026a3 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +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/config.DefaultConfigUrl=$(CONFIG_URL) +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 + go build -ldflags "$(GOLDFLAGS)" -o ./build/ ./cmd/aggregator +build-op: + 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/config/config.go b/config/config.go index 7b30d27..b1bde1c 100644 --- a/config/config.go +++ b/config/config.go @@ -18,7 +18,7 @@ import ( var ( logger = log.Module("config") locker = sync.Mutex{} - DefaultConfigUrl = "" + DefaultConfigUrl = "https://cfg.rpchub.io/agg/default.json" defaultPhishingDb = "https://cfg.rpchub.io/agg/scam-addresses.json" _Config = &Config{ From 95fdcf33767a54e5c5529012a1b0a8c816e1ec89 Mon Sep 17 00:00:00 2001 From: zhaochengpro <147230368+NeganZhao@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:25:39 +0800 Subject: [PATCH 3/4] Update Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 00026a3..8c1d844 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,9 @@ all: build .PHONY: build build: - go build -ldflags "$(GOLDFLAGS)" -o ./build/ ./cmd/aggregator + CGO_ENABLED=0 go build -ldflags "$(GOLDFLAGS)" -o ./build/ ./cmd/aggregator build-op: - go build -ldflags "$(GOLDFLAGS) $(GO_OPLDFLAGS)" -o ./build/ ./cmd/aggregator + 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: From fbf3ba0b6cd3805c0bbd042b024c022b5488bb44 Mon Sep 17 00:00:00 2001 From: liwuv587 <99467354+liwuv587@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:02:34 +0800 Subject: [PATCH 4/4] Create funding.json --- funding.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 funding.json 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" + } +}