Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration/Stellar #949

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
344e546
stellare trade scrapper
plcgi1 Jan 11, 2024
c6cdefc
trade collector fixes
plcgi1 Jan 11, 2024
9b3ed2f
stellar exchange trade scrapper logic
plcgi1 Jan 15, 2024
dca5b01
stellar exchange trade scrapper.improved logs
plcgi1 Jan 15, 2024
5fc2b39
introduce Stellar liquidity scraper
koteld Jan 15, 2024
a96ff2d
pkg/dia/stellarhelper
plcgi1 Jan 15, 2024
7c2920c
GetStellarAssetInfo, added timeout for toml reader
plcgi1 Jan 15, 2024
5eb7ef4
introduce using DB cache for assets
koteld Jan 16, 2024
e9d1700
stellar-helper can cache assets in DB
plcgi1 Jan 16, 2024
f4b2e58
StellarAssetInfo. added ConcatStrings
plcgi1 Jan 16, 2024
65d76d7
StellarAssetInfo. if name not defined in toml - set it from symbol
plcgi1 Jan 17, 2024
850b7d4
introduce Stellar asset collector
koteld Jan 17, 2024
f20f8e7
update Stellar LP scraper: set default values and refactoring
koteld Jan 17, 2024
b59aa90
StellarAssetInfo.improved logs
plcgi1 Jan 17, 2024
d7e18d4
Merge branch 'intergation/stellar-dia' of github.com:protofire/diadat…
plcgi1 Jan 17, 2024
d160392
exchange-scraper.removed deps with db from StellarAssetInfo and excha…
plcgi1 Jan 17, 2024
7f4b65f
exchange-scraper.removed comment
plcgi1 Jan 17, 2024
5491fb9
update Stellar scrapers' env and horizon client values
koteld Jan 17, 2024
8e93363
add GetenvUint method to parse uint env variables
koteld Jan 17, 2024
0a98a82
Stellar Asset info module refactoring
koteld Jan 17, 2024
c9dd35b
add request limit and default request values to Stellar asset collector
koteld Jan 17, 2024
dfce231
add request limit and default request values to Stellar LP scraper
koteld Jan 17, 2024
0871031
refactoring of Stellar AssetInfo module
koteld Jan 17, 2024
61eee5f
update dependencies for asset collection service; go 1.17 -> 1.21
koteld Jan 17, 2024
8025d68
makefile for exchange-scraper-collector
plcgi1 Jan 18, 2024
81f5f82
build/Dockerfile-genericCollector.commented golang versions
plcgi1 Jan 18, 2024
0495dde
add support for Lumen - Stellar native token
koteld Jan 19, 2024
eac6795
add support of native Stellar token to LP scraper, code refactoring
koteld Jan 19, 2024
7b07ced
add support of native Stellar token to Trades scraper, code refactoring
koteld Jan 19, 2024
b2b41ae
add support of native Stellar token to Asset collector, code refactoring
koteld Jan 19, 2024
78a7510
update Makefile, add missing scripts
koteld Jan 19, 2024
fa8c98e
add Dockerfiles to build image with golang:1.21
koteld Jan 19, 2024
0e926dd
update liquidityScrapers and pairDiscoveryService Dockerfiles: got ri…
koteld Jan 19, 2024
f2ec892
code refactoring
koteld Jan 19, 2024
7c2feda
update exchange scrapers collector service dependencies to go v1.21
koteld Jan 19, 2024
036a177
update liquidity scraper service dependencies to go v1.21
koteld Jan 19, 2024
90ce2a8
update project dependencies to go v1.21
koteld Jan 19, 2024
94c8074
update testenv.sh
koteld Jan 19, 2024
289f0be
Merge remote-tracking branch 'protofire/master' into intergation/stel…
koteld Jan 19, 2024
091efc0
update asset collector service go.mod
koteld Jan 19, 2024
1b9c8e2
addressing DeepSource issues and code refactoring and update logging
koteld Jan 19, 2024
6c0bc1c
stellar exchange,liquidity scrappers and asset-collector can be manag…
plcgi1 Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .run/Build - Run - KuCoin.run.xml

This file was deleted.

81 changes: 81 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
## needs to generate docs
# include .env

Command := $(firstword $(MAKECMDGOALS))
# Skips the first word
Arguments := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))

PROJECTNAME=$(shell basename "$(PWD)")

# Go related variables.
GOBASE=$(shell pwd)
GOPATH=${HOME}/go
GOBIN=$(GOBASE)/bin
GOFILES=$(wildcard *.go)

# Redirect error output to a file, so we can show it in development mode.
STDERR=/tmp/.$(PROJECTNAME)-stderr.txt

# PID file will keep the process id of the server
PID=/tmp/.$(PROJECTNAME).pid

# Make is verbose in Linux. Make it silent.
MAKEFLAGS += --silent

## install: Install missing dependencies. Runs `go get` internally. e.g; make install get=github.com/foo/bar
install: go-get

## build-exchange-collector: Build the binary for cmd/exchange-scrapers/collector/collector
build-exchange-collector:
@cd ./cmd/exchange-scrapers/collector && go build

## build-liquidity-scraper: Build the binary for cmd/liquidityScraper
build-liquidity-scraper:
@cd ./cmd/liquidityScraper && go build

## build-asset-collector: Build the binary for cmd/assetCollectionService
build-asset-collector:
@cd ./cmd/assetCollectionService && go build

