mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2025-04-17 22:41:00 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
9c97ce2d2f | |||
414b14a92e |
@ -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
|
historical transaction events, including reverted transactions. It filters these
|
||||||
events and publishes them to NATS for further processing.
|
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
|
It applies deduplication at the NATS level, making it safe to run in a
|
||||||
distributed fashion.
|
distributed fashion.
|
||||||
|
|
||||||
@ -36,8 +39,7 @@ The cache will auto-update based on any additions/removals from all indexes.
|
|||||||
- Git
|
- Git
|
||||||
- Docker
|
- Docker
|
||||||
- NATS server
|
- NATS server
|
||||||
- Redis server (Optional)
|
- Access to an RPC node, archive preffered
|
||||||
- Access to a Celo RPC node
|
|
||||||
|
|
||||||
See [docker-compose.yaml](dev/docker-compose.yaml) for an example on how to run
|
See [docker-compose.yaml](dev/docker-compose.yaml) for an example on how to run
|
||||||
and deploy a single instance.
|
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
|
docker images
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Run NATS and Redis
|
### 2. Run NATS
|
||||||
|
|
||||||
For an example, see `dev/docker-compose.yaml`.
|
For an example, see `dev/docker-compose.yaml`.
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ func main() {
|
|||||||
|
|
||||||
cacheOpts := cache.CacheOpts{
|
cacheOpts := cache.CacheOpts{
|
||||||
Chain: chain,
|
Chain: chain,
|
||||||
Registries: []string{ko.MustString("bootstrap.ge_registry")},
|
Registries: ko.MustStrings("bootstrap.ge_registry"),
|
||||||
Watchlist: ko.Strings("bootstrap.watchlist"),
|
Watchlist: ko.Strings("bootstrap.watchlist"),
|
||||||
Blacklist: ko.Strings("bootstrap.blacklist"),
|
Blacklist: ko.Strings("bootstrap.blacklist"),
|
||||||
CacheType: ko.MustString("core.cache_type"),
|
CacheType: ko.MustString("core.cache_type"),
|
||||||
|
@ -27,7 +27,7 @@ start_block = 0
|
|||||||
|
|
||||||
[bootstrap]
|
[bootstrap]
|
||||||
# This will bootstrap the cache on which addresses to track
|
# This will bootstrap the cache on which addresses to track
|
||||||
ge_registry = "0x0f8E97ef2d6A42CF62549D4924FCBdcE83A1C6A5"
|
ge_registry = ["0x0f8E97ef2d6A42CF62549D4924FCBdcE83A1C6A5"]
|
||||||
watchlist = [""]
|
watchlist = [""]
|
||||||
blacklist = [""]
|
blacklist = [""]
|
||||||
|
|
||||||
|
@ -41,13 +41,22 @@ func InitConfig(lo *slog.Logger, confFilePath string) *koanf.Koanf {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ko.Load(env.Provider("TRACKER_", ".", func(s string) string {
|
err := ko.Load(env.ProviderWithValue("TRACKER_", ".", func(s string, v string) (string, interface{}) {
|
||||||
return strings.ReplaceAll(strings.ToLower(
|
key := strings.ReplaceAll(strings.ToLower(strings.TrimPrefix(s, "TRACKER_")), "__", ".")
|
||||||
strings.TrimPrefix(s, "TRACKER_")), "__", ".")
|
if strings.Contains(v, " ") {
|
||||||
}), nil); err != nil {
|
return key, strings.Split(v, " ")
|
||||||
|
}
|
||||||
|
return key, v
|
||||||
|
}), nil)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
lo.Error("could not override config from env vars", "error", err)
|
lo.Error("could not override config from env vars", "error", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if os.Getenv("DEBUG") != "" {
|
||||||
|
ko.Print()
|
||||||
|
}
|
||||||
|
|
||||||
return ko
|
return ko
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user