Go to file
optclblast 1d570773b6
Some checks failed
checks / check and test (push) Failing after 6m30s
+1
2024-08-11 05:28:02 +03:00
.gitea/workflows +1 2024-08-11 05:28:02 +03:00
.github/workflows init 2024-08-11 04:52:08 +03:00
cmd/app init 2024-08-11 04:52:08 +03:00
internal init 2024-08-11 04:52:08 +03:00
.dockerignore init 2024-08-11 04:52:08 +03:00
.gitignore init 2024-08-11 04:52:08 +03:00
.golangci-lint.yaml init 2024-08-11 04:52:08 +03:00
docker-compose.test.yaml init 2024-08-11 04:52:08 +03:00
docker-compose.yaml init 2024-08-11 04:52:08 +03:00
Dockerfile init 2024-08-11 04:52:08 +03:00
Dockerfile.test init 2024-08-11 04:52:08 +03:00
go.mod init 2024-08-11 04:52:08 +03:00
go.sum init 2024-08-11 04:52:08 +03:00
Makefile init 2024-08-11 04:52:08 +03:00
README.md init 2024-08-11 04:52:08 +03:00

BLK

Fetches an address with the largest balance delta over the last N ETH blocks

Build

Docker

  1. Install docker
  2. Create account at getblock.io and get an access token.
  3. In a root of the project, create .env file and fill it with the following:
BLK_GETBLOCK_ACCESS_TOKEN=my0access0toke0here ## Access token
BLK_LOG_LEVEL=info                            ## Log level [debug / info]
BLK_HTTP_ADDR=0.0.0.0:8085                    ## Listen address
  1. Build it
make up

Locally

min go version go1.22.3

make bin.build
BLK_GETBLOCK_ACCESS_TOKEN=TOKEN BLK_LOG_LEVEL=info BLK_HTTP_ADDR=0.0.0.0:8085 $(pwd)/build/blk

API

GET /most-changed?blocks=$1

Request parameters:

  • blocks - type: uint (optional). Limits amount of blocks chat will be checked from head.
    Default: 100, Max: 150

Example:

curl --request GET \
        --url 'http://localhost:8085/most-changed'

Response:

{
        "address": "0x3f0c3faeeeb9dad6ef6eb5fbab61039ff9067a07",
}

Testing

Run tests (docker)

make test

Lint

make get.tools
make lint