mirror of
https://github.com/logos-messaging/message-finder.git
synced 2026-01-07 16:33:07 +00:00
fix: time
This commit is contained in:
parent
065a8b4a67
commit
3e9f79074a
@ -1,8 +1,8 @@
|
|||||||
FROM golang:1.21 as builder
|
FROM golang:1.21 as builder
|
||||||
|
|
||||||
RUN mkdir -p /go/src/github.com/waku-org/test-waku-query/go
|
RUN mkdir -p /go/src/github.com/waku-org/message-finder
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/waku-org/test-waku-query/go
|
WORKDIR /go/src/github.com/waku-org/message-finder
|
||||||
|
|
||||||
ADD . .
|
ADD . .
|
||||||
|
|
||||||
@ -11,11 +11,11 @@ RUN make
|
|||||||
# Copy the binary to the second image
|
# Copy the binary to the second image
|
||||||
FROM debian:12.5-slim
|
FROM debian:12.5-slim
|
||||||
|
|
||||||
LABEL source="https://github.com/waku-org/test-waku-query/go"
|
LABEL source="https://github.com/waku-org/message-finder"
|
||||||
LABEL description="Storenode query tool"
|
LABEL description="Storenode query tool"
|
||||||
LABEL commit="unknown"
|
LABEL commit="unknown"
|
||||||
|
|
||||||
COPY --from=builder /go/src/github.com/waku-org/test-waku-query/go/build/query /usr/local/bin/query
|
COPY --from=builder /go/src/github.com/waku-org/message-finder/build/query /usr/local/bin/query
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/query"]
|
ENTRYPOINT ["/usr/local/bin/query"]
|
||||||
CMD ["-help"]
|
CMD ["-help"]
|
||||||
|
|||||||
10
README.md
10
README.md
@ -83,7 +83,10 @@ MessageHash Content Topi
|
|||||||
|
|
||||||
To see the content of a message
|
To see the content of a message
|
||||||
```
|
```
|
||||||
./build/query --cluster-id=16 --storenode=/dns4/store-01.do-ams3.shards.test.status.im/tcp/30303/p2p/16Uiu2HAmAUdrQ3uwzuE4Gy4D56hX6uLKEeerJAnhKEHZ3DxF1EfT --hash 0xacb469e0464aa6ebe7847807bf856c05a7ed3d26c5813f76c206ff9706eb686b
|
./build/query \
|
||||||
|
--cluster-id=16 \
|
||||||
|
--storenode=/dns4/store-01.do-ams3.shards.test.status.im/tcp/30303/p2p/16Uiu2HAmAUdrQ3uwzuE4Gy4D56hX6uLKEeerJAnhKEHZ3DxF1EfT \
|
||||||
|
--hash 0xacb469e0464aa6ebe7847807bf856c05a7ed3d26c5813f76c206ff9706eb686b
|
||||||
|
|
||||||
PubsubTopic: 0xc000350830
|
PubsubTopic: 0xc000350830
|
||||||
MessageHash: 0xacb469e0464aa6ebe7847807bf856c05a7ed3d26c5813f76c206ff9706eb686b
|
MessageHash: 0xacb469e0464aa6ebe7847807bf856c05a7ed3d26c5813f76c206ff9706eb686b
|
||||||
@ -104,7 +107,6 @@ Payload:
|
|||||||
00000090 7f d0 aa 56 03 ca 49 eb ef 08 9a ef ca 12 85 72 |...V..I........r|
|
00000090 7f d0 aa 56 03 ca 49 eb ef 08 9a ef ca 12 85 72 |...V..I........r|
|
||||||
000000a0 b0 47 79 2b 28 50 06 7d 89 69 d8 85 8e 3c 7f cb |.Gy+(P.}.i...<..|
|
000000a0 b0 47 79 2b 28 50 06 7d 89 69 d8 85 8e 3c 7f cb |.Gy+(P.}.i...<..|
|
||||||
|
|
||||||
Meta: <nil>
|
|
||||||
Meta: <nil>
|
Meta: <nil>
|
||||||
RateLimitProof: <nil>
|
RateLimitProof: <nil>
|
||||||
```
|
```
|
||||||
@ -112,10 +114,10 @@ RateLimitProof: <nil>
|
|||||||
### Docker
|
### Docker
|
||||||
```
|
```
|
||||||
# Build
|
# Build
|
||||||
docker build -t querytool:latest .
|
docker build -t storequery:latest .
|
||||||
|
|
||||||
# Execute
|
# Execute
|
||||||
docker run querytool:latest \
|
docker run storequery:latest \
|
||||||
--cluster-id=16 \
|
--cluster-id=16 \
|
||||||
--storenode=/dns4/store-01.do-ams3.shards.test.status.im/tcp/30303/p2p/16Uiu2HAmAUdrQ3uwzuE4Gy4D56hX6uLKEeerJAnhKEHZ3DxF1EfT \
|
--storenode=/dns4/store-01.do-ams3.shards.test.status.im/tcp/30303/p2p/16Uiu2HAmAUdrQ3uwzuE4Gy4D56hX6uLKEeerJAnhKEHZ3DxF1EfT \
|
||||||
--pubsub-topic=/waku/2/rs/16/32 \
|
--pubsub-topic=/waku/2/rs/16/32 \
|
||||||
|
|||||||
2
go.mod
2
go.mod
@ -9,7 +9,6 @@ require (
|
|||||||
github.com/libp2p/go-libp2p v0.35.0
|
github.com/libp2p/go-libp2p v0.35.0
|
||||||
github.com/multiformats/go-multiaddr v0.12.4
|
github.com/multiformats/go-multiaddr v0.12.4
|
||||||
github.com/rodaine/table v1.2.0
|
github.com/rodaine/table v1.2.0
|
||||||
github.com/stretchr/testify v1.9.0
|
|
||||||
github.com/urfave/cli/v2 v2.27.2
|
github.com/urfave/cli/v2 v2.27.2
|
||||||
github.com/waku-org/go-waku v0.8.1-0.20240605190333-d2d2f5672ebd
|
github.com/waku-org/go-waku v0.8.1-0.20240605190333-d2d2f5672ebd
|
||||||
go.uber.org/zap v1.27.0
|
go.uber.org/zap v1.27.0
|
||||||
@ -119,6 +118,7 @@ require (
|
|||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
|
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
|
github.com/stretchr/testify v1.9.0 // indirect
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
|
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
|
||||||
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
||||||
github.com/tklauser/numcpus v0.2.2 // indirect
|
github.com/tklauser/numcpus v0.2.2 // indirect
|
||||||
|
|||||||
19
main.go
19
main.go
@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/waku-org/go-waku/waku/v2/utils"
|
"github.com/waku-org/go-waku/waku/v2/utils"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
"google.golang.org/protobuf/proto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
@ -242,6 +241,16 @@ func QueryMessages(ctx context.Context, opts Options) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var StartTime *int64
|
||||||
|
if options.StartTime > 0 {
|
||||||
|
StartTime = &options.StartTime
|
||||||
|
}
|
||||||
|
|
||||||
|
var EndTime *int64
|
||||||
|
if options.EndTime > 0 {
|
||||||
|
EndTime = &options.EndTime
|
||||||
|
}
|
||||||
|
|
||||||
cnt := 0
|
cnt := 0
|
||||||
if !options.UseLegacy {
|
if !options.UseLegacy {
|
||||||
var criteria store.Criteria
|
var criteria store.Criteria
|
||||||
@ -249,8 +258,8 @@ func QueryMessages(ctx context.Context, opts Options) error {
|
|||||||
if len(hashes) == 0 {
|
if len(hashes) == 0 {
|
||||||
criteria = store.FilterCriteria{
|
criteria = store.FilterCriteria{
|
||||||
ContentFilter: protocol.NewContentFilter(options.PubSubTopic, options.ContentTopics.Value()...),
|
ContentFilter: protocol.NewContentFilter(options.PubSubTopic, options.ContentTopics.Value()...),
|
||||||
TimeStart: proto.Int64(options.StartTime),
|
TimeStart: StartTime,
|
||||||
TimeEnd: proto.Int64(options.EndTime),
|
TimeEnd: EndTime,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
criteria = store.MessageHashCriteria{
|
criteria = store.MessageHashCriteria{
|
||||||
@ -313,8 +322,8 @@ func QueryMessages(ctx context.Context, opts Options) error {
|
|||||||
query := legacy_store.Query{
|
query := legacy_store.Query{
|
||||||
PubsubTopic: options.PubSubTopic,
|
PubsubTopic: options.PubSubTopic,
|
||||||
ContentTopics: options.ContentTopics.Value(),
|
ContentTopics: options.ContentTopics.Value(),
|
||||||
StartTime: proto.Int64(options.StartTime),
|
StartTime: StartTime,
|
||||||
EndTime: proto.Int64(options.EndTime),
|
EndTime: EndTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), options.QueryTimeout)
|
ctx, cancel := context.WithTimeout(context.Background(), options.QueryTimeout)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user