Skip to content

Commit

Permalink
Move all Fluffy database code to database folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme committed Dec 1, 2023
1 parent 5e9e6ee commit 43d6090
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 30 deletions.
4 changes: 2 additions & 2 deletions fluffy/content_db.nim → fluffy/database/content_db.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import
stew/results,
eth/db/kvstore,
eth/db/kvstore_sqlite3,
./network/state/state_content,
"."/network/wire/[portal_protocol, portal_protocol_config],
../network/state/state_content,
../network/wire/[portal_protocol, portal_protocol_config],
./content_db_custom_sql_functions

export kvstore_sqlite3
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion fluffy/seed_db.nim → fluffy/database/seed_db.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand Down
4 changes: 2 additions & 2 deletions fluffy/fluffy.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand Down Expand Up @@ -29,7 +29,7 @@ import
],
./network/wire/[portal_stream, portal_protocol_config],
./eth_data/history_data_ssz_e2s,
./content_db,
./database/content_db,
./version, ./logging

chronicles.formatIt(IoErrorCode): $it
Expand Down
4 changes: 2 additions & 2 deletions fluffy/network/history/history_network.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -12,7 +12,7 @@ import
eth/[common/eth_types_rlp, rlp],
eth/p2p/discoveryv5/[protocol, enr],
../../common/common_types,
../../content_db,
../../database/content_db,
../../network_metadata,
../../../nimbus/[constants, db/core_db],
../wire/[portal_protocol, portal_stream, portal_protocol_config],
Expand Down
4 changes: 2 additions & 2 deletions fluffy/network/network_seed.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -13,7 +13,7 @@ import
eth/p2p/discoveryv5/[node, random2],
./wire/portal_protocol,
./history/[history_content, history_network],
../seed_db
../database/seed_db

# Experimental module which implements different content seeding strategies.
# Module is oblivious to content stored in seed database as all content related
Expand Down
6 changes: 3 additions & 3 deletions fluffy/network/state/state_network.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Nimbus
# Copyright (c) 2021-2022 Status Research & Development GmbH
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand All @@ -8,7 +8,7 @@
import
stew/results, chronos, chronicles,
eth/p2p/discoveryv5/[protocol, enr],
../../content_db,
../../database/content_db,
../wire/[portal_protocol, portal_stream, portal_protocol_config],
./state_content,
./state_distance
Expand Down
3 changes: 1 addition & 2 deletions fluffy/network/wire/portal_protocol.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus - Portal Network
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -16,7 +16,6 @@ import
nimcrypto/hash, bearssl, ssz_serialization, metrics, faststreams,
eth/rlp, eth/p2p/discoveryv5/[protocol, node, enr, routing_table, random2,
nodes_verification, lru],
../../seed_db,
"."/[portal_stream, portal_protocol_config],
./messages

Expand Down
4 changes: 2 additions & 2 deletions fluffy/rpc/rpc_portal_debug_api.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -12,7 +12,7 @@ import
../network/wire/portal_protocol,
../network/network_seed,
../eth_data/history_data_seeding,
".."/[content_db, seed_db]
../database/[content_db, seed_db]

export rpcserver

Expand Down
4 changes: 2 additions & 2 deletions fluffy/scripts/test_portal_testnet.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -19,7 +19,7 @@ import
history_data_json_store,
history_data_ssz_e2s],
../network/history/[history_content, accumulator],
../seed_db,
../database/seed_db,
../tests/test_history_util

type
Expand Down
2 changes: 1 addition & 1 deletion fluffy/tests/test_content_db.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import
unittest2, stint,
eth/keys,
../network/state/state_content,
../content_db,
../database/content_db,
./test_helpers

suite "Content Database":
Expand Down
4 changes: 2 additions & 2 deletions fluffy/tests/test_history_network.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus - Portal Network
# Fluffy
# Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -14,7 +14,7 @@ import
../network/wire/[portal_protocol, portal_stream, portal_protocol_config],
../network/history/[history_network, accumulator, history_content],
../../nimbus/constants,
../content_db,
../database/content_db,
./test_helpers

type HistoryNode = ref object
Expand Down
4 changes: 2 additions & 2 deletions fluffy/tests/test_portal_wire_protocol.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus - Portal Network
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -14,7 +14,7 @@ import
eth/keys, eth/p2p/discoveryv5/routing_table, nimcrypto/[hash, sha2],
eth/p2p/discoveryv5/protocol as discv5_protocol,
../network/wire/[portal_protocol, portal_stream, portal_protocol_config],
../content_db,
../database/content_db,
./test_helpers

const protocolId = [byte 0x50, 0x00]
Expand Down
6 changes: 3 additions & 3 deletions fluffy/tests/test_state_network.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Nimbus - Portal Network
# Copyright (c) 2021 Status Research & Development GmbH
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
Expand All @@ -14,7 +14,7 @@ import
../../nimbus/common/[chain_config, genesis],
../network/wire/[portal_protocol, portal_stream],
../network/state/[state_content, state_network],
../content_db,
../database/content_db,
./test_helpers

proc genesisToTrie(filePath: string): CoreDbMptRef =
Expand Down
4 changes: 2 additions & 2 deletions fluffy/tools/eth_data_exporter.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus
# Fluffy
# Copyright (c) 2022-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand Down Expand Up @@ -46,7 +46,7 @@ import
eth/common/eth_types_json_serialization,
json_rpc/rpcclient,
ncli/e2store,
../seed_db,
../database/seed_db,
../../premix/[downloader, parser],
../network/history/[history_content, accumulator],
../eth_data/[history_data_json_store, history_data_ssz_e2s],
Expand Down
4 changes: 2 additions & 2 deletions fluffy/tools/portalcli.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nimbus - Portal Network
# Fluffy
# Copyright (c) 2021-2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
Expand All @@ -14,7 +14,7 @@ import
eth/p2p/discoveryv5/[enr, node],
eth/p2p/discoveryv5/protocol as discv5_protocol,
../common/common_utils,
../content_db,
../database/content_db,
../network/wire/[portal_protocol, portal_stream, portal_protocol_config],
../network/history/[history_content, history_network]

Expand Down

0 comments on commit 43d6090

Please sign in to comment.