From 995a004c9a669934c69081b5c821f8793556c407 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89lo=C3=AFs?= <elois@ifee.fr>
Date: Tue, 20 Nov 2018 22:48:28 +0100
Subject: [PATCH] change libs architecture (dont change code)

---
 Cargo.lock                                    |   1 -
 Cargo.toml                                    |  32 +++++++++---------
 bin/durs-server/Cargo.toml                    |  10 +++---
 lib/blockchain/Cargo.toml                     |  29 ----------------
 lib/{ => core}/conf/Cargo.toml                |   4 +--
 lib/{ => core}/conf/keys.rs                   |   0
 lib/{ => core}/conf/lib.rs                    |   0
 lib/{ => core}/conf/test/conf.json            |   0
 lib/{ => core}/conf/test/keypairs.json        |   0
 lib/core/{ => core}/Cargo.toml                |   6 ++--
 lib/core/{ => core}/change_conf.rs            |   0
 lib/core/{ => core}/cli/dbex.rs               |   0
 lib/core/{ => core}/cli/en.yml                |   0
 lib/core/{ => core}/cli/keys.rs               |   0
 lib/core/{ => core}/cli/mod.rs                |   0
 lib/core/{ => core}/cli/modules.rs            |   0
 lib/core/{ => core}/cli/reset.rs              |   0
 lib/core/{ => core}/cli/start.rs              |   0
 lib/core/{ => core}/cli/sync.rs               |   0
 lib/core/{ => core}/lib.rs                    |   0
 lib/core/{ => core}/router.rs                 |   0
 lib/{ => core}/message/Cargo.toml             |   8 ++---
 lib/{ => core}/message/lib.rs                 |   0
 lib/{ => core}/module/Cargo.toml              |   6 ++--
 lib/{ => core}/module/clippy.toml             |   0
 lib/{ => core}/module/lib.rs                  |   0
 lib/{ => core}/network/Cargo.toml             |   6 ++--
 lib/{ => core}/network/lib.rs                 |   0
 .../ws2p}/ws2p-messages/Cargo.toml            |   6 ++--
 .../ws2p}/ws2p-messages/lib.rs                |   0
 .../ws2p}/ws2p-messages/v2/api_features.rs    |   0
 .../ws2p}/ws2p-messages/v2/connect.rs         |   0
 .../ws2p}/ws2p-messages/v2/mod.rs             |   0
 .../ws2p}/ws2p-messages/v2/ok.rs              |   0
 .../ws2p-messages/v2/payload_container.rs     |   0
 .../ws2p}/ws2p-messages/v2/req_responses.rs   |   0
 .../ws2p}/ws2p-messages/v2/requests.rs        |   0
 .../ws2p}/ws2p-messages/v2/secret_flags.rs    |   0
 lib/modules/blockchain/Cargo.toml             |  29 ++++++++++++++++
 .../blockchain/apply_valid_block.rs           |   0
 .../blockchain/check_and_apply_block.rs       |   0
 lib/{ => modules}/blockchain/clippy.toml      |   0
 lib/{ => modules}/blockchain/dbex.rs          |   0
 lib/{ => modules}/blockchain/lib.rs           |   0
 lib/{ => modules}/blockchain/revert_block.rs  |   0
 lib/{ => modules}/blockchain/sync.rs          |   0
 lib/{ => modules}/blockchain/ts_parsers.rs    |   0
 lib/{ => modules}/skeleton-module/Cargo.toml  |  12 +++----
 lib/{ => modules}/skeleton-module/lib.rs      |   0
 lib/modules/tui/Cargo.toml                    |  29 ++++++++++++++++
 lib/{ => modules}/tui/lib.rs                  |   0
 lib/{ => modules}/ws2p-v1-legacy/Cargo.toml   |  18 +++++-----
 .../ws2p-v1-legacy/ack_message.rs             |   0
 lib/{ => modules}/ws2p-v1-legacy/clippy.toml  |   0
 .../ws2p-v1-legacy/connect_message.rs         |   0
 lib/{ => modules}/ws2p-v1-legacy/constants.rs |   0
 lib/{ => modules}/ws2p-v1-legacy/datas.rs     |   0
 lib/{ => modules}/ws2p-v1-legacy/heads.rs     |   0
 lib/{ => modules}/ws2p-v1-legacy/lib.rs       |   0
 .../ws2p-v1-legacy/ok_message.rs              |   0
 .../ws2p-v1-legacy/parsers/blocks.rs          |   0
 .../ws2p-v1-legacy/parsers/excluded.rs        |   0
 .../ws2p-v1-legacy/parsers/identities.rs      |   0
 .../ws2p-v1-legacy/parsers/memberships.rs     |   0
 .../ws2p-v1-legacy/parsers/mod.rs             |   0
 .../ws2p-v1-legacy/parsers/transactions.rs    |   0
 .../ws2p-v1-legacy/serializer.rs              |   0
 .../ws2p-v1-legacy/ws2p_connection.rs         |   0
 lib/{ => modules}/ws2p-v1-legacy/ws2p_db.rs   |   0
 .../ws2p-v1-legacy/ws2p_requests.rs           |   0
 lib/modules/ws2p/Cargo.toml                   |  28 +++++++++++++++
 lib/{ => modules}/ws2p/constants.rs           |   0
 lib/{ => modules}/ws2p/generate_peer.rs       |   0
 lib/{ => modules}/ws2p/lib.rs                 |   0
 lib/{ => tools}/crypto/Cargo.toml             |   0
 lib/{ => tools}/crypto/README.md              |   0
 lib/{ => tools}/crypto/src/hashs/mod.rs       |   0
 .../crypto/src/keys/bin_signable.rs           |   0
 lib/{ => tools}/crypto/src/keys/ed25519.rs    |   0
 lib/{ => tools}/crypto/src/keys/mod.rs        |   0
 .../crypto/src/keys/text_signable.rs          |   0
 lib/{ => tools}/crypto/src/lib.rs             |   0
 lib/{ => tools}/dal/Cargo.toml                |   3 +-
 lib/{ => tools}/dal/balance.rs                |   0
 lib/{ => tools}/dal/block.rs                  |   0
 lib/{ => tools}/dal/certs.rs                  |   0
 lib/{ => tools}/dal/clippy.toml               |   0
 lib/{ => tools}/dal/constants.rs              |   0
 lib/{ => tools}/dal/currency_params.rs        |   0
 lib/{ => tools}/dal/dal_event.rs              |   0
 lib/{ => tools}/dal/dal_requests.rs           |   0
 lib/{ => tools}/dal/identity.rs               |   0
 lib/{ => tools}/dal/lib.rs                    |   0
 lib/{ => tools}/dal/parsers/certifications.rs |   0
 lib/{ => tools}/dal/parsers/mod.rs            |   0
 lib/{ => tools}/dal/parsers/revoked.rs        |   0
 lib/{ => tools}/dal/sources.rs                |   0
 lib/{ => tools}/dal/tools.rs                  |   0
 lib/{ => tools}/dal/writers/block.rs          |   0
 lib/{ => tools}/dal/writers/certification.rs  |   0
 lib/{ => tools}/dal/writers/dividend.rs       |   0
 lib/{ => tools}/dal/writers/identity.rs       |   0
 lib/{ => tools}/dal/writers/mod.rs            |   0
 lib/{ => tools}/dal/writers/requests.rs       |   0
 lib/{ => tools}/dal/writers/transaction.rs    |   0
 lib/{ => tools}/documents/Cargo.toml          |   0
 lib/{ => tools}/documents/README.md           |   0
 lib/{ => tools}/documents/src/blockstamp.rs   |   0
 .../documents/src/currencies_codes.rs         |   0
 .../documents/src/documents_grammar.pest      |   0
 lib/{ => tools}/documents/src/lib.rs          |   0
 lib/{ => tools}/documents/src/v10/block.rs    |   0
 .../documents/src/v10/certification.rs        |   0
 lib/{ => tools}/documents/src/v10/identity.rs |   0
 .../documents/src/v10/membership.rs           |   0
 lib/{ => tools}/documents/src/v10/mod.rs      |   0
 .../documents/src/v10/revocation.rs           |   0
 .../documents/src/v10/transaction.rs          |   0
 lib/{ => tools}/network-documents/Cargo.toml  |   0
 lib/{ => tools}/network-documents/src/lib.rs  |   0
 .../src/network_documents.pest                |   0
 .../network-documents/src/network_endpoint.rs |   0
 .../network-documents/src/network_head.rs     |   0
 .../network-documents/src/network_head_v2.rs  |   0
 .../network-documents/src/network_head_v3.rs  |   0
 .../network-documents/src/network_peer.rs     |   0
 lib/{ => tools}/wot/Cargo.toml                |   0
 lib/{ => tools}/wot/README.md                 |   0
 lib/{ => tools}/wot/data/mod.rs               |   0
 lib/{ => tools}/wot/data/rusty.rs             |   0
 lib/{ => tools}/wot/lib.rs                    |   0
 lib/{ => tools}/wot/operations/centrality.rs  |   0
 lib/{ => tools}/wot/operations/distance.rs    |   0
 lib/{ => tools}/wot/operations/file.rs        |   0
 lib/{ => tools}/wot/operations/mod.rs         |   0
 lib/{ => tools}/wot/operations/path.rs        |   0
 lib/{ => tools}/wot/tests/g1_genesis.bin      | Bin
 lib/tui/Cargo.toml                            |  29 ----------------
 lib/ws2p/Cargo.toml                           |  28 ---------------
 139 files changed, 141 insertions(+), 143 deletions(-)
 delete mode 100644 lib/blockchain/Cargo.toml
 rename lib/{ => core}/conf/Cargo.toml (81%)
 rename lib/{ => core}/conf/keys.rs (100%)
 rename lib/{ => core}/conf/lib.rs (100%)
 rename lib/{ => core}/conf/test/conf.json (100%)
 rename lib/{ => core}/conf/test/keypairs.json (100%)
 rename lib/core/{ => core}/Cargo.toml (77%)
 rename lib/core/{ => core}/change_conf.rs (100%)
 rename lib/core/{ => core}/cli/dbex.rs (100%)
 rename lib/core/{ => core}/cli/en.yml (100%)
 rename lib/core/{ => core}/cli/keys.rs (100%)
 rename lib/core/{ => core}/cli/mod.rs (100%)
 rename lib/core/{ => core}/cli/modules.rs (100%)
 rename lib/core/{ => core}/cli/reset.rs (100%)
 rename lib/core/{ => core}/cli/start.rs (100%)
 rename lib/core/{ => core}/cli/sync.rs (100%)
 rename lib/core/{ => core}/lib.rs (100%)
 rename lib/core/{ => core}/router.rs (100%)
 rename lib/{ => core}/message/Cargo.toml (66%)
 rename lib/{ => core}/message/lib.rs (100%)
 rename lib/{ => core}/module/Cargo.toml (68%)
 rename lib/{ => core}/module/clippy.toml (100%)
 rename lib/{ => core}/module/lib.rs (100%)
 rename lib/{ => core}/network/Cargo.toml (70%)
 rename lib/{ => core}/network/lib.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/Cargo.toml (71%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/lib.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/api_features.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/connect.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/mod.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/ok.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/payload_container.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/req_responses.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/requests.rs (100%)
 rename lib/{ => modules-lib/ws2p}/ws2p-messages/v2/secret_flags.rs (100%)
 create mode 100644 lib/modules/blockchain/Cargo.toml
 rename lib/{ => modules}/blockchain/apply_valid_block.rs (100%)
 rename lib/{ => modules}/blockchain/check_and_apply_block.rs (100%)
 rename lib/{ => modules}/blockchain/clippy.toml (100%)
 rename lib/{ => modules}/blockchain/dbex.rs (100%)
 rename lib/{ => modules}/blockchain/lib.rs (100%)
 rename lib/{ => modules}/blockchain/revert_block.rs (100%)
 rename lib/{ => modules}/blockchain/sync.rs (100%)
 rename lib/{ => modules}/blockchain/ts_parsers.rs (100%)
 rename lib/{ => modules}/skeleton-module/Cargo.toml (57%)
 rename lib/{ => modules}/skeleton-module/lib.rs (100%)
 create mode 100644 lib/modules/tui/Cargo.toml
 rename lib/{ => modules}/tui/lib.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/Cargo.toml (53%)
 rename lib/{ => modules}/ws2p-v1-legacy/ack_message.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/clippy.toml (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/connect_message.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/constants.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/datas.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/heads.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/lib.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/ok_message.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/parsers/blocks.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/parsers/excluded.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/parsers/identities.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/parsers/memberships.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/parsers/mod.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/parsers/transactions.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/serializer.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/ws2p_connection.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/ws2p_db.rs (100%)
 rename lib/{ => modules}/ws2p-v1-legacy/ws2p_requests.rs (100%)
 create mode 100644 lib/modules/ws2p/Cargo.toml
 rename lib/{ => modules}/ws2p/constants.rs (100%)
 rename lib/{ => modules}/ws2p/generate_peer.rs (100%)
 rename lib/{ => modules}/ws2p/lib.rs (100%)
 rename lib/{ => tools}/crypto/Cargo.toml (100%)
 rename lib/{ => tools}/crypto/README.md (100%)
 rename lib/{ => tools}/crypto/src/hashs/mod.rs (100%)
 rename lib/{ => tools}/crypto/src/keys/bin_signable.rs (100%)
 rename lib/{ => tools}/crypto/src/keys/ed25519.rs (100%)
 rename lib/{ => tools}/crypto/src/keys/mod.rs (100%)
 rename lib/{ => tools}/crypto/src/keys/text_signable.rs (100%)
 rename lib/{ => tools}/crypto/src/lib.rs (100%)
 rename lib/{ => tools}/dal/Cargo.toml (86%)
 rename lib/{ => tools}/dal/balance.rs (100%)
 rename lib/{ => tools}/dal/block.rs (100%)
 rename lib/{ => tools}/dal/certs.rs (100%)
 rename lib/{ => tools}/dal/clippy.toml (100%)
 rename lib/{ => tools}/dal/constants.rs (100%)
 rename lib/{ => tools}/dal/currency_params.rs (100%)
 rename lib/{ => tools}/dal/dal_event.rs (100%)
 rename lib/{ => tools}/dal/dal_requests.rs (100%)
 rename lib/{ => tools}/dal/identity.rs (100%)
 rename lib/{ => tools}/dal/lib.rs (100%)
 rename lib/{ => tools}/dal/parsers/certifications.rs (100%)
 rename lib/{ => tools}/dal/parsers/mod.rs (100%)
 rename lib/{ => tools}/dal/parsers/revoked.rs (100%)
 rename lib/{ => tools}/dal/sources.rs (100%)
 rename lib/{ => tools}/dal/tools.rs (100%)
 rename lib/{ => tools}/dal/writers/block.rs (100%)
 rename lib/{ => tools}/dal/writers/certification.rs (100%)
 rename lib/{ => tools}/dal/writers/dividend.rs (100%)
 rename lib/{ => tools}/dal/writers/identity.rs (100%)
 rename lib/{ => tools}/dal/writers/mod.rs (100%)
 rename lib/{ => tools}/dal/writers/requests.rs (100%)
 rename lib/{ => tools}/dal/writers/transaction.rs (100%)
 rename lib/{ => tools}/documents/Cargo.toml (100%)
 rename lib/{ => tools}/documents/README.md (100%)
 rename lib/{ => tools}/documents/src/blockstamp.rs (100%)
 rename lib/{ => tools}/documents/src/currencies_codes.rs (100%)
 rename lib/{ => tools}/documents/src/documents_grammar.pest (100%)
 rename lib/{ => tools}/documents/src/lib.rs (100%)
 rename lib/{ => tools}/documents/src/v10/block.rs (100%)
 rename lib/{ => tools}/documents/src/v10/certification.rs (100%)
 rename lib/{ => tools}/documents/src/v10/identity.rs (100%)
 rename lib/{ => tools}/documents/src/v10/membership.rs (100%)
 rename lib/{ => tools}/documents/src/v10/mod.rs (100%)
 rename lib/{ => tools}/documents/src/v10/revocation.rs (100%)
 rename lib/{ => tools}/documents/src/v10/transaction.rs (100%)
 rename lib/{ => tools}/network-documents/Cargo.toml (100%)
 rename lib/{ => tools}/network-documents/src/lib.rs (100%)
 rename lib/{ => tools}/network-documents/src/network_documents.pest (100%)
 rename lib/{ => tools}/network-documents/src/network_endpoint.rs (100%)
 rename lib/{ => tools}/network-documents/src/network_head.rs (100%)
 rename lib/{ => tools}/network-documents/src/network_head_v2.rs (100%)
 rename lib/{ => tools}/network-documents/src/network_head_v3.rs (100%)
 rename lib/{ => tools}/network-documents/src/network_peer.rs (100%)
 rename lib/{ => tools}/wot/Cargo.toml (100%)
 rename lib/{ => tools}/wot/README.md (100%)
 rename lib/{ => tools}/wot/data/mod.rs (100%)
 rename lib/{ => tools}/wot/data/rusty.rs (100%)
 rename lib/{ => tools}/wot/lib.rs (100%)
 rename lib/{ => tools}/wot/operations/centrality.rs (100%)
 rename lib/{ => tools}/wot/operations/distance.rs (100%)
 rename lib/{ => tools}/wot/operations/file.rs (100%)
 rename lib/{ => tools}/wot/operations/mod.rs (100%)
 rename lib/{ => tools}/wot/operations/path.rs (100%)
 rename lib/{ => tools}/wot/tests/g1_genesis.bin (100%)
 delete mode 100644 lib/tui/Cargo.toml
 delete mode 100644 lib/ws2p/Cargo.toml

diff --git a/Cargo.lock b/Cargo.lock
index c054af2b..e66655ea 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -310,7 +310,6 @@ version = "0.1.0-a0.1"
 dependencies = [
  "dubp-documents 0.11.0",
  "duniter-module 0.1.0-a0.1",
- "duniter-network 0.1.0-a0.1",
  "dup-crypto 0.5.0",
  "durs-wot 0.8.0-a0.9",
  "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/Cargo.toml b/Cargo.toml
index 266bad8e..14a67023 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,20 +1,20 @@
 [workspace]
 members = [
     "bin/durs-server",
-    "lib/blockchain",
-    "lib/conf",
-    "lib/core",
-    "lib/crypto",
-    "lib/dal",
-    "lib/documents",
-    "lib/message",
-    "lib/module",
-    "lib/network",
-    "lib/network-documents",
-    # "lib/skeleton-module",
-    "lib/tui",
-    "lib/wot",
-    "lib/ws2p",
-    "lib/ws2p-messages",
-    "lib/ws2p-v1-legacy"
+    "lib/core/conf",
+    "lib/core/core",
+    "lib/core/message",
+    "lib/core/module",
+    "lib/core/network",
+    "lib/modules/blockchain",
+    # "lib/modules/skeleton-module",
+    "lib/modules/tui",
+    "lib/modules/ws2p",
+    "lib/modules/ws2p-v1-legacy",
+    "lib/modules-lib/ws2p/ws2p-messages",
+    "lib/tools/crypto",
+    "lib/tools/dal",
+    "lib/tools/documents",
+    "lib/tools/network-documents",
+    "lib/tools/wot",
 ]
diff --git a/bin/durs-server/Cargo.toml b/bin/durs-server/Cargo.toml
index 91c22347..23521852 100644
--- a/bin/durs-server/Cargo.toml
+++ b/bin/durs-server/Cargo.toml
@@ -6,14 +6,14 @@ description = "DURS (Dividende Universel RuSt) is a new implementation of Dunite
 license = "AGPL-3.0"
 
 [dependencies]
-duniter-core = { path = "../../lib/core" }
-# durs-skeleton-module = { path = "../../lib/skeleton-module" }
-durs-ws2p = { path = "../../lib/ws2p" }
-durs-ws2p-v1-legacy = { path = "../../lib/ws2p-v1-legacy" }
+duniter-core = { path = "../../lib/core/core" }
+# durs-skeleton-module = { path = "../../lib/modules/skeleton-module" }
+durs-ws2p = { path = "../../lib/modules/ws2p" }
+durs-ws2p-v1-legacy = { path = "../../lib/modules/ws2p-v1-legacy" }
 structopt= "0.2.*"
 
 [target.'cfg(unix)'.dependencies]
-duniter-tui = { path = "../../lib/tui" }
+duniter-tui = { path = "../../lib/modules/tui" }
 
 [features]
 default = ["ssl"]
diff --git a/lib/blockchain/Cargo.toml b/lib/blockchain/Cargo.toml
deleted file mode 100644
index 5c4682fd..00000000
--- a/lib/blockchain/Cargo.toml
+++ /dev/null
@@ -1,29 +0,0 @@
-[package]
-name = "duniter-blockchain"
-version = "0.1.0-a0.1"
-authors = ["librelois <elois@ifee.fr>"]
-description = "Blockchain module for the Duniter project."
-license = "AGPL-3.0"
-
-[lib]
-path = "lib.rs"
-
-[dependencies]
-dirs = "1.0.2"
-duniter-conf = { path = "../conf" }
-dup-crypto = { path = "../crypto" }
-duniter-dal = { path = "../dal" }
-dubp-documents= { path = "../documents" }
-durs-network-documents = { path = "../network-documents" }
-duniter-message =  { path = "../message" }
-duniter-module = { path = "../module" }
-duniter-network = { path = "../network" }
-durs-wot = { path = "../wot" }
-log = "0.4.*"
-num_cpus = "1.8.*"
-pbr = "1.0.*"
-rustbreak = {version = "2.0.0-rc3", features = ["bin_enc"]}
-serde = "1.0.*"
-serde_json = "1.0.*"
-sqlite = "0.23.*"
-threadpool = "1.7.*"
\ No newline at end of file
diff --git a/lib/conf/Cargo.toml b/lib/core/conf/Cargo.toml
similarity index 81%
rename from lib/conf/Cargo.toml
rename to lib/core/conf/Cargo.toml
index d4056f7c..27d5f84f 100644
--- a/lib/conf/Cargo.toml
+++ b/lib/core/conf/Cargo.toml
@@ -14,8 +14,8 @@ serde = "1.0.*"
 serde_derive = "1.0.*"
 serde_json = "1.0.*"
 dirs = "1.0.2"
-dup-crypto = { path = "../crypto" }
-dubp-documents= { path = "../documents" }
+dup-crypto = { path = "../../tools/crypto" }
+dubp-documents= { path = "../../tools/documents" }
 rpassword = "1.0.0"
 duniter-module = { path = "../module" }
 
diff --git a/lib/conf/keys.rs b/lib/core/conf/keys.rs
similarity index 100%
rename from lib/conf/keys.rs
rename to lib/core/conf/keys.rs
diff --git a/lib/conf/lib.rs b/lib/core/conf/lib.rs
similarity index 100%
rename from lib/conf/lib.rs
rename to lib/core/conf/lib.rs
diff --git a/lib/conf/test/conf.json b/lib/core/conf/test/conf.json
similarity index 100%
rename from lib/conf/test/conf.json
rename to lib/core/conf/test/conf.json
diff --git a/lib/conf/test/keypairs.json b/lib/core/conf/test/keypairs.json
similarity index 100%
rename from lib/conf/test/keypairs.json
rename to lib/core/conf/test/keypairs.json
diff --git a/lib/core/Cargo.toml b/lib/core/core/Cargo.toml
similarity index 77%
rename from lib/core/Cargo.toml
rename to lib/core/core/Cargo.toml
index 37d43e95..4183713a 100644
--- a/lib/core/Cargo.toml
+++ b/lib/core/core/Cargo.toml
@@ -10,13 +10,13 @@ path = "lib.rs"
 
 [dependencies]
 dirs = "1.0.2"
-duniter-blockchain = { path = "../blockchain" }
+duniter-blockchain = { path = "../../modules/blockchain" }
 duniter-conf = { path = "../conf" }
-dup-crypto = { path = "../crypto" }
+dup-crypto = { path = "../../tools/crypto" }
 duniter-message =  { path = "../message" }
 duniter-module = { path = "../module" }
 duniter-network = { path = "../network" }
-durs-network-documents = { path = "../network-documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
 log = "0.4.*"
 log-panics = "2.0.*"
 serde = "1.0.*"
diff --git a/lib/core/change_conf.rs b/lib/core/core/change_conf.rs
similarity index 100%
rename from lib/core/change_conf.rs
rename to lib/core/core/change_conf.rs
diff --git a/lib/core/cli/dbex.rs b/lib/core/core/cli/dbex.rs
similarity index 100%
rename from lib/core/cli/dbex.rs
rename to lib/core/core/cli/dbex.rs
diff --git a/lib/core/cli/en.yml b/lib/core/core/cli/en.yml
similarity index 100%
rename from lib/core/cli/en.yml
rename to lib/core/core/cli/en.yml
diff --git a/lib/core/cli/keys.rs b/lib/core/core/cli/keys.rs
similarity index 100%
rename from lib/core/cli/keys.rs
rename to lib/core/core/cli/keys.rs
diff --git a/lib/core/cli/mod.rs b/lib/core/core/cli/mod.rs
similarity index 100%
rename from lib/core/cli/mod.rs
rename to lib/core/core/cli/mod.rs
diff --git a/lib/core/cli/modules.rs b/lib/core/core/cli/modules.rs
similarity index 100%
rename from lib/core/cli/modules.rs
rename to lib/core/core/cli/modules.rs
diff --git a/lib/core/cli/reset.rs b/lib/core/core/cli/reset.rs
similarity index 100%
rename from lib/core/cli/reset.rs
rename to lib/core/core/cli/reset.rs
diff --git a/lib/core/cli/start.rs b/lib/core/core/cli/start.rs
similarity index 100%
rename from lib/core/cli/start.rs
rename to lib/core/core/cli/start.rs
diff --git a/lib/core/cli/sync.rs b/lib/core/core/cli/sync.rs
similarity index 100%
rename from lib/core/cli/sync.rs
rename to lib/core/core/cli/sync.rs
diff --git a/lib/core/lib.rs b/lib/core/core/lib.rs
similarity index 100%
rename from lib/core/lib.rs
rename to lib/core/core/lib.rs
diff --git a/lib/core/router.rs b/lib/core/core/router.rs
similarity index 100%
rename from lib/core/router.rs
rename to lib/core/core/router.rs
diff --git a/lib/message/Cargo.toml b/lib/core/message/Cargo.toml
similarity index 66%
rename from lib/message/Cargo.toml
rename to lib/core/message/Cargo.toml
index a775b2b0..967ff847 100644
--- a/lib/message/Cargo.toml
+++ b/lib/core/message/Cargo.toml
@@ -9,12 +9,12 @@ license = "AGPL-3.0"
 path = "lib.rs"
 
 [dependencies]
-dup-crypto = { path = "../crypto" }
-duniter-dal = { path = "../dal" }
-dubp-documents= { path = "../documents" }
+dup-crypto = { path = "../../tools/crypto" }
+duniter-dal = { path = "../../tools/dal" }
+dubp-documents= { path = "../../tools/documents" }
 duniter-module = { path = "../module" }
 duniter-network = { path = "../network" }
-durs-network-documents = { path = "../network-documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
 serde = "1.0.*"
 serde_derive = "1.0.*"
 serde_json = "1.0.*"
diff --git a/lib/message/lib.rs b/lib/core/message/lib.rs
similarity index 100%
rename from lib/message/lib.rs
rename to lib/core/message/lib.rs
diff --git a/lib/module/Cargo.toml b/lib/core/module/Cargo.toml
similarity index 68%
rename from lib/module/Cargo.toml
rename to lib/core/module/Cargo.toml
index ee4120ee..c91137a9 100644
--- a/lib/module/Cargo.toml
+++ b/lib/core/module/Cargo.toml
@@ -9,9 +9,9 @@ license = "AGPL-3.0"
 path = "lib.rs"
 
 [dependencies]
-dup-crypto = { path = "../crypto" }
-dubp-documents= { path = "../documents" }
-durs-network-documents = { path = "../network-documents" }
+dup-crypto = { path = "../../tools/crypto" }
+dubp-documents= { path = "../../tools/documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
 serde = "1.0.*"
 serde_derive = "1.0.*"
 serde_json = "1.0.*"
diff --git a/lib/module/clippy.toml b/lib/core/module/clippy.toml
similarity index 100%
rename from lib/module/clippy.toml
rename to lib/core/module/clippy.toml
diff --git a/lib/module/lib.rs b/lib/core/module/lib.rs
similarity index 100%
rename from lib/module/lib.rs
rename to lib/core/module/lib.rs
diff --git a/lib/network/Cargo.toml b/lib/core/network/Cargo.toml
similarity index 70%
rename from lib/network/Cargo.toml
rename to lib/core/network/Cargo.toml
index d85e9bd2..16b309ff 100644
--- a/lib/network/Cargo.toml
+++ b/lib/core/network/Cargo.toml
@@ -9,10 +9,10 @@ license = "AGPL-3.0"
 path = "lib.rs"
 
 [dependencies]
-dup-crypto = { path = "../crypto" }
-dubp-documents= { path = "../documents" }
+dup-crypto = { path = "../../tools/crypto" }
+dubp-documents= { path = "../../tools/documents" }
 duniter-module = { path = "../module" }
-durs-network-documents = { path = "../network-documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
 serde = "1.0.*"
 serde_derive = "1.0.*"
 serde_json = "1.0.*"
diff --git a/lib/network/lib.rs b/lib/core/network/lib.rs
similarity index 100%
rename from lib/network/lib.rs
rename to lib/core/network/lib.rs
diff --git a/lib/ws2p-messages/Cargo.toml b/lib/modules-lib/ws2p/ws2p-messages/Cargo.toml
similarity index 71%
rename from lib/ws2p-messages/Cargo.toml
rename to lib/modules-lib/ws2p/ws2p-messages/Cargo.toml
index a94414ca..b6a259b6 100644
--- a/lib/ws2p-messages/Cargo.toml
+++ b/lib/modules-lib/ws2p/ws2p-messages/Cargo.toml
@@ -11,9 +11,9 @@ path = "lib.rs"
 [dependencies]
 bincode = "1.0.*"
 byteorder = "1.2.3"
-dup-crypto = { path = "../crypto" }
-dubp-documents= { path = "../documents" }
-durs-network-documents = { path = "../network-documents" }
+dup-crypto = { path = "../../../tools/crypto" }
+dubp-documents= { path = "../../../tools/documents" }
+durs-network-documents = { path = "../../../tools/network-documents" }
 log = "0.4.*"
 serde = "1.0.*"
 serde_derive = "1.0.*"
diff --git a/lib/ws2p-messages/lib.rs b/lib/modules-lib/ws2p/ws2p-messages/lib.rs
similarity index 100%
rename from lib/ws2p-messages/lib.rs
rename to lib/modules-lib/ws2p/ws2p-messages/lib.rs
diff --git a/lib/ws2p-messages/v2/api_features.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/api_features.rs
similarity index 100%
rename from lib/ws2p-messages/v2/api_features.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/api_features.rs
diff --git a/lib/ws2p-messages/v2/connect.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/connect.rs
similarity index 100%
rename from lib/ws2p-messages/v2/connect.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/connect.rs
diff --git a/lib/ws2p-messages/v2/mod.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/mod.rs
similarity index 100%
rename from lib/ws2p-messages/v2/mod.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/mod.rs
diff --git a/lib/ws2p-messages/v2/ok.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/ok.rs
similarity index 100%
rename from lib/ws2p-messages/v2/ok.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/ok.rs
diff --git a/lib/ws2p-messages/v2/payload_container.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/payload_container.rs
similarity index 100%
rename from lib/ws2p-messages/v2/payload_container.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/payload_container.rs
diff --git a/lib/ws2p-messages/v2/req_responses.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/req_responses.rs
similarity index 100%
rename from lib/ws2p-messages/v2/req_responses.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/req_responses.rs
diff --git a/lib/ws2p-messages/v2/requests.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/requests.rs
similarity index 100%
rename from lib/ws2p-messages/v2/requests.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/requests.rs
diff --git a/lib/ws2p-messages/v2/secret_flags.rs b/lib/modules-lib/ws2p/ws2p-messages/v2/secret_flags.rs
similarity index 100%
rename from lib/ws2p-messages/v2/secret_flags.rs
rename to lib/modules-lib/ws2p/ws2p-messages/v2/secret_flags.rs
diff --git a/lib/modules/blockchain/Cargo.toml b/lib/modules/blockchain/Cargo.toml
new file mode 100644
index 00000000..a4ffd84c
--- /dev/null
+++ b/lib/modules/blockchain/Cargo.toml
@@ -0,0 +1,29 @@
+[package]
+name = "duniter-blockchain"
+version = "0.1.0-a0.1"
+authors = ["librelois <elois@ifee.fr>"]
+description = "Blockchain module for the Duniter project."
+license = "AGPL-3.0"
+
+[lib]
+path = "lib.rs"
+
+[dependencies]
+dirs = "1.0.2"
+duniter-conf = { path = "../../core/conf" }
+dup-crypto = { path = "../../tools/crypto" }
+duniter-dal = { path = "../../tools/dal" }
+dubp-documents= { path = "../../tools/documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
+duniter-message =  { path = "../../core/message" }
+duniter-module = { path = "../../core/module" }
+duniter-network = { path = "../../core/network" }
+durs-wot = { path = "../../tools/wot" }
+log = "0.4.*"
+num_cpus = "1.8.*"
+pbr = "1.0.*"
+rustbreak = {version = "2.0.0-rc3", features = ["bin_enc"]}
+serde = "1.0.*"
+serde_json = "1.0.*"
+sqlite = "0.23.*"
+threadpool = "1.7.*"
\ No newline at end of file
diff --git a/lib/blockchain/apply_valid_block.rs b/lib/modules/blockchain/apply_valid_block.rs
similarity index 100%
rename from lib/blockchain/apply_valid_block.rs
rename to lib/modules/blockchain/apply_valid_block.rs
diff --git a/lib/blockchain/check_and_apply_block.rs b/lib/modules/blockchain/check_and_apply_block.rs
similarity index 100%
rename from lib/blockchain/check_and_apply_block.rs
rename to lib/modules/blockchain/check_and_apply_block.rs
diff --git a/lib/blockchain/clippy.toml b/lib/modules/blockchain/clippy.toml
similarity index 100%
rename from lib/blockchain/clippy.toml
rename to lib/modules/blockchain/clippy.toml
diff --git a/lib/blockchain/dbex.rs b/lib/modules/blockchain/dbex.rs
similarity index 100%
rename from lib/blockchain/dbex.rs
rename to lib/modules/blockchain/dbex.rs
diff --git a/lib/blockchain/lib.rs b/lib/modules/blockchain/lib.rs
similarity index 100%
rename from lib/blockchain/lib.rs
rename to lib/modules/blockchain/lib.rs
diff --git a/lib/blockchain/revert_block.rs b/lib/modules/blockchain/revert_block.rs
similarity index 100%
rename from lib/blockchain/revert_block.rs
rename to lib/modules/blockchain/revert_block.rs
diff --git a/lib/blockchain/sync.rs b/lib/modules/blockchain/sync.rs
similarity index 100%
rename from lib/blockchain/sync.rs
rename to lib/modules/blockchain/sync.rs
diff --git a/lib/blockchain/ts_parsers.rs b/lib/modules/blockchain/ts_parsers.rs
similarity index 100%
rename from lib/blockchain/ts_parsers.rs
rename to lib/modules/blockchain/ts_parsers.rs
diff --git a/lib/skeleton-module/Cargo.toml b/lib/modules/skeleton-module/Cargo.toml
similarity index 57%
rename from lib/skeleton-module/Cargo.toml
rename to lib/modules/skeleton-module/Cargo.toml
index 278f8089..c2e7cbb7 100644
--- a/lib/skeleton-module/Cargo.toml
+++ b/lib/modules/skeleton-module/Cargo.toml
@@ -9,12 +9,12 @@ license = "AGPL-3.0"
 path = "lib.rs"
 
 [dependencies]
-duniter-conf = { path = "../conf" }
-duniter-dal = { path = "../dal" }
-duniter-message =  { path = "../message" }
-duniter-module = { path = "../module" }
-duniter-network = { path = "../network" }
-dup-crypto = { path = "../crypto" }
+duniter-conf = { path = "../../core/conf" }
+duniter-dal = { path = "../../tools/dal" }
+duniter-message =  { path = "../../core/message" }
+duniter-module = { path = "../../core/module" }
+duniter-network = { path = "../../core/network" }
+dup-crypto = { path = "../../tools/crypto" }
 log = "0.4.*"
 serde = "1.0.*"
 serde_derive = "1.0.*"
diff --git a/lib/skeleton-module/lib.rs b/lib/modules/skeleton-module/lib.rs
similarity index 100%
rename from lib/skeleton-module/lib.rs
rename to lib/modules/skeleton-module/lib.rs
diff --git a/lib/modules/tui/Cargo.toml b/lib/modules/tui/Cargo.toml
new file mode 100644
index 00000000..3a8e00cf
--- /dev/null
+++ b/lib/modules/tui/Cargo.toml
@@ -0,0 +1,29 @@
+[package]
+name = "duniter-tui"
+version = "0.1.0-a0.1"
+authors = ["librelois <elois@ifee.fr>"]
+description = "Terminal user interface for Duniter-Rs."
+license = "AGPL-3.0"
+
+[lib]
+path = "lib.rs"
+
+[dependencies]
+duniter-conf = { path = "../../core/conf" }
+dup-crypto = { path = "../../tools/crypto" }
+duniter-dal = { path = "../../tools/dal" }
+dubp-documents= { path = "../../tools/documents" }
+duniter-message =  { path = "../../core/message" }
+duniter-module = { path = "../../core/module" }
+duniter-network = { path = "../../core/network" }
+durs-network-documents = { path = "../../tools/network-documents" }
+log = "0.4.*"
+serde = "1.0.*"
+serde_derive = "1.0.*"
+serde_json = "1.0.*"
+structopt= "0.2.*"
+termion = "1.5.*"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/lib/tui/lib.rs b/lib/modules/tui/lib.rs
similarity index 100%
rename from lib/tui/lib.rs
rename to lib/modules/tui/lib.rs
diff --git a/lib/ws2p-v1-legacy/Cargo.toml b/lib/modules/ws2p-v1-legacy/Cargo.toml
similarity index 53%
rename from lib/ws2p-v1-legacy/Cargo.toml
rename to lib/modules/ws2p-v1-legacy/Cargo.toml
index aed358f2..4b65d262 100644
--- a/lib/ws2p-v1-legacy/Cargo.toml
+++ b/lib/modules/ws2p-v1-legacy/Cargo.toml
@@ -10,15 +10,15 @@ path = "lib.rs"
 
 [dependencies]
 byteorder = "1.2.3"
-duniter-conf = { path = "../conf" }
-dup-crypto = { path = "../crypto" }
-duniter-dal = { path = "../dal" }
-dubp-documents= { path = "../documents" }
-durs-network-documents = { path = "../network-documents" }
-duniter-message =  { path = "../message" }
-duniter-module = { path = "../module" }
-duniter-network = { path = "../network" }
-durs-wot = { path = "../wot" }
+duniter-conf = { path = "../../core/conf" }
+dup-crypto = { path = "../../tools/crypto" }
+duniter-dal = { path = "../../tools/dal" }
+dubp-documents= { path = "../../tools/documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
+duniter-message =  { path = "../../core/message" }
+duniter-module = { path = "../../core/module" }
+duniter-network = { path = "../../core/network" }
+durs-wot = { path = "../../tools/wot" }
 log = "0.4.*"
 rand = "0.4.*"
 sqlite = "0.23.*"
diff --git a/lib/ws2p-v1-legacy/ack_message.rs b/lib/modules/ws2p-v1-legacy/ack_message.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/ack_message.rs
rename to lib/modules/ws2p-v1-legacy/ack_message.rs
diff --git a/lib/ws2p-v1-legacy/clippy.toml b/lib/modules/ws2p-v1-legacy/clippy.toml
similarity index 100%
rename from lib/ws2p-v1-legacy/clippy.toml
rename to lib/modules/ws2p-v1-legacy/clippy.toml
diff --git a/lib/ws2p-v1-legacy/connect_message.rs b/lib/modules/ws2p-v1-legacy/connect_message.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/connect_message.rs
rename to lib/modules/ws2p-v1-legacy/connect_message.rs
diff --git a/lib/ws2p-v1-legacy/constants.rs b/lib/modules/ws2p-v1-legacy/constants.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/constants.rs
rename to lib/modules/ws2p-v1-legacy/constants.rs
diff --git a/lib/ws2p-v1-legacy/datas.rs b/lib/modules/ws2p-v1-legacy/datas.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/datas.rs
rename to lib/modules/ws2p-v1-legacy/datas.rs
diff --git a/lib/ws2p-v1-legacy/heads.rs b/lib/modules/ws2p-v1-legacy/heads.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/heads.rs
rename to lib/modules/ws2p-v1-legacy/heads.rs
diff --git a/lib/ws2p-v1-legacy/lib.rs b/lib/modules/ws2p-v1-legacy/lib.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/lib.rs
rename to lib/modules/ws2p-v1-legacy/lib.rs
diff --git a/lib/ws2p-v1-legacy/ok_message.rs b/lib/modules/ws2p-v1-legacy/ok_message.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/ok_message.rs
rename to lib/modules/ws2p-v1-legacy/ok_message.rs
diff --git a/lib/ws2p-v1-legacy/parsers/blocks.rs b/lib/modules/ws2p-v1-legacy/parsers/blocks.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/parsers/blocks.rs
rename to lib/modules/ws2p-v1-legacy/parsers/blocks.rs
diff --git a/lib/ws2p-v1-legacy/parsers/excluded.rs b/lib/modules/ws2p-v1-legacy/parsers/excluded.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/parsers/excluded.rs
rename to lib/modules/ws2p-v1-legacy/parsers/excluded.rs
diff --git a/lib/ws2p-v1-legacy/parsers/identities.rs b/lib/modules/ws2p-v1-legacy/parsers/identities.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/parsers/identities.rs
rename to lib/modules/ws2p-v1-legacy/parsers/identities.rs
diff --git a/lib/ws2p-v1-legacy/parsers/memberships.rs b/lib/modules/ws2p-v1-legacy/parsers/memberships.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/parsers/memberships.rs
rename to lib/modules/ws2p-v1-legacy/parsers/memberships.rs
diff --git a/lib/ws2p-v1-legacy/parsers/mod.rs b/lib/modules/ws2p-v1-legacy/parsers/mod.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/parsers/mod.rs
rename to lib/modules/ws2p-v1-legacy/parsers/mod.rs
diff --git a/lib/ws2p-v1-legacy/parsers/transactions.rs b/lib/modules/ws2p-v1-legacy/parsers/transactions.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/parsers/transactions.rs
rename to lib/modules/ws2p-v1-legacy/parsers/transactions.rs
diff --git a/lib/ws2p-v1-legacy/serializer.rs b/lib/modules/ws2p-v1-legacy/serializer.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/serializer.rs
rename to lib/modules/ws2p-v1-legacy/serializer.rs
diff --git a/lib/ws2p-v1-legacy/ws2p_connection.rs b/lib/modules/ws2p-v1-legacy/ws2p_connection.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/ws2p_connection.rs
rename to lib/modules/ws2p-v1-legacy/ws2p_connection.rs
diff --git a/lib/ws2p-v1-legacy/ws2p_db.rs b/lib/modules/ws2p-v1-legacy/ws2p_db.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/ws2p_db.rs
rename to lib/modules/ws2p-v1-legacy/ws2p_db.rs
diff --git a/lib/ws2p-v1-legacy/ws2p_requests.rs b/lib/modules/ws2p-v1-legacy/ws2p_requests.rs
similarity index 100%
rename from lib/ws2p-v1-legacy/ws2p_requests.rs
rename to lib/modules/ws2p-v1-legacy/ws2p_requests.rs
diff --git a/lib/modules/ws2p/Cargo.toml b/lib/modules/ws2p/Cargo.toml
new file mode 100644
index 00000000..f12c112e
--- /dev/null
+++ b/lib/modules/ws2p/Cargo.toml
@@ -0,0 +1,28 @@
+[package]
+name = "durs-ws2p"
+version = "0.1.0-a0.1"
+authors = ["librelois <elois@ifee.fr>"]
+description = "WebSocketToPeer API for DURS Project."
+license = "AGPL-3.0"
+
+[lib]
+path = "lib.rs"
+
+[dependencies]
+bincode = "1.0.*"
+duniter-conf= { path = "../../core/conf" }
+dup-crypto = { path = "../../tools/crypto" }
+dubp-documents= { path = "../../tools/documents" }
+durs-network-documents = { path = "../../tools/network-documents" }
+durs-ws2p-messages = { path = "../../modules-lib/ws2p/ws2p-messages" }
+duniter-message= { path = "../../core/message" }
+duniter-module = { path = "../../core/module" }
+duniter-network = { path = "../../core/network" }
+log = "0.4.*"
+serde = "1.0.*"
+serde_derive = "1.0.*"
+structopt= "0.2.*"
+
+[features]
+# Treat warnings as a build error.
+strict = []
\ No newline at end of file
diff --git a/lib/ws2p/constants.rs b/lib/modules/ws2p/constants.rs
similarity index 100%
rename from lib/ws2p/constants.rs
rename to lib/modules/ws2p/constants.rs
diff --git a/lib/ws2p/generate_peer.rs b/lib/modules/ws2p/generate_peer.rs
similarity index 100%
rename from lib/ws2p/generate_peer.rs
rename to lib/modules/ws2p/generate_peer.rs
diff --git a/lib/ws2p/lib.rs b/lib/modules/ws2p/lib.rs
similarity index 100%
rename from lib/ws2p/lib.rs
rename to lib/modules/ws2p/lib.rs
diff --git a/lib/crypto/Cargo.toml b/lib/tools/crypto/Cargo.toml
similarity index 100%
rename from lib/crypto/Cargo.toml
rename to lib/tools/crypto/Cargo.toml
diff --git a/lib/crypto/README.md b/lib/tools/crypto/README.md
similarity index 100%
rename from lib/crypto/README.md
rename to lib/tools/crypto/README.md
diff --git a/lib/crypto/src/hashs/mod.rs b/lib/tools/crypto/src/hashs/mod.rs
similarity index 100%
rename from lib/crypto/src/hashs/mod.rs
rename to lib/tools/crypto/src/hashs/mod.rs
diff --git a/lib/crypto/src/keys/bin_signable.rs b/lib/tools/crypto/src/keys/bin_signable.rs
similarity index 100%
rename from lib/crypto/src/keys/bin_signable.rs
rename to lib/tools/crypto/src/keys/bin_signable.rs
diff --git a/lib/crypto/src/keys/ed25519.rs b/lib/tools/crypto/src/keys/ed25519.rs
similarity index 100%
rename from lib/crypto/src/keys/ed25519.rs
rename to lib/tools/crypto/src/keys/ed25519.rs
diff --git a/lib/crypto/src/keys/mod.rs b/lib/tools/crypto/src/keys/mod.rs
similarity index 100%
rename from lib/crypto/src/keys/mod.rs
rename to lib/tools/crypto/src/keys/mod.rs
diff --git a/lib/crypto/src/keys/text_signable.rs b/lib/tools/crypto/src/keys/text_signable.rs
similarity index 100%
rename from lib/crypto/src/keys/text_signable.rs
rename to lib/tools/crypto/src/keys/text_signable.rs
diff --git a/lib/crypto/src/lib.rs b/lib/tools/crypto/src/lib.rs
similarity index 100%
rename from lib/crypto/src/lib.rs
rename to lib/tools/crypto/src/lib.rs
diff --git a/lib/dal/Cargo.toml b/lib/tools/dal/Cargo.toml
similarity index 86%
rename from lib/dal/Cargo.toml
rename to lib/tools/dal/Cargo.toml
index 2dcbab94..28d9ee14 100644
--- a/lib/dal/Cargo.toml
+++ b/lib/tools/dal/Cargo.toml
@@ -11,8 +11,7 @@ path = "lib.rs"
 [dependencies]
 dup-crypto = { path = "../crypto" }
 dubp-documents= { path = "../documents" }
-duniter-module = { path = "../module" }
-duniter-network = { path = "../network" }
+duniter-module = { path = "../../core/module" }
 durs-wot = { path = "../wot" }
 log = "0.4.*"
 rustbreak = {version = "2.0.0-rc3", features = ["bin_enc"]}
diff --git a/lib/dal/balance.rs b/lib/tools/dal/balance.rs
similarity index 100%
rename from lib/dal/balance.rs
rename to lib/tools/dal/balance.rs
diff --git a/lib/dal/block.rs b/lib/tools/dal/block.rs
similarity index 100%
rename from lib/dal/block.rs
rename to lib/tools/dal/block.rs
diff --git a/lib/dal/certs.rs b/lib/tools/dal/certs.rs
similarity index 100%
rename from lib/dal/certs.rs
rename to lib/tools/dal/certs.rs
diff --git a/lib/dal/clippy.toml b/lib/tools/dal/clippy.toml
similarity index 100%
rename from lib/dal/clippy.toml
rename to lib/tools/dal/clippy.toml
diff --git a/lib/dal/constants.rs b/lib/tools/dal/constants.rs
similarity index 100%
rename from lib/dal/constants.rs
rename to lib/tools/dal/constants.rs
diff --git a/lib/dal/currency_params.rs b/lib/tools/dal/currency_params.rs
similarity index 100%
rename from lib/dal/currency_params.rs
rename to lib/tools/dal/currency_params.rs
diff --git a/lib/dal/dal_event.rs b/lib/tools/dal/dal_event.rs
similarity index 100%
rename from lib/dal/dal_event.rs
rename to lib/tools/dal/dal_event.rs
diff --git a/lib/dal/dal_requests.rs b/lib/tools/dal/dal_requests.rs
similarity index 100%
rename from lib/dal/dal_requests.rs
rename to lib/tools/dal/dal_requests.rs
diff --git a/lib/dal/identity.rs b/lib/tools/dal/identity.rs
similarity index 100%
rename from lib/dal/identity.rs
rename to lib/tools/dal/identity.rs
diff --git a/lib/dal/lib.rs b/lib/tools/dal/lib.rs
similarity index 100%
rename from lib/dal/lib.rs
rename to lib/tools/dal/lib.rs
diff --git a/lib/dal/parsers/certifications.rs b/lib/tools/dal/parsers/certifications.rs
similarity index 100%
rename from lib/dal/parsers/certifications.rs
rename to lib/tools/dal/parsers/certifications.rs
diff --git a/lib/dal/parsers/mod.rs b/lib/tools/dal/parsers/mod.rs
similarity index 100%
rename from lib/dal/parsers/mod.rs
rename to lib/tools/dal/parsers/mod.rs
diff --git a/lib/dal/parsers/revoked.rs b/lib/tools/dal/parsers/revoked.rs
similarity index 100%
rename from lib/dal/parsers/revoked.rs
rename to lib/tools/dal/parsers/revoked.rs
diff --git a/lib/dal/sources.rs b/lib/tools/dal/sources.rs
similarity index 100%
rename from lib/dal/sources.rs
rename to lib/tools/dal/sources.rs
diff --git a/lib/dal/tools.rs b/lib/tools/dal/tools.rs
similarity index 100%
rename from lib/dal/tools.rs
rename to lib/tools/dal/tools.rs
diff --git a/lib/dal/writers/block.rs b/lib/tools/dal/writers/block.rs
similarity index 100%
rename from lib/dal/writers/block.rs
rename to lib/tools/dal/writers/block.rs
diff --git a/lib/dal/writers/certification.rs b/lib/tools/dal/writers/certification.rs
similarity index 100%
rename from lib/dal/writers/certification.rs
rename to lib/tools/dal/writers/certification.rs
diff --git a/lib/dal/writers/dividend.rs b/lib/tools/dal/writers/dividend.rs
similarity index 100%
rename from lib/dal/writers/dividend.rs
rename to lib/tools/dal/writers/dividend.rs
diff --git a/lib/dal/writers/identity.rs b/lib/tools/dal/writers/identity.rs
similarity index 100%
rename from lib/dal/writers/identity.rs
rename to lib/tools/dal/writers/identity.rs
diff --git a/lib/dal/writers/mod.rs b/lib/tools/dal/writers/mod.rs
similarity index 100%
rename from lib/dal/writers/mod.rs
rename to lib/tools/dal/writers/mod.rs
diff --git a/lib/dal/writers/requests.rs b/lib/tools/dal/writers/requests.rs
similarity index 100%
rename from lib/dal/writers/requests.rs
rename to lib/tools/dal/writers/requests.rs
diff --git a/lib/dal/writers/transaction.rs b/lib/tools/dal/writers/transaction.rs
similarity index 100%
rename from lib/dal/writers/transaction.rs
rename to lib/tools/dal/writers/transaction.rs
diff --git a/lib/documents/Cargo.toml b/lib/tools/documents/Cargo.toml
similarity index 100%
rename from lib/documents/Cargo.toml
rename to lib/tools/documents/Cargo.toml
diff --git a/lib/documents/README.md b/lib/tools/documents/README.md
similarity index 100%
rename from lib/documents/README.md
rename to lib/tools/documents/README.md
diff --git a/lib/documents/src/blockstamp.rs b/lib/tools/documents/src/blockstamp.rs
similarity index 100%
rename from lib/documents/src/blockstamp.rs
rename to lib/tools/documents/src/blockstamp.rs
diff --git a/lib/documents/src/currencies_codes.rs b/lib/tools/documents/src/currencies_codes.rs
similarity index 100%
rename from lib/documents/src/currencies_codes.rs
rename to lib/tools/documents/src/currencies_codes.rs
diff --git a/lib/documents/src/documents_grammar.pest b/lib/tools/documents/src/documents_grammar.pest
similarity index 100%
rename from lib/documents/src/documents_grammar.pest
rename to lib/tools/documents/src/documents_grammar.pest
diff --git a/lib/documents/src/lib.rs b/lib/tools/documents/src/lib.rs
similarity index 100%
rename from lib/documents/src/lib.rs
rename to lib/tools/documents/src/lib.rs
diff --git a/lib/documents/src/v10/block.rs b/lib/tools/documents/src/v10/block.rs
similarity index 100%
rename from lib/documents/src/v10/block.rs
rename to lib/tools/documents/src/v10/block.rs
diff --git a/lib/documents/src/v10/certification.rs b/lib/tools/documents/src/v10/certification.rs
similarity index 100%
rename from lib/documents/src/v10/certification.rs
rename to lib/tools/documents/src/v10/certification.rs
diff --git a/lib/documents/src/v10/identity.rs b/lib/tools/documents/src/v10/identity.rs
similarity index 100%
rename from lib/documents/src/v10/identity.rs
rename to lib/tools/documents/src/v10/identity.rs
diff --git a/lib/documents/src/v10/membership.rs b/lib/tools/documents/src/v10/membership.rs
similarity index 100%
rename from lib/documents/src/v10/membership.rs
rename to lib/tools/documents/src/v10/membership.rs
diff --git a/lib/documents/src/v10/mod.rs b/lib/tools/documents/src/v10/mod.rs
similarity index 100%
rename from lib/documents/src/v10/mod.rs
rename to lib/tools/documents/src/v10/mod.rs
diff --git a/lib/documents/src/v10/revocation.rs b/lib/tools/documents/src/v10/revocation.rs
similarity index 100%
rename from lib/documents/src/v10/revocation.rs
rename to lib/tools/documents/src/v10/revocation.rs
diff --git a/lib/documents/src/v10/transaction.rs b/lib/tools/documents/src/v10/transaction.rs
similarity index 100%
rename from lib/documents/src/v10/transaction.rs
rename to lib/tools/documents/src/v10/transaction.rs
diff --git a/lib/network-documents/Cargo.toml b/lib/tools/network-documents/Cargo.toml
similarity index 100%
rename from lib/network-documents/Cargo.toml
rename to lib/tools/network-documents/Cargo.toml
diff --git a/lib/network-documents/src/lib.rs b/lib/tools/network-documents/src/lib.rs
similarity index 100%
rename from lib/network-documents/src/lib.rs
rename to lib/tools/network-documents/src/lib.rs
diff --git a/lib/network-documents/src/network_documents.pest b/lib/tools/network-documents/src/network_documents.pest
similarity index 100%
rename from lib/network-documents/src/network_documents.pest
rename to lib/tools/network-documents/src/network_documents.pest
diff --git a/lib/network-documents/src/network_endpoint.rs b/lib/tools/network-documents/src/network_endpoint.rs
similarity index 100%
rename from lib/network-documents/src/network_endpoint.rs
rename to lib/tools/network-documents/src/network_endpoint.rs
diff --git a/lib/network-documents/src/network_head.rs b/lib/tools/network-documents/src/network_head.rs
similarity index 100%
rename from lib/network-documents/src/network_head.rs
rename to lib/tools/network-documents/src/network_head.rs
diff --git a/lib/network-documents/src/network_head_v2.rs b/lib/tools/network-documents/src/network_head_v2.rs
similarity index 100%
rename from lib/network-documents/src/network_head_v2.rs
rename to lib/tools/network-documents/src/network_head_v2.rs
diff --git a/lib/network-documents/src/network_head_v3.rs b/lib/tools/network-documents/src/network_head_v3.rs
similarity index 100%
rename from lib/network-documents/src/network_head_v3.rs
rename to lib/tools/network-documents/src/network_head_v3.rs
diff --git a/lib/network-documents/src/network_peer.rs b/lib/tools/network-documents/src/network_peer.rs
similarity index 100%
rename from lib/network-documents/src/network_peer.rs
rename to lib/tools/network-documents/src/network_peer.rs
diff --git a/lib/wot/Cargo.toml b/lib/tools/wot/Cargo.toml
similarity index 100%
rename from lib/wot/Cargo.toml
rename to lib/tools/wot/Cargo.toml
diff --git a/lib/wot/README.md b/lib/tools/wot/README.md
similarity index 100%
rename from lib/wot/README.md
rename to lib/tools/wot/README.md
diff --git a/lib/wot/data/mod.rs b/lib/tools/wot/data/mod.rs
similarity index 100%
rename from lib/wot/data/mod.rs
rename to lib/tools/wot/data/mod.rs
diff --git a/lib/wot/data/rusty.rs b/lib/tools/wot/data/rusty.rs
similarity index 100%
rename from lib/wot/data/rusty.rs
rename to lib/tools/wot/data/rusty.rs
diff --git a/lib/wot/lib.rs b/lib/tools/wot/lib.rs
similarity index 100%
rename from lib/wot/lib.rs
rename to lib/tools/wot/lib.rs
diff --git a/lib/wot/operations/centrality.rs b/lib/tools/wot/operations/centrality.rs
similarity index 100%
rename from lib/wot/operations/centrality.rs
rename to lib/tools/wot/operations/centrality.rs
diff --git a/lib/wot/operations/distance.rs b/lib/tools/wot/operations/distance.rs
similarity index 100%
rename from lib/wot/operations/distance.rs
rename to lib/tools/wot/operations/distance.rs
diff --git a/lib/wot/operations/file.rs b/lib/tools/wot/operations/file.rs
similarity index 100%
rename from lib/wot/operations/file.rs
rename to lib/tools/wot/operations/file.rs
diff --git a/lib/wot/operations/mod.rs b/lib/tools/wot/operations/mod.rs
similarity index 100%
rename from lib/wot/operations/mod.rs
rename to lib/tools/wot/operations/mod.rs
diff --git a/lib/wot/operations/path.rs b/lib/tools/wot/operations/path.rs
similarity index 100%
rename from lib/wot/operations/path.rs
rename to lib/tools/wot/operations/path.rs
diff --git a/lib/wot/tests/g1_genesis.bin b/lib/tools/wot/tests/g1_genesis.bin
similarity index 100%
rename from lib/wot/tests/g1_genesis.bin
rename to lib/tools/wot/tests/g1_genesis.bin
diff --git a/lib/tui/Cargo.toml b/lib/tui/Cargo.toml
deleted file mode 100644
index ca690b9e..00000000
--- a/lib/tui/Cargo.toml
+++ /dev/null
@@ -1,29 +0,0 @@
-[package]
-name = "duniter-tui"
-version = "0.1.0-a0.1"
-authors = ["librelois <elois@ifee.fr>"]
-description = "Terminal user interface for Duniter-Rs."
-license = "AGPL-3.0"
-
-[lib]
-path = "lib.rs"
-
-[dependencies]
-duniter-conf = { path = "../conf" }
-dup-crypto = { path = "../crypto" }
-duniter-dal = { path = "../dal" }
-dubp-documents= { path = "../documents" }
-duniter-message =  { path = "../message" }
-duniter-module = { path = "../module" }
-duniter-network = { path = "../network" }
-durs-network-documents = { path = "../network-documents" }
-log = "0.4.*"
-serde = "1.0.*"
-serde_derive = "1.0.*"
-serde_json = "1.0.*"
-structopt= "0.2.*"
-termion = "1.5.*"
-
-[features]
-# Treat warnings as a build error.
-strict = []
\ No newline at end of file
diff --git a/lib/ws2p/Cargo.toml b/lib/ws2p/Cargo.toml
deleted file mode 100644
index 6611c325..00000000
--- a/lib/ws2p/Cargo.toml
+++ /dev/null
@@ -1,28 +0,0 @@
-[package]
-name = "durs-ws2p"
-version = "0.1.0-a0.1"
-authors = ["librelois <elois@ifee.fr>"]
-description = "WebSocketToPeer API for DURS Project."
-license = "AGPL-3.0"
-
-[lib]
-path = "lib.rs"
-
-[dependencies]
-bincode = "1.0.*"
-duniter-conf= { path = "../conf" }
-dup-crypto = { path = "../crypto" }
-dubp-documents= { path = "../documents" }
-durs-network-documents = { path = "../network-documents" }
-durs-ws2p-messages = { path = "../ws2p-messages" }
-duniter-message= { path = "../message" }
-duniter-module = { path = "../module" }
-duniter-network = { path = "../network" }
-log = "0.4.*"
-serde = "1.0.*"
-serde_derive = "1.0.*"
-structopt= "0.2.*"
-
-[features]
-# Treat warnings as a build error.
-strict = []
\ No newline at end of file
-- 
GitLab