mirror of https://github.com/waku-org/nwaku.git
chore(store): collocate pagination and message store types
This commit is contained in:
parent
5ee4a00765
commit
612023fab0
|
@ -14,7 +14,6 @@ import
|
|||
libp2p/protocols/pubsub/rpc/message
|
||||
import
|
||||
../../waku/v1/node/rpc/hexstrings,
|
||||
../../waku/v2/node/storage/message/message_store,
|
||||
../../waku/v2/node/storage/message/waku_store_queue,
|
||||
../../waku/v2/node/wakunode2,
|
||||
../../waku/v2/node/jsonrpc/[store_api,
|
||||
|
|
|
@ -6,12 +6,10 @@ import
|
|||
testutils/unittests,
|
||||
nimcrypto/hash
|
||||
import
|
||||
../../waku/v2/node/storage/message/message_store,
|
||||
../../waku/v2/node/storage/message/waku_store_queue,
|
||||
../../waku/v2/protocol/waku_message,
|
||||
../../waku/v2/protocol/waku_store,
|
||||
../../waku/v2/utils/time,
|
||||
../../waku/v2/utils/pagination
|
||||
../../waku/v2/utils/time
|
||||
|
||||
|
||||
# Helper functions
|
||||
|
|
|
@ -9,8 +9,7 @@ import
|
|||
../../waku/v2/node/storage/message/waku_store_queue,
|
||||
../../waku/v2/protocol/waku_store,
|
||||
../../waku/v2/protocol/waku_message,
|
||||
../../waku/v2/utils/time,
|
||||
../../waku/v2/utils/pagination
|
||||
../../waku/v2/utils/time
|
||||
|
||||
|
||||
const
|
||||
|
|
|
@ -12,8 +12,8 @@ import
|
|||
../../waku/v2/node/storage/message/message_retention_policy_capacity,
|
||||
../../waku/v2/node/storage/sqlite,
|
||||
../../waku/v2/protocol/waku_message,
|
||||
../../waku/v2/protocol/waku_store/pagination,
|
||||
../../waku/v2/utils/time,
|
||||
../../waku/v2/utils/pagination,
|
||||
./utils
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ import
|
|||
../../waku/v2/node/storage/message/sqlite_store,
|
||||
../../waku/v2/node/storage/sqlite,
|
||||
../../waku/v2/protocol/waku_message,
|
||||
../../waku/v2/protocol/waku_store/pagination,
|
||||
../../waku/v2/utils/time,
|
||||
../../waku/v2/utils/pagination,
|
||||
./utils
|
||||
|
||||
|
||||
|
|
|
@ -12,11 +12,9 @@ import
|
|||
../../waku/v2/protocol/waku_message,
|
||||
../../waku/v2/protocol/waku_store,
|
||||
../../waku/v2/node/storage/sqlite,
|
||||
../../waku/v2/node/storage/message/message_store,
|
||||
../../waku/v2/node/storage/message/waku_store_queue,
|
||||
../../waku/v2/node/storage/message/sqlite_store,
|
||||
../../waku/v2/node/peer_manager/peer_manager,
|
||||
../../waku/v2/utils/pagination,
|
||||
../../waku/v2/utils/time,
|
||||
../test_helpers
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import
|
|||
import
|
||||
../../waku/v2/protocol/waku_message,
|
||||
../../waku/v2/protocol/waku_store,
|
||||
../../waku/v2/utils/pagination,
|
||||
../../waku/v2/utils/time
|
||||
|
||||
const
|
||||
|
|
|
@ -15,7 +15,6 @@ import
|
|||
libp2p/protocols/pubsub/gossipsub
|
||||
import
|
||||
../../waku/v2/node/storage/sqlite,
|
||||
../../waku/v2/node/storage/message/message_store,
|
||||
../../waku/v2/node/storage/message/sqlite_store,
|
||||
../../waku/v2/node/storage/message/waku_store_queue,
|
||||
../../waku/v2/protocol/waku_message,
|
||||
|
@ -23,7 +22,6 @@ import
|
|||
../../waku/v2/protocol/waku_filter,
|
||||
../../waku/v2/node/peer_manager/peer_manager,
|
||||
../../waku/v2/utils/peers,
|
||||
../../waku/v2/utils/pagination,
|
||||
../../waku/v2/utils/time,
|
||||
../../waku/v2/node/wakunode2
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import
|
|||
std/[options,tables],
|
||||
eth/keys,
|
||||
../../protocol/waku_message,
|
||||
../../utils/pagination,
|
||||
../../protocol/waku_store/pagination,
|
||||
../../utils/time
|
||||
|
||||
type
|
||||
|
|
|
@ -4,10 +4,9 @@ import
|
|||
std/[options, json],
|
||||
eth/keys,
|
||||
../../../v1/node/rpc/hexstrings,
|
||||
../../protocol/waku_store,
|
||||
../../protocol/waku_message,
|
||||
../../protocol/waku_store,
|
||||
../../utils/time,
|
||||
../../utils/pagination,
|
||||
../waku_payload,
|
||||
./jsonrpc_types
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import
|
|||
../wakunode2,
|
||||
../../protocol/waku_store,
|
||||
../../utils/time,
|
||||
../../utils/pagination,
|
||||
./jsonrpc_types,
|
||||
./jsonrpc_utils
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ import
|
|||
chronicles
|
||||
import
|
||||
../../../protocol/waku_message,
|
||||
../../../utils/pagination,
|
||||
../../../protocol/waku_store/pagination,
|
||||
../../../protocol/waku_store/message_store,
|
||||
../../../utils/time,
|
||||
../sqlite,
|
||||
./message_store,
|
||||
./waku_store_queue,
|
||||
./sqlite_store
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import
|
||||
stew/results
|
||||
import
|
||||
./message_store
|
||||
../../../protocol/waku_store/message_store
|
||||
|
||||
type RetentionPolicyResult*[T] = Result[T, string]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import
|
|||
stew/results,
|
||||
chronicles
|
||||
import
|
||||
./message_store,
|
||||
../../../protocol/waku_store/message_store,
|
||||
./message_retention_policy
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -6,8 +6,8 @@ import
|
|||
chronicles,
|
||||
chronos
|
||||
import
|
||||
../../../protocol/waku_store/message_store,
|
||||
../../../utils/time,
|
||||
./message_store,
|
||||
./message_retention_policy
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -5,8 +5,8 @@ import
|
|||
nimcrypto/sha2
|
||||
import
|
||||
../../../../protocol/waku_message,
|
||||
../../../../utils/time,
|
||||
../../../../utils/pagination
|
||||
../../../../protocol/waku_store/pagination,
|
||||
../../../../utils/time
|
||||
|
||||
|
||||
type Index* = object
|
||||
|
|
|
@ -7,9 +7,9 @@ import
|
|||
import
|
||||
../../../../protocol/waku_message,
|
||||
../../../../protocol/waku_store/rpc,
|
||||
../../../../utils/pagination,
|
||||
../../../../protocol/waku_store/pagination,
|
||||
../../../../protocol/waku_store/message_store,
|
||||
../../../../utils/time,
|
||||
../message_store,
|
||||
./index
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import
|
|||
import
|
||||
../../sqlite,
|
||||
../../../../protocol/waku_message,
|
||||
../../../../utils/pagination,
|
||||
../../../../protocol/waku_store/pagination,
|
||||
../../../../utils/time
|
||||
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@ import
|
|||
chronicles
|
||||
import
|
||||
../../../../protocol/waku_message,
|
||||
../../../../utils/pagination,
|
||||
../../../../protocol/waku_store/pagination,
|
||||
../../../../protocol/waku_store/message_store,
|
||||
../../../../utils/time,
|
||||
../../sqlite,
|
||||
../message_store,
|
||||
./queries
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -25,7 +25,6 @@ import
|
|||
../utils/[peers, requests, wakuenr],
|
||||
./peer_manager/peer_manager,
|
||||
./storage/message/waku_store_queue,
|
||||
./storage/message/message_store,
|
||||
./storage/message/message_retention_policy,
|
||||
./storage/message/message_retention_policy_capacity,
|
||||
./storage/message/message_retention_policy_time,
|
||||
|
@ -819,7 +818,6 @@ when isMainModule:
|
|||
./wakunode2_setup_rpc,
|
||||
./wakunode2_setup_sql_migrations,
|
||||
./storage/sqlite,
|
||||
./storage/message/message_store,
|
||||
./storage/message/dual_message_store,
|
||||
./storage/message/sqlite_store,
|
||||
./storage/peer/waku_peer_storage
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import
|
||||
./waku_store/protocol,
|
||||
./waku_store/rpc,
|
||||
./waku_store/rpc_codec
|
||||
./waku_store/rpc_codec,
|
||||
./waku_store/pagination,
|
||||
./waku_store/message_store
|
||||
|
||||
export
|
||||
protocol,
|
||||
rpc,
|
||||
rpc_codec
|
||||
rpc_codec,
|
||||
pagination,
|
||||
message_store
|
|
@ -7,9 +7,9 @@ import
|
|||
std/[options, times],
|
||||
stew/results
|
||||
import
|
||||
../../../protocol/waku_message,
|
||||
../../../utils/time,
|
||||
../../../utils/pagination
|
||||
../waku_message,
|
||||
./pagination,
|
||||
../../utils/time
|
||||
|
||||
|
||||
type
|
|
@ -5,8 +5,8 @@ import
|
|||
stew/byteutils,
|
||||
nimcrypto/sha2
|
||||
import
|
||||
../protocol/waku_message,
|
||||
./time
|
||||
../waku_message,
|
||||
../../utils/time
|
||||
|
||||
const
|
||||
MaxPageSize*: uint64 = 100
|
|
@ -15,17 +15,17 @@ import
|
|||
libp2p/stream/connection,
|
||||
metrics
|
||||
import
|
||||
../../node/storage/message/message_store,
|
||||
../../node/storage/message/message_retention_policy,
|
||||
../../node/storage/message/waku_store_queue,
|
||||
../../node/peer_manager/peer_manager,
|
||||
../../utils/time,
|
||||
../../utils/pagination,
|
||||
../../utils/requests,
|
||||
../waku_message,
|
||||
../waku_swap/waku_swap,
|
||||
./rpc,
|
||||
./rpc_codec
|
||||
./rpc_codec,
|
||||
./pagination,
|
||||
./message_store
|
||||
|
||||
|
||||
declarePublicGauge waku_store_messages, "number of historical messages", ["type"]
|
||||
|
|
|
@ -4,8 +4,8 @@ import
|
|||
nimcrypto/hash
|
||||
import
|
||||
../waku_message,
|
||||
../../utils/pagination,
|
||||
../../utils/time
|
||||
../../utils/time,
|
||||
./pagination
|
||||
|
||||
|
||||
type
|
||||
|
|
|
@ -7,9 +7,9 @@ import
|
|||
import
|
||||
../waku_message,
|
||||
../../utils/protobuf,
|
||||
../../utils/pagination,
|
||||
../../utils/time,
|
||||
./rpc
|
||||
./rpc,
|
||||
./pagination
|
||||
|
||||
|
||||
const MaxRpcSize* = MaxPageSize * MaxWakuMessageSize + 64*1024 # We add a 64kB safety buffer for protocol overhead
|
||||
|
|
Loading…
Reference in New Issue