diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..adc3e5e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: continuous integration + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + go-version: [1.21, 1.22] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go-version }}- + + - name: Install dependencies + run: go mod download + + - name: Check Go fmt + run: | + if ! go fmt ./...; then + echo "Go fmt check failed" + exit 1 + fi + + - name: Run Go vet + run: go vet ./... + + - name: Run tests + run: go test ./... -v -cover diff --git a/README.md b/README.md index 4ba5d59..88fa7ed 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ -# Ants +# Ants Watch Celestia Lightnode Population Monitor. -Author: [guillaumemichel](https://github.com/guillaumemichel) +Ants Watch + +Authors: [guillaumemichel](https://github.com/guillaumemichel), [kasteph](https://github.com/kasteph) ## Setup Before installing dependencies: ``` shell -$ git submodule init -$ git submodule update --init --recursive --remote +git submodule init +git submodule update --init --recursive --remote ``` Then, `go mod tidy`. diff --git a/go.mod b/go.mod index 8f8eaf7..fbbf6f8 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,8 @@ replace ( go 1.23.1 +toolchain go1.23.2 + require ( github.com/friendsofgo/errors v0.9.2 github.com/golang-migrate/migrate/v4 v4.18.1 @@ -91,7 +93,7 @@ require ( github.com/huin/goupnp v1.3.0 // indirect github.com/ipfs/boxo v0.24.0 // indirect github.com/ipfs/go-cid v0.4.1 - github.com/ipfs/go-datastore v0.6.0 // indirect + github.com/ipfs/go-datastore v0.6.0 github.com/ipfs/go-log/v2 v2.5.1 github.com/ipld/go-ipld-prime v0.21.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect @@ -170,7 +172,7 @@ require ( go.uber.org/fx v1.22.2 // indirect go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect + go.uber.org/zap v1.27.0 golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect golang.org/x/mod v0.21.0 // indirect diff --git a/queen.go b/queen.go index 6a4bb0b..c6f1444 100644 --- a/queen.go +++ b/queen.go @@ -73,7 +73,7 @@ func NewQueen(ctx context.Context, dbConnString string, keysDbPath string, nPort dbPort, err := strconv.Atoi(os.Getenv("DB_PORT")) if err != nil { - fmt.Errorf("Port must be an integer", err) + logger.Errorf("Port must be an integer", err) } mP, _ := tele.NewMeterProvider() diff --git a/resources/ants.png b/resources/ants.png new file mode 100644 index 0000000..04788aa Binary files /dev/null and b/resources/ants.png differ