Skip to content

Commit c92e6d4

Browse files
authored
Implement observer with SQL query support and parquet export (#744)
Implement an F3 observer that: * listens to F3 gossipsub messages * collects them as long as they can be decoded as CBOR * offers a SQL interface to query them over a HTTP * rotates them into Parquet files * deletes any rotated files based on a configured maximum age Fix base image to distroless/cc because of duckdb libstdc++ dependencies.
1 parent b1869c1 commit c92e6d4

File tree

18 files changed

+1102
-603
lines changed

18 files changed

+1102
-603
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ coverage.txt
88
/f3
99
# f3 manifest
1010
/manifest.json
11-
/observer

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ COPY go.mod go.sum ./
66
RUN go mod download
77

88
COPY . .
9-
RUN CGO_ENABLED=0 go build -o /go/bin/f3 ./cmd/f3
9+
RUN go build -o /go/bin/f3 ./cmd/f3
1010

11-
FROM gcr.io/distroless/static-debian11
11+
FROM gcr.io/distroless/cc
1212
COPY --from=build /go/bin/f3 /usr/bin/
1313

1414
ENTRYPOINT ["/usr/bin/f3"]

cmd/f3/manifest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"time"
1010

11+
"github.com/filecoin-project/go-f3/internal/psutil"
1112
"github.com/filecoin-project/go-f3/manifest"
1213
"github.com/libp2p/go-libp2p"
1314
pubsub "github.com/libp2p/go-libp2p-pubsub"
@@ -217,7 +218,7 @@ var manifestServeCmd = cli.Command{
217218
pubSub, err := pubsub.NewGossipSub(c.Context, host,
218219
pubsub.WithPeerExchange(true),
219220
pubsub.WithFloodPublish(true),
220-
pubsub.WithPeerScore(PubsubPeerScoreParams, PubsubPeerScoreThresholds),
221+
pubsub.WithPeerScore(psutil.PubsubPeerScoreParams, psutil.PubsubPeerScoreThresholds),
221222
)
222223
if err != nil {
223224
return fmt.Errorf("initialzing pubsub: %w", err)

cmd/f3/msgdump/envelope.go

Lines changed: 0 additions & 75 deletions
This file was deleted.

cmd/f3/msgdump/parquet.go

Lines changed: 0 additions & 91 deletions
This file was deleted.

cmd/f3/msgdump/parquet_test.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

cmd/f3/msgdump/writer.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)