moare project structure reorg

This commit is contained in:
Dmitriy Ryajov 2021-08-30 13:04:24 -06:00
parent 231276d6fe
commit 99f87b94b8
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
27 changed files with 57 additions and 49 deletions

11
dagger/blockexchange.nim Normal file
View File

@ -0,0 +1,11 @@
import ./blockexchange/[
network,
engine,
peercontext]
import ./blockexchange/protobuf/[
blockexc,
payments,
presence]
export network, engine, peercontext, blockexc, payments, presence

BIN
dagger/blockexchange.out Executable file

Binary file not shown.

View File

@ -15,18 +15,19 @@ import pkg/chronicles
import pkg/libp2p
import pkg/libp2p/errors
import ../stores/blockstore
import ../blocktype as bt
import ../utils/asyncheapqueue
import ./protobuf/blockexc
import ./protobuf/presence
import ../../blocktype as bt
import ../blockstore
import ../../utils/asyncheapqueue
import ./network
import ./pendingblocks
import ./peercontext
import ./engine/payments
export peercontext
export peercontext, payments, pendingblocks
logScope:
topics = "dagger blockexc engine"

View File

@ -16,13 +16,12 @@ import pkg/libp2p
import pkg/questionable
import pkg/questionable/results
import ../../blocktype as bt
import ../blocktype as bt
import ./protobuf/blockexc as pb
import ./protobuf/payments
import ./networkpeer
export networkpeer
export payments
export networkpeer, payments
logScope:
topics = "dagger blockexc network"

View File

@ -8,8 +8,7 @@ import ./protobuf/blockexc
import ./protobuf/payments
import ./protobuf/presence
export payments
export nitro
export payments, nitro
type
BlockExcPeerCtx* = ref object of RootObj

View File

@ -13,7 +13,7 @@ import pkg/chronicles
import pkg/chronos
import pkg/libp2p
import ../../blocktype
import ../blocktype
logScope:
topics = "dagger blockexc pendingblocks"

3
dagger/stores.nim Normal file
View File

@ -0,0 +1,3 @@
import ./stores/[memorystore, blockstore, blockexchange]
export memorystore, blockstore, blockexchange

View File

@ -14,15 +14,16 @@ import pkg/chronos
import pkg/libp2p
import pkg/libp2p/errors
import ./stores/network/protobuf/blockexc as pb
import ./blocktype as bt
import ./stores/blockstore
import ./utils/asyncheapqueue
import ../blocktype as bt
import ../utils/asyncheapqueue
import ./stores/network/network
import ./stores/network/engine
import ./blockstore
import ../blockexchange/network
import ../blockexchange/engine
import ../blockexchange/peercontext
import ../blockexchange/protobuf/blockexc as pb
export network, blockstore, asyncheapqueue, engine
export blockstore, network, engine, asyncheapqueue
logScope:
topics = "dagger blockexc"

View File

@ -1,5 +1,6 @@
import std/unittest
import pkg/dagger/stores/network/engine/payments
import pkg/dagger/stores
import ../../examples
suite "engine payments":

View File

@ -2,7 +2,7 @@ import pkg/asynctest
import pkg/chronos
import pkg/stew/byteutils
import ../../examples
import pkg/dagger/stores/network/protobuf/payments
import pkg/dagger/stores
suite "account protobuf messages":

View File

@ -2,7 +2,8 @@ import std/sequtils
import pkg/asynctest
import pkg/chronos
import pkg/libp2p
import pkg/dagger/stores/network/protobuf/presence
import pkg/dagger/blockexchange/protobuf/presence
import ../../examples
suite "block presence protobuf messages":

View File

@ -8,14 +8,11 @@ import pkg/libp2p
import pkg/libp2p/errors
import pkg/dagger/rng
import pkg/dagger/blockexc
import pkg/dagger/stores/network/protobuf/blockexc as pb
import pkg/dagger/stores/network/pendingblocks
import pkg/dagger/stores/network/engine/payments
import pkg/dagger/stores/network/protobuf/presence
import pkg/dagger/stores/memorystore
import pkg/dagger/blockexchange
import pkg/dagger/stores
import pkg/dagger/chunker
import pkg/dagger/blocktype as bt
import pkg/dagger/utils/asyncheapqueue
import ../helpers
import ../examples

View File

@ -5,15 +5,14 @@ import pkg/asynctest
import pkg/chronos
import pkg/libp2p
import pkg/libp2p/errors
import questionable
import questionable/results
import pkg/protobuf_serialization
import pkg/dagger/rng
import pkg/dagger/chunker
import pkg/dagger/blocktype as bt
import pkg/dagger/stores/memorystore
import pkg/dagger/stores/network/network
import pkg/dagger/stores/network/protobuf/blockexc
import pkg/dagger/stores/network/protobuf/payments
import pkg/dagger/blockexchange
import ../helpers
import ../examples

View File

@ -3,9 +3,7 @@ import std/sequtils
import pkg/libp2p
import pkg/nitro
import pkg/dagger/rng
import pkg/dagger/stores/network/protobuf/payments
import pkg/dagger/stores/network/peercontext
import pkg/dagger/stores/network/engine
import pkg/dagger/stores
import pkg/dagger/blocktype
proc example*(_: type EthAddress): EthAddress =

View File

@ -4,17 +4,15 @@ import std/algorithm
import pkg/asynctest
import pkg/chronos
import pkg/stew/byteutils
import pkg/libp2p
import pkg/libp2p/errors
import pkg/dagger/rng
import pkg/dagger/blockexc
import pkg/dagger/stores/network/protobuf/blockexc as pb
import pkg/dagger/stores/network/engine/payments
import pkg/dagger/stores/memorystore
import pkg/dagger/stores
import pkg/dagger/blockexchange
import pkg/dagger/chunker
import pkg/dagger/blocktype as bt
import pkg/dagger/utils/asyncheapqueue
import ./utils
import ../helpers

View File

@ -10,7 +10,7 @@ import pkg/dagger/rng
import pkg/dagger/stores/memorystore
import pkg/dagger/chunker
import ./helpers
import ../helpers
suite "Memory Store":

View File

@ -3,8 +3,7 @@ import std/sequtils
import pkg/chronos
import pkg/libp2p
import pkg/dagger/blockexc
import pkg/dagger/stores/memorystore
import pkg/dagger/stores
import pkg/dagger/blocktype as bt
import ../examples
@ -15,7 +14,6 @@ proc generateNodes*(
secureManagers: openarray[SecureProtocol] = [
SecureProtocol.Noise,
]): seq[tuple[switch: Switch, blockexc: BlockExc]] =
for i in 0..<num:
let
switch = newStandardSwitch(transportFlags = {ServerFlags.ReuseAddr})

View File

@ -0,0 +1,5 @@
import ./blockexc/testengine
import ./blockexc/testnetwork
import ./blockexc/protobuf/testpayments as testprotobufpayments
import ./blockexc/protobuf/testpresence
import ./blockexc/engine/testpayments as testenginepayments

View File

@ -0,0 +1,2 @@
import ./stores/testblockexc
import ./stores/testblockstore

View File

@ -1,11 +1,6 @@
import ./dagger/blockexc/testblockexc
import ./dagger/blockexc/testengine
import ./dagger/blockexc/testnetwork
import ./dagger/blockexc/protobuf/testpayments as testprotobufpayments
import ./dagger/blockexc/protobuf/testpresence
import ./dagger/blockexc/engine/testpayments as testenginepayments
import ./dagger/teststores
import ./dagger/testblockexc
import ./dagger/testasyncheapqueue
import ./dagger/testblockstore
import ./dagger/testchunking
import ./dagger/testblockset