WIP: gva first minimal schema with identitydocument
Merge request reports
Activity
changed milestone to %v1.0 full member node
added C-gva label
- Resolved by Éloïs
42 43 #[cfg(not(target_arch = "arm"))] 43 44 fn main() { 44 45 durs_core_server!( 45 durs_inject_cli![WS2PModule /*, SkeletonModule ,DasaModule*/], 46 durs_plug!([WS2PModule], [TuiModule /*, SkeletonModule ,DasaModule*/]) 46 durs_inject_cli![WS2PModule, GvaModule /*, SkeletonModule ,DasaModule*/], 47 durs_plug!([WS2PModule], [TuiModule, GvaModule /*, SkeletonModule ,DasaModule*/]) changed this line in version 2 of the diff
- lib/modules/gva/Cargo.toml 0 → 100644
1 [package] 2 name = "durs-gva" 3 version = "0.1.0" 4 authors = ["name <mail@domain.tld>"] 5 description = "Module template to copy to create a new Durs module." changed this line in version 3 of the diff
- lib/modules/gva/Cargo.toml 0 → 100644
2 name = "durs-gva" 3 version = "0.1.0" 4 authors = ["name <mail@domain.tld>"] 5 description = "Module template to copy to create a new Durs module." 6 license = "AGPL-3.0" 7 edition = "2018" 8 9 [lib] 10 path = "lib.rs" 11 12 [dependencies] 13 duniter-conf = { path = "../../core/conf" } 14 durs-message = { path = "../../core/message" } 15 duniter-module = { path = "../../core/module" } 16 duniter-network = { path = "../../core/network" } 17 dup-crypto = { path = "../../tools/crypto" } changed this line in version 6 of the diff
- lib/modules/gva/lib.rs 0 → 100644
1 // Copyright (C) 2018 The Duniter Project Developers. 2 // 3 // This program is free software: you can redistribute it and/or modify 4 // it under the terms of the GNU Affero General Public License as 5 // published by the Free Software Foundation, either version 3 of the 6 // License, or (at your option) any later version. 7 // 8 // This program is distributed in the hope that it will be useful, 9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 // GNU Affero General Public License for more details. 12 // 13 // You should have received a copy of the GNU Affero General Public License 14 // along with this program. If not, see <https://www.gnu.org/licenses/>. 15 16 //! Module template to copy to create a new Durs module. changed this line in version 3 of the diff
- lib/modules/gva/lib.rs 0 → 100644
3 // This program is free software: you can redistribute it and/or modify 4 // it under the terms of the GNU Affero General Public License as 5 // published by the Free Software Foundation, either version 3 of the 6 // License, or (at your option) any later version. 7 // 8 // This program is distributed in the hope that it will be useful, 9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 // GNU Affero General Public License for more details. 12 // 13 // You should have received a copy of the GNU Affero General Public License 14 // along with this program. If not, see <https://www.gnu.org/licenses/>. 15 16 //! Module template to copy to create a new Durs module. 17 18 #![cfg_attr(feature = "strict", deny(warnings))] up, remarque toujours pas résolue
Edited by Éloïschanged this line in version 3 of the diff
- lib/modules/gva/lib.rs 0 → 100644
39 use duniter_module::*; 40 use duniter_network::events::NetworkEvent; 41 use durs_message::events::*; 42 use durs_message::*; 43 use std::ops::Deref; 44 use std::sync::mpsc; 45 use std::thread; 46 use std::time::{Duration, SystemTime}; 47 48 /// Name of your module 49 pub static MODULE_NAME: &'static str = "gva"; 50 51 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] 52 /// Gva Module Configuration 53 pub struct GvaConf { 54 test_fake_conf_field: String, changed this line in version 3 of the diff
- lib/modules/gva/lib.rs 0 → 100644
71 pub enum GvaMsg { 72 /// Message from another module 73 DursMsg(Box<DursMsg>), 74 /// Message from others thread of gva module 75 GvaThreadMsg(GvaThreadMsg), 76 } 77 78 #[derive(StructOpt, Debug, Clone)] 79 #[structopt( 80 name = "gva", 81 raw(setting = "structopt::clap::AppSettings::ColoredHelp") 82 )] 83 /// Gva subcommand options 84 pub struct GvaOpt { 85 /// Change test conf fake field 86 pub new_conf_field: String, changed this line in version 3 of the diff
- lib/modules/gva/lib.rs 0 → 100644
102 impl Default for GvaModule { 103 fn default() -> GvaModule { 104 GvaModule {} 105 } 106 } 107 108 impl DursModule<DuRsConf, DursMsg> for GvaModule { 109 type ModuleConf = GvaConf; 110 type ModuleOpt = GvaOpt; 111 112 fn name() -> ModuleStaticName { 113 ModuleStaticName(MODULE_NAME) 114 } 115 fn priority() -> ModulePriority { 116 //ModulePriority::Recommended() 117 ModulePriority::Optional() changed this line in version 3 of the diff
- lib/modules/gva/lib.rs 0 → 100644
105 } 106 } 107 108 impl DursModule<DuRsConf, DursMsg> for GvaModule { 109 type ModuleConf = GvaConf; 110 type ModuleOpt = GvaOpt; 111 112 fn name() -> ModuleStaticName { 113 ModuleStaticName(MODULE_NAME) 114 } 115 fn priority() -> ModulePriority { 116 //ModulePriority::Recommended() 117 ModulePriority::Optional() 118 } 119 fn ask_required_keys() -> RequiredKeys { 120 RequiredKeys::None() changed this line in version 3 of the diff
- lib/modules/gva/lib.rs 0 → 100644
186 let (proxy_sender, proxy_receiver): (mpsc::Sender<DursMsg>, mpsc::Receiver<DursMsg>) = 187 mpsc::channel(); 188 189 // Launch a proxy thread that transform DursMsgContent() to SkeleonMsg::DursMsgContent(DursMsgContent()) 190 let router_sender_clone = router_sender.clone(); 191 let gva_sender_clone = gva_sender.clone(); 192 thread::spawn(move || { 193 // Send gva module registration to router thread 194 router_sender_clone 195 .send(RouterThreadMessage::ModuleRegistration( 196 ModuleStaticName(MODULE_NAME), 197 proxy_sender, // Messages sent by the router will be received by your proxy thread 198 vec![ModuleRole::UserInterface], // Roles assigned to your module 199 vec![ModuleEvent::NewValidBlock], // Events to which your module subscribes 200 vec![], 201 vec![], En s'enregistrant au rooteur, GVA doit réserve le nom d'API "GVA" et doit déclarer son endpoint.
Edited by Éloïschanged this line in version 8 of the diff
- lib/modules/gva/lib.rs 0 → 100644
298 } 299 GvaMsg::GvaThreadMsg(ref _child_thread_msg) => { 300 // Do something when receive a message from child thread. 301 } 302 }, 303 Err(e) => match e { 304 mpsc::RecvTimeoutError::Disconnected => { 305 panic!("Disconnected gva module !"); 306 } 307 mpsc::RecvTimeoutError::Timeout => { 308 // If you arrive here it's because your main thread did not receive anything at the end of the timeout. 309 // This is quite normal and happens regularly when there is little activity, there is nothing particular to do. 310 } 311 }, 312 } 313 // If you want your module's main thread to do things even when it doesn't receive any messages, this is the place where it can do them. changed this line in version 3 of the diff
added 58 commits
-
6c638392...44eda1c8 - 56 commits from branch
dev
- 876514b8 - [feat] module GVA created
- e23f8c50 - [feat] empty module GVA injected into the server
-
6c638392...44eda1c8 - 56 commits from branch
@counter-reverse je t'ai fait une review de code il y a 3 semaines avec 12 remarques. Je vois que 11 remarques sur 12 n'ont pas été résolues, du coup je suppose que ce n'était qu'une mise a jours de ta branche :)
Quand pense tu avoir le temps de traiter mes retours ?
j'ai vu que le Cargo.toml à la racine comportait "lib/modules/durs-gva" au lieu de "lib/modules/gva". J'ai réglé ce problème. J'en ai donc résolu beaucoup
C'est toi qui avait rajouté
durs-
, ce n'est qu'un fix de ton propre code, tu n'a donc rien "résolu", c'est juste normal de corriger ses propres erreurs, c'est 80% du travail d'un développeur ;)je vais pourtant revenir en arrière.
Pourquoi ?
added 79 commits
-
e23f8c50...fb90fcf3 - 77 commits from branch
dev
- c943aa50 - [feat] module GVA created
- fc02d876 - [feat] empty module GVA injected into the server
-
e23f8c50...fb90fcf3 - 77 commits from branch
J'ai pensé à toutes les remarques par contre j'ai oublié clippy et fmt. J'y vais tout de suite.
J'ai aussi remarqué une importante mise à jour avec pas mal de refactoring sur le module skeleton. J'y ai fait attention et espère avoir correctement tout pris en compte.
EDIT: J'ai modifié le commit c943aa50 - [feat] module GVA created mais pas encore fc02d876 - [feat] empty module GVA injected into the server. J'y vais.