WIP: Resolve "Implement Client API GVA : GraphQL Verification Api"
Closes #89 (closed)
Merge request reports
Activity
changed milestone to %v1.0 full member node
assigned to @ji_emme
added 85 commits
-
84da0a27...f8a7e964 - 84 commits from branch
dev
- ea9cc365 - wip
-
84da0a27...f8a7e964 - 84 commits from branch
added 33 commits
-
ea9cc365...9891b755 - 32 commits from branch
dev
- eb0dad79 - wip
-
ea9cc365...9891b755 - 32 commits from branch
added 14 commits
-
a5ca64a4...e3e227fe - 12 commits from branch
dev
- e7a7b456 - wip
- 29e8b646 - [ref] gva: : add srv and resources folder
-
a5ca64a4...e3e227fe - 12 commits from branch
added 79 commits
-
29e8b646...263b7549 - 77 commits from branch
dev
- e5c3af09 - wip
- f8d76f94 - [ref] gva: : add srv and resources folder
-
29e8b646...263b7549 - 77 commits from branch
added 9 commits
-
f8d76f94...51f2b2e5 - 7 commits from branch
dev
- 03542226 - wip
- 9d607e9c - [ref] gva: : add srv and resources folder
-
f8d76f94...51f2b2e5 - 7 commits from branch
added 33 commits
-
b6216ae9...22599cb4 - 30 commits from branch
dev
- 50abdca1 - wip
- 749b115c - [ref] gva: : add srv and resources folder
- 56cbab91 - WIP
Toggle commit list-
b6216ae9...22599cb4 - 30 commits from branch
added 6 commits
-
56cbab91...a81f5e92 - 3 commits from branch
dev
- 23ca980f - wip
- 7a0bfe70 - [ref] gva: : add srv and resources folder
- 71e7d628 - WIP
Toggle commit list-
56cbab91...a81f5e92 - 3 commits from branch
added 8 commits
-
7e782a22...031cf33d - 4 commits from branch
dev
- 6ccd4ace - wip
- a8ed26ad - [ref] gva: : add srv and resources folder
- 985798fc - WIP
- d5b5bca2 - wip
Toggle commit list-
7e782a22...031cf33d - 4 commits from branch
added S-request review label
- Resolved by Éloïs
- Resolved by Éloïs
- Resolved by Éloïs
- Resolved by Éloïs
- Resolved by Éloïs
- lib/modules/gva/src/lib.rs 0 → 100644
236 if stop { 237 break; 238 } 239 } 240 Err(e) => { 241 // Log error 242 warn!("{}", e); 243 break; 244 } 245 } 246 } 247 }); 248 249 let smd: SoftwareMetaDatas<DuRsConf> = soft_meta_datas.clone(); 250 thread::spawn(move || { 251 let _ = webserver::start_web_server(&smd); changed this line in version 26 of the diff
- Resolved by Éloïs
- Resolved by Éloïs
- Resolved by Éloïs
- lib/modules/gva/src/webserver.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 @ji_emme chaque module rust doit être documenté, je parle bien de "modules" au sens Rust du terme, c'est a dire chaque fichier. La documentation du module rust se fait en préfixant par //!
- Resolved by Éloïs
- lib/modules/gva/src/webserver.rs 0 → 100644
28 fn graphiql() -> HttpResponse { 29 let html = graphiql_source("http://127.0.0.1:3000/graphql"); 30 println!("html { }", &html); 31 HttpResponse::Ok() 32 .content_type("text/html; charset=utf-8") 33 .body(html) 34 } 35 36 fn graphql( 37 st: web::Data<Arc<Schema>>, 38 data: web::Json<GraphQLRequest>, 39 ) -> impl Future<Item = HttpResponse, Error = Error> { 40 let context = crate::context::get_context(); 41 web::block(move || { 42 let res = data.execute(&st, context); 43 Ok::<_, serde_json::error::Error>(serde_json::to_string(&res)?) changed this line in version 21 of the diff
quand je supprime le « ? » j’ai cette erreur de compilation
@ji_emme c'est parce que tu demande explicitement au compilateur de retourner un Ok, ce qui n'a aucun sens puisque les cas d'erreurs sont gérés par le map_err juste en dessous. Pourquoi voulais tu retourner un Ok ? Plus généralement, le simple fait d'écrire un Ok::<T, E> explicite est une mauvaise pratique, la bonne façon est de retourner le Result et de traiter l'erreur plus loin.
- Resolved by Éloïs
- Resolved by Éloïs
added 1 commit
- d6928152 - wip [docs] gva module : module documentation
added 17 commits
-
e9482ea2...30351d42 - 3 commits from branch
dev
- 6283eba4 - wip
- 04b39190 - [ref] gva: : add srv and resources folder
- 4ba22b21 - WIP
- 970fc49f - wip
- 918ee139 - wip
- 5d6dfc6e - wip
- ab31a57d - wip elois
- 344a8132 - wip
- e3b25d14 - wip update juniper-from-schema
- 6a651f2d - wip review
- f2a38758 - wip [docs] gva module : module documentation
- ffa5c637 - WIP
- 069b7a99 - wip
- 1f0f1c79 - wip
Toggle commit list-
e9482ea2...30351d42 - 3 commits from branch
- lib/modules/gva/src/lib.rs 0 → 100644
41 #[macro_use] 42 extern crate structopt; 43 44 extern crate juniper; 45 46 mod context; 47 mod schema; 48 mod webserver; 49 50 use dubp_currency_params::CurrencyName; 51 use durs_common_tools::fatal_error; 52 use durs_common_tools::traits::merge::Merge; 53 use durs_conf::DuRsConf; 54 use durs_message::events::*; 55 use durs_message::*; 56 use durs_module::*; changed this line in version 29 of the diff
@ji_emme je t'ai ajouté la configuration du host et du port d'écoute, c'est sur la branche
elois/gva-host-port
, tu peut te rebaser dessus directement :)- lib/modules/gva/src/lib.rs 0 → 100644
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 //! Gva Module 17 // This module provides a graphql API implementation of the 0003 RFC 18 // 19 // /src/schema.gql contains schema description 20 // /src/schema.rs contains model and resolvers implementation 21 // /src/webserver.rs contains web server implementaion based on actix-web 22 // 23 // Graphiql web client is accessible at 24 // http://127.0.0.1:3000/graphiql @ji_emme c'est bien mais il faut préfixer toutes les lignes par //!, pas seulement la première. Tu peut vérifier le rendu en générant la doc, commande
cargo doc
a la racine du projet (attention c'est très long a générer) Puis ouvre dans un navigateur le fichiertarget/doc/dunitrust/index.html
Du coup quand tu aura récupérer ma feature de config du host et du port il faudra remplacer 127.0.0.1:3000 par host:port, en précisant les valeurs par défaut :)
- lib/modules/gva/Cargo.toml 0 → 100644
8 9 [lib] 10 path = "src/lib.rs" 11 12 [dependencies] 13 proc-macro2 = "1.0.6" 14 actix-web = "1.0.8" 15 dubp-block-doc = { path = "../../dubp/block-doc"} #, version = "0.1.0" } 16 durs-bc-db-reader = { path = "../../modules-lib/bc-db-reader" } 17 durs-conf = { path = "../../core/conf" } 18 durs-message = { path = "../../core/message" } 19 durs-module = { path = "../../core/module" } 20 durs-network = { path = "../../core/network" } 21 dubp-common-doc = { path = "../../dubp/common-doc"} #, version = "0.1.0" } 22 durs-common-tools = { path = "../../tools/common-tools" } 23 dubp-currency-params = { path = "../../dubp/currency-params" } - lib/modules/gva/Cargo.toml 0 → 100644
14 actix-web = "1.0.8" 15 dubp-block-doc = { path = "../../dubp/block-doc"} #, version = "0.1.0" } 16 durs-bc-db-reader = { path = "../../modules-lib/bc-db-reader" } 17 durs-conf = { path = "../../core/conf" } 18 durs-message = { path = "../../core/message" } 19 durs-module = { path = "../../core/module" } 20 durs-network = { path = "../../core/network" } 21 dubp-common-doc = { path = "../../dubp/common-doc"} #, version = "0.1.0" } 22 durs-common-tools = { path = "../../tools/common-tools" } 23 dubp-currency-params = { path = "../../dubp/currency-params" } 24 failure = "0.1.5" 25 futures = "0.1" 26 futures-cpupool = "0.1" 27 juniper = "0.14.0" 28 29 juniper-from-schema = "0.5.0"