Skip to content

Commit

Permalink
Merge pull request #68 from samcm/feat/sse-events
Browse files Browse the repository at this point in the history
WIP: feat: Publish events via SSE
  • Loading branch information
cortze authored Mar 20, 2024
2 parents 1f69e06 + f7c96d4 commit e1a8975
Show file tree
Hide file tree
Showing 15 changed files with 402 additions and 53 deletions.
1 change: 1 addition & 0 deletions .env_template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CRAWLER_PORT="9020"
CRAWLER_METRICS_PORT="9080"
CRAWLER_SSE_PORT="9099"
DB_PORT="5433"
CRAWLER_LOG_LEVEL="info"
CRAWLER_PSQL_ENDP="postgres://user:password@db:5432/armiarmadb"
Expand Down
10 changes: 10 additions & 0 deletions cmd/ethereum_crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ var Eth2CrawlerCommand = &cli.Command{
Usage: "Path of the file that has the pubkeys of those validators that we want to track (experimental)",
EnvVars: []string{"ARMIARMA_VAL_PUBKEYS"},
},
&cli.StringFlag{
Name: "sse-ip",
Usage: "IP to expose the SSE server",
EnvVars: []string{"ARMIARMA_SSE_IP"},
},
&cli.StringFlag{
Name: "sse-port",
Usage: "Port to expose the SSE server",
EnvVars: []string{"ARMIARMA_SSE_PORT"},
},
},
}

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ services:
ports:
- "${CRAWLER_PORT}:9020"
- "127.0.0.1:${CRAWLER_METRICS_PORT}:9080"
- "${CRAWLER_SSE_PORT}:9099"
25 changes: 12 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ require (
github.com/prometheus/client_golang v1.11.0
github.com/protolambda/zrnt v0.30.0
github.com/protolambda/ztyp v0.2.2
github.com/r3labs/sse/v2 v2.10.0
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.1
github.com/urfave/cli/v2 v2.3.0
go.etcd.io/bbolt v1.3.3
go.opencensus.io v0.23.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sync v0.1.0
)

require (
Expand All @@ -37,7 +37,6 @@ require (
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cheekybits/genny v1.0.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
Expand All @@ -48,6 +47,7 @@ require (
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand All @@ -68,7 +68,7 @@ require (
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.9.1 // indirect
github.com/jackc/puddle v1.2.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
Expand Down Expand Up @@ -112,7 +112,7 @@ require (
github.com/marten-seemann/qtls-go1-16 v0.1.4 // indirect
github.com/marten-seemann/qtls-go1-17 v0.1.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
Expand All @@ -123,7 +123,6 @@ require (
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multiaddr-net v0.2.0 // indirect
github.com/multiformats/go-multibase v0.0.3 // indirect
github.com/multiformats/go-multicodec v0.2.0 // indirect
github.com/multiformats/go-multihash v0.0.15 // indirect
Expand All @@ -148,15 +147,15 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading

0 comments on commit e1a8975

Please sign in to comment.