Compare commits

...

2 Commits

Author SHA1 Message Date
9c97ce2d2f
fix: load multiple registries via env 2025-03-13 12:20:10 +03:00
414b14a92e
docs: update README 2024-11-21 18:18:02 +03:00
4 changed files with 20 additions and 9 deletions

View File

@ -6,6 +6,9 @@ A fast and lightweight tracker designed to monitor EVM blockchains for live and
historical transaction events, including reverted transactions. It filters these
events and publishes them to NATS for further processing.
On a warmed up archive RPC node (HTTP) with the default config, it can process
in excess of 10k blocks/min utilizing not more than 50 MB of RAM.
It applies deduplication at the NATS level, making it safe to run in a
distributed fashion.
@ -36,8 +39,7 @@ The cache will auto-update based on any additions/removals from all indexes.
- Git
- Docker
- NATS server
- Redis server (Optional)
- Access to a Celo RPC node
- Access to an RPC node, archive preffered
See [docker-compose.yaml](dev/docker-compose.yaml) for an example on how to run
and deploy a single instance.
@ -55,7 +57,7 @@ docker buildx build --build-arg BUILD=$(git rev-parse --short HEAD) --tag eth-tr
docker images
```
### 2. Run NATS and Redis
### 2. Run NATS
For an example, see `dev/docker-compose.yaml`.

View File

@ -74,7 +74,7 @@ func main() {
cacheOpts := cache.CacheOpts{
Chain: chain,
Registries: []string{ko.MustString("bootstrap.ge_registry")},
Registries: ko.MustStrings("bootstrap.ge_registry"),
Watchlist: ko.Strings("bootstrap.watchlist"),
Blacklist: ko.Strings("bootstrap.blacklist"),
CacheType: ko.MustString("core.cache_type"),

View File

@ -27,7 +27,7 @@ start_block = 0
[bootstrap]
# This will bootstrap the cache on which addresses to track
ge_registry = "0x0f8E97ef2d6A42CF62549D4924FCBdcE83A1C6A5"
ge_registry = ["0x0f8E97ef2d6A42CF62549D4924FCBdcE83A1C6A5"]
watchlist = [""]
blacklist = [""]

View File

@ -41,13 +41,22 @@ func InitConfig(lo *slog.Logger, confFilePath string) *koanf.Koanf {
os.Exit(1)
}
if err := ko.Load(env.Provider("TRACKER_", ".", func(s string) string {
return strings.ReplaceAll(strings.ToLower(
strings.TrimPrefix(s, "TRACKER_")), "__", ".")
}), nil); err != nil {
err := ko.Load(env.ProviderWithValue("TRACKER_", ".", func(s string, v string) (string, interface{}) {
key := strings.ReplaceAll(strings.ToLower(strings.TrimPrefix(s, "TRACKER_")), "__", ".")
if strings.Contains(v, " ") {
return key, strings.Split(v, " ")
}
return key, v
}), nil)
if err != nil {
lo.Error("could not override config from env vars", "error", err)
os.Exit(1)
}
if os.Getenv("DEBUG") != "" {
ko.Print()
}
return ko
}