## run-exchange-collector-service: Run exchange collector scraper
run-exchange-collector-service:
@go run ./cmd/exchange-scrapers/collector/collector.go -exchange $(Arguments)

## run-liquidity-scraper-service: Run liquidity pools scraper
run-liquidity-scraper-service:
@go run ./cmd/liquidityScraper/main.go -exchange $(Arguments)

## run-asset-collector-service: Run asset collector
run-asset-collector-service:
@go run ./cmd/assetCollectionService/main.go -source $(Arguments)

## exec: Run given command, wrapped with custom GOPATH. e.g; make exec run="go test ./..."
exec:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) $(run)

## clean: Clean build files. Runs `go clean` internally.
clean: go-clean

go-compile: go-clean go-get go-build

go-get:
@echo " > Checking if there is any missing dependencies..."
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go get $(get)

go-install:
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go install $(GOFILES)

go-clean:
@echo " > Cleaning build cache"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go clean

.PHONY: help

all: help

help: Makefile
@echo
@echo " Choose a command run in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
4 changes: 3 additions & 1 deletion build/Dockerfile-genericCollector
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ FROM us.icr.io/dia-registry/devops/build-117:latest as build
WORKDIR $GOPATH/src/

COPY ./cmd/exchange-scrapers/collector ./
RUN go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install
# TODO remove next line ?
# RUN go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install
RUN go mod tidy && go install

FROM gcr.io/distroless/base

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-liquidityScraper
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM us.icr.io/dia-registry/devops/build-117:latest as build
WORKDIR $GOPATH/src/

COPY ./cmd/liquidityScraper ./
RUN go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install
RUN go mod tidy && go install

FROM gcr.io/distroless/base

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile-pairDiscoveryService
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM us.icr.io/dia-registry/devops/build-117:latest as build
WORKDIR $GOPATH/src/

COPY ./cmd/services/pairDiscoveryService ./
RUN go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install
RUN go mod tidy && go install

FROM gcr.io/distroless/base

Expand Down
12 changes: 12 additions & 0 deletions build/build/Dockerfile-DiadataBuild-121
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.21 as build

WORKDIR $GOPATH/src/
ENV GO111MODULE="on"

RUN apt update && apt upgrade -y

COPY ./config/ /config/
COPY ./go.mod ./
RUN go mod download

RUN go get github.com/karalabe/[email protected]
13 changes: 13 additions & 0 deletions build/build/Dockerfile-DiadataBuild-121-Dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM public.ecr.aws/docker/library/golang:1.21 as build

RUN apt update && apt upgrade -y

COPY ./config/ /config/

WORKDIR $GOPATH/src/
COPY ./go.mod ./

ENV GO111MODULE="on"
RUN go mod download

RUN go get github.com/karalabe/[email protected]
106 changes: 62 additions & 44 deletions cmd/assetCollectionService/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/diadata-org/diadata/assetCollectionService

go 1.17
go 1.21

toolchain go1.21.4

require (
github.com/diadata-org/diadata v1.4.424
Expand All @@ -11,6 +13,7 @@ require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/DataDog/zstd v1.4.5 // indirect
github.com/GeertJohan/go.rice v1.0.0 // indirect
Expand All @@ -19,7 +22,7 @@ require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/adshao/go-binance/v2 v2.3.6 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect
github.com/beldur/kraken-go-api-client v0.0.0-20200330152217-ed78f31b987e // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -30,7 +33,7 @@ require (
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/confio/ics23/go v0.7.0 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/cosmos-sdk v0.45.1 // indirect
Expand All @@ -42,24 +45,26 @@ require (
github.com/cryptwire/go-binance/v2 v2.2.3 // indirect
github.com/daaku/go.zipexe v1.0.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/dgraph-io/badger/v2 v2.2007.3 // indirect
github.com/dgraph-io/ristretto v0.0.3 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/ethereum/go-ethereum v1.10.10 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gagliardetto/binary v0.7.9 // indirect
github.com/gagliardetto/metaplex-go v0.2.1 // indirect
github.com/gagliardetto/solana-go v1.8.1 // indirect
github.com/gagliardetto/treeout v0.1.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-redis/redis v6.15.9+incompatible // indirect
Expand All @@ -70,21 +75,22 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/rpc v1.2.0 // indirect
github.com/gorilla/schema v1.2.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.8.1 // indirect
Expand All @@ -98,52 +104,61 @@ require (
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.7 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 // indirect
github.com/osmosis-labs/osmosis/v6 v6.4.1 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/preichenberger/go-coinbasepro/v2 v2.0.5 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.30.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
github.com/segmentio/go-loggly v0.5.1-0.20171222203950-eb91657e62b2 // indirect
github.com/segmentio/kafka-go v0.4.35 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cobra v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.1 // indirect
github.com/spf13/viper v1.17.0 // indirect
github.com/stellar/go v0.0.0-20240103174627-38f67b9ee0c9 // indirect
github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 // indirect
github.com/streamingfast/binary v0.0.0-20210928223119-44fc44e4a0b5 // indirect
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect
github.com/streamingfast/solana-go v0.5.1-0.20220502224452-432fbe84aee8 // indirect
github.com/stretchr/testify v1.8.1 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/btcd v0.1.1 // indirect
Expand All @@ -163,20 +178,23 @@ require (
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/ratelimit v0.2.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.4.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading