Compare commits

..

No commits in common. "428047e4e76d673a15a9a63ce88c7e078b087ffb" and "fd2ecdee4c4962b7155a93d90872549ea0364dcc" have entirely different histories.

13 changed files with 167 additions and 358 deletions

251
Cargo.lock generated
View file

@ -1,7 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "Inflector"
version = "0.11.4"
@ -20,9 +18,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aho-corasick"
version = "0.7.20"
version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
dependencies = [
"memchr",
]
@ -72,12 +70,6 @@ dependencies = [
"serde",
]
[[package]]
name = "ascii_utils"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a"
[[package]]
name = "async-bincode"
version = "0.6.1"
@ -86,7 +78,7 @@ checksum = "2a31c08aa335b3ab414d29bdefe1f4353408abf93f3db1e3e2cc78d3ec4f0d43"
dependencies = [
"bincode",
"byteorder",
"bytes",
"bytes 1.0.1",
"futures-core",
"futures-sink",
"serde",
@ -95,25 +87,21 @@ dependencies = [
[[package]]
name = "async-graphql"
version = "4.0.6"
version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84ecd9edbd48b68e44f81b720d83e670d876dce440856feee6c892c8cd3f6798"
checksum = "bb5e71af65ee4a367603829e92b26710caf4116d1eaca8953dedf1809b33694a"
dependencies = [
"async-graphql-derive",
"async-graphql-parser",
"async-graphql-value",
"async-stream",
"async-trait",
"bytes",
"fast_chemail",
"fnv",
"futures-util",
"http",
"indexmap",
"log",
"mime",
"multer",
"num-traits",
"once_cell",
"pin-project-lite",
"regex",
@ -126,13 +114,13 @@ dependencies = [
[[package]]
name = "async-graphql-derive"
version = "4.0.6"
version = "2.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8801127f6a7b3af410498d2f971ee6da8f12f9b0b784473da636ce04e5ac565"
checksum = "6fd4c2eb837e894909fe13509f2351fa3990c114426e41255936800892ccbe26"
dependencies = [
"Inflector",
"async-graphql-parser",
"darling 0.14.4",
"darling 0.12.4",
"proc-macro-crate",
"proc-macro2",
"quote",
@ -142,24 +130,23 @@ dependencies = [
[[package]]
name = "async-graphql-parser"
version = "4.0.6"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4097e2e3e313a9220df25485046b7749f4b8d749aba8ed7e09e929d60a643e3"
checksum = "2a8d8116f3015b7686ef98ffb70a74183c3c17bf45135993d3f095812e09e786"
dependencies = [
"async-graphql-value",
"pest",
"pest_derive",
"serde",
"serde_json",
]
[[package]]
name = "async-graphql-value"
version = "4.0.16"
version = "2.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a941b499fead4a3fb5392cabf42446566d18c86313f69f2deab69560394d65f"
checksum = "d8342ada84efe4b3d59e1313d1d2740a8ccfc76ddb57ccf55e45a6464dd7d0d3"
dependencies = [
"bytes",
"indexmap",
"serde",
"serde_json",
]
@ -359,14 +346,17 @@ version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "bytes"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "bytes"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
dependencies = [
"serde",
]
[[package]]
name = "cc"
@ -438,6 +428,12 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
[[package]]
name = "cpuid-bool"
version = "0.1.2"
@ -536,12 +532,12 @@ dependencies = [
[[package]]
name = "darling"
version = "0.14.4"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c"
dependencies = [
"darling_core 0.14.4",
"darling_macro 0.14.4",
"darling_core 0.12.4",
"darling_macro 0.12.4",
]
[[package]]
@ -560,9 +556,9 @@ dependencies = [
[[package]]
name = "darling_core"
version = "0.14.4"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36"
dependencies = [
"fnv",
"ident_case",
@ -585,11 +581,11 @@ dependencies = [
[[package]]
name = "darling_macro"
version = "0.14.4"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a"
dependencies = [
"darling_core 0.14.4",
"darling_core 0.12.4",
"quote",
"syn",
]
@ -636,6 +632,18 @@ dependencies = [
"syn",
]
[[package]]
name = "derive_more"
version = "0.99.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6"
dependencies = [
"convert_case",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "diff"
version = "0.1.12"
@ -686,9 +694,9 @@ checksum = "4bb454f0228b18c7f4c3b0ebbee346ed9c52e7443b0999cd543ff3571205701d"
[[package]]
name = "dubp"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "429ad631310968b6f0ef8b0621ff685ff03a1f69304174c7d8e7dbed47ec68aa"
checksum = "66f0006f2695beb0ebeaf9018bf7fc16f92ad2a60bc5522ca9813d257dc501f4"
dependencies = [
"dubp-block",
"dubp-common",
@ -702,9 +710,9 @@ dependencies = [
[[package]]
name = "dubp-block"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8481be98e093e9f599ef685f8b2880ac273145ce4b12bae45a6fe28b158acb38"
checksum = "4524d9bfb9dff0857d705663138dfc3de0761a322ed7c9a429f2777411f3395c"
dependencies = [
"dubp-documents",
"dubp-documents-parser",
@ -717,9 +725,9 @@ dependencies = [
[[package]]
name = "dubp-common"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab01b4870cd960917b638dfd951996dcb19850fdc9868a46d81c7a48c1882f2a"
checksum = "270b8470070985a1291e0bde3ec76b61b79a148be135a6d2e372e699b5c50d1c"
dependencies = [
"dup-crypto",
"serde",
@ -730,9 +738,9 @@ dependencies = [
[[package]]
name = "dubp-documents"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38c2667a2c02b657ecce47a2f8d421ddd8f193a77277518aa74585bd42303246"
checksum = "cd04417e58905daf5e0a7c392e6deb19c6503f6d1aaff92fd12895d701681427"
dependencies = [
"beef",
"dubp-wallet",
@ -744,9 +752,9 @@ dependencies = [
[[package]]
name = "dubp-documents-parser"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9597df5d36e1e269802341908d8970d58ccde6162b402748f8b8b1bd50c1bec6"
checksum = "3f4e2aa1ce0bd09b26f710ba725e55901ec0ec47fbe26b43b26071f8cf439962"
dependencies = [
"dubp-documents",
"json-pest-parser",
@ -758,9 +766,9 @@ dependencies = [
[[package]]
name = "dubp-wallet"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d044529bbf5928e9519b9040516365e6e20f2d65f8c8e565930f5561b8ff0126"
checksum = "c8ee60a2d7fe343782fa4ab3e281e23cdf4313d8ffb029d64bb600dd53a347bb"
dependencies = [
"byteorder",
"dubp-common",
@ -773,7 +781,7 @@ dependencies = [
[[package]]
name = "dubp-wot"
version = "0.11.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"log",
"once_cell",
@ -785,7 +793,7 @@ dependencies = [
[[package]]
name = "duniter-bc-reader"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"anyhow",
"dubp",
@ -816,9 +824,9 @@ dependencies = [
[[package]]
name = "duniter-bda-types"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a04e49bc24390430f986d07c43a5cafd431ded3954d31d554efd6c34b77c2788"
checksum = "023475a8fefc5dc75f150d3fb0afea984df5be359e1eb061f37a18a1b74be9e7"
dependencies = [
"arrayvec 0.7.0",
"bincode",
@ -832,7 +840,7 @@ dependencies = [
[[package]]
name = "duniter-conf"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"anyhow",
"dubp",
@ -846,7 +854,7 @@ dependencies = [
[[package]]
name = "duniter-core"
version = "1.8.1"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"dubp",
"dubp-wot",
@ -861,7 +869,7 @@ dependencies = [
[[package]]
name = "duniter-dbs"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"arrayvec 0.7.0",
"bincode",
@ -884,7 +892,7 @@ dependencies = [
[[package]]
name = "duniter-dbs-write-ops"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"chrono",
"dubp",
@ -899,7 +907,7 @@ dependencies = [
[[package]]
name = "duniter-global"
version = "1.8.1"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"async-rwlock",
"dubp",
@ -919,7 +927,7 @@ dependencies = [
"async-graphql",
"async-mutex",
"async-trait",
"bytes",
"bytes 1.0.1",
"duniter-bda",
"duniter-core",
"duniter-gva-conf",
@ -1033,7 +1041,7 @@ dependencies = [
[[package]]
name = "duniter-mempools"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"dubp",
"duniter-bc-reader",
@ -1046,7 +1054,7 @@ dependencies = [
[[package]]
name = "duniter-module"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"anyhow",
"async-mutex",
@ -1065,9 +1073,9 @@ dependencies = [
[[package]]
name = "duniter-peer"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "952ebba568abb1a8a1a7f83ff960a88b4c1de9cd29c74c6885ecc83ca56cccaf"
checksum = "1604f510b17e284453cb06f46a9304be9ed65728163ac35f3b22cd5f058952d3"
dependencies = [
"beef",
"dubp-common",
@ -1080,9 +1088,9 @@ dependencies = [
[[package]]
name = "dup-crypto"
version = "0.58.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f74bc2e8282dd156cd62e54686bc77a22dbaa711facac93b27d6f2c72ff5d07a"
checksum = "83e883538079a059b2126a94a13e1d1c62a3a93cd14174eea9d4dd3b4f40cb73"
dependencies = [
"base64",
"blake3",
@ -1173,15 +1181,6 @@ dependencies = [
"num_cpus",
]
[[package]]
name = "fast_chemail"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "495a39d30d624c2caabe6312bfead73e7717692b44e0b32df168c275a2e8e9e4"
dependencies = [
"ascii_utils",
]
[[package]]
name = "flate2"
version = "1.0.20"
@ -1420,7 +1419,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00"
dependencies = [
"bytes",
"bytes 1.0.1",
"fnv",
"futures-core",
"futures-sink",
@ -1447,7 +1446,7 @@ checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855"
dependencies = [
"base64",
"bitflags",
"bytes",
"bytes 1.0.1",
"headers-core",
"http",
"mime",
@ -1494,7 +1493,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
dependencies = [
"bytes",
"bytes 1.0.1",
"fnv",
"itoa",
]
@ -1505,7 +1504,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737"
dependencies = [
"bytes",
"bytes 1.0.1",
"http",
"pin-project-lite",
]
@ -1528,7 +1527,7 @@ version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f006b8784cfb01fe7aa9c46f5f5cd4cf5c85a8c612a0653ec97642979062665"
dependencies = [
"bytes",
"bytes 1.0.1",
"futures-channel",
"futures-core",
"futures-util",
@ -1586,7 +1585,6 @@ checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3"
dependencies = [
"autocfg",
"hashbrown",
"serde",
]
[[package]]
@ -1595,7 +1593,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413"
dependencies = [
"bytes",
"bytes 1.0.1",
]
[[package]]
@ -1643,7 +1641,7 @@ dependencies = [
[[package]]
name = "kv_typed"
version = "0.1.0"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#eebd168525aa1d1424ad12ad71da768471207d83"
source = "git+https://git.duniter.org/nodes/rust/duniter-core#56dd9795ec8e2ee053f4c8ce9e020bd1e335300d"
dependencies = [
"byteorder",
"cfg-if 0.1.10",
@ -1718,9 +1716,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.17"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
"cfg-if 1.0.0",
]
@ -1739,9 +1737,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
[[package]]
name = "memchr"
version = "2.5.0"
version = "2.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
[[package]]
name = "memoffset"
@ -1829,20 +1827,21 @@ dependencies = [
[[package]]
name = "multer"
version = "2.0.4"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ed4198ce7a4cbd2a57af78d28c6fbb57d81ac5f1d6ad79ac6c5587419cbdf22"
checksum = "99851e6ad01b0fbe086dda2dea00d68bb84fc7d7eae2c39ca7313da9197f4d31"
dependencies = [
"bytes",
"bytes 0.5.6",
"derive_more",
"encoding_rs",
"futures-util",
"futures",
"http",
"httparse",
"lazy_static",
"log",
"memchr",
"mime",
"spin 0.9.6",
"version_check",
"regex",
"twoway 0.2.1",
]
[[package]]
@ -1860,7 +1859,7 @@ dependencies = [
"rand 0.7.3",
"safemem",
"tempfile",
"twoway",
"twoway 0.1.8",
]
[[package]]
@ -2171,11 +2170,11 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]]
name = "proc-macro2"
version = "1.0.52"
version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224"
checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
dependencies = [
"unicode-ident",
"unicode-xid",
]
[[package]]
@ -2206,9 +2205,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quote"
version = "1.0.26"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
"proc-macro2",
]
@ -2346,9 +2345,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.7.1"
version = "1.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19"
dependencies = [
"aho-corasick",
"memchr",
@ -2357,9 +2356,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.28"
version = "0.6.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548"
[[package]]
name = "remove_dir_all"
@ -2385,7 +2384,7 @@ dependencies = [
"cc",
"libc",
"once_cell",
"spin 0.5.2",
"spin",
"untrusted",
"web-sys",
"winapi",
@ -2569,12 +2568,6 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spin"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34"
[[package]]
name = "spinning_top"
version = "0.2.3"
@ -2640,13 +2633,13 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2"
[[package]]
name = "syn"
version = "1.0.109"
version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
checksum = "b9505f307c872bab8eb46f77ae357c8eba1fdacead58ee5a850116b1d7f82883"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
"unicode-xid",
]
[[package]]
@ -2737,7 +2730,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83f0c8e7c0addab50b663055baf787d0af7f413a46e6e7fb9559a4e4db7137a5"
dependencies = [
"autocfg",
"bytes",
"bytes 1.0.1",
"libc",
"memchr",
"mio",
@ -2787,7 +2780,7 @@ version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "940a12c99365c31ea8dd9ba04ec1be183ffe4920102bb7122c2f515437601e8e"
dependencies = [
"bytes",
"bytes 1.0.1",
"futures-core",
"futures-sink",
"log",
@ -2908,7 +2901,7 @@ checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24"
dependencies = [
"base64",
"byteorder",
"bytes",
"bytes 1.0.1",
"http",
"httparse",
"input_buffer",
@ -2928,6 +2921,16 @@ dependencies = [
"memchr",
]
[[package]]
name = "twoway"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc"
dependencies = [
"memchr",
"unchecked-index",
]
[[package]]
name = "typenum"
version = "1.13.0"
@ -2940,6 +2943,12 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "unchecked-index"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c"
[[package]]
name = "unicase"
version = "2.6.0"
@ -2958,12 +2967,6 @@ dependencies = [
"matches",
]
[[package]]
name = "unicode-ident"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unicode-normalization"
version = "0.1.17"
@ -3061,7 +3064,7 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "332d47745e9a0c38636dbd454729b147d16bd1ed08ae67b3ab281c4506771054"
dependencies = [
"bytes",
"bytes 1.0.1",
"futures",
"headers",
"http",

View file

@ -9,7 +9,7 @@ repository = "https://git.duniter.org/nodes/rust/modules/duniter-gva"
[dependencies]
anyhow = "1.0.33"
arrayvec = { version = "0.7", features = ["serde"] }
async-graphql = { version = "4.0", features = ["log"] }
async-graphql = { version = "2.8", features = ["log"] }
async-mutex = "1.4.0"
async-trait = "0.1.41"
bytes = "1.0"
@ -41,7 +41,6 @@ tokio = { version = "1.2", features = ["macros", "rt-multi-thread", "time"] }
unwrap = "1.2.1"
[features]
default = ["explorer"]
explorer = ["duniter-gva-db/explorer", "duniter-gva-indexer/explorer"]
[workspace]

View file

@ -20,7 +20,6 @@ mod members_count;
mod peers;
mod prepare_simple_payment;
mod send_txs;
mod sync;
mod utxos;
use duniter_core::crypto::keys::KeyPair;
@ -48,26 +47,30 @@ pub(super) async fn execute_req_type(
BcaReqTypeV0::BalancesOfPubkeys(pubkeys) => {
balances::exec_req_balances_of_pubkeys(bda_executor, pubkeys).await
}
BcaReqTypeV0::BalancesOfScripts(scripts) => {
balances::exec_req_balances_of_scripts(bda_executor, scripts).await
}
BcaReqTypeV0::CompressedBlockChunk { chunk_id } => {
sync::exec_req_compressed_block_chunk(bda_executor, chunk_id).await
}
BcaReqTypeV0::CurrentBlockstamp => {
if let Some(current_meta) = bda_executor.cm_accessor.get_current_meta(|cm| *cm).await {
Ok(BcaRespTypeV0::CurrentBlockstamp(
current_meta.current_block_meta.blockstamp(),
))
} else {
Err("no blockchain".into())
}
}
BcaReqTypeV0::CurrentUd => current_ud::exec_req_current_ud(bda_executor).await,
BcaReqTypeV0::FirstUtxosOfPubkeys {
amount_target_opt,
pubkeys,
} => utxos::exec_req_first_utxos_of_pubkeys(bda_executor, amount_target_opt, pubkeys).await,
BcaReqTypeV0::LastBlockstampOutOfForkWindow => {
last_blockstamp_out_of_fork_window::exec_req_last_blockstamp_out_of_fork_window(
bda_executor,
)
.await
}
BcaReqTypeV0::MembersCount => members_count::exec_req_members_count(bda_executor).await,
BcaReqTypeV0::PrepareSimplePayment(params) => {
prepare_simple_payment::exec_req_prepare_simple_payment(bda_executor, params).await
}
BcaReqTypeV0::ProofServerPubkey { challenge } => Ok(BcaRespTypeV0::ProofServerPubkey {
challenge,
server_pubkey: bda_executor.self_keypair.public_key(),
sig: bda_executor
.self_keypair
.generate_signator()
.sign(&challenge),
}),
BcaReqTypeV0::Ping => Ok(BcaRespTypeV0::Pong),
BcaReqTypeV0::SendTxs(txs) => send_txs::send_txs(bda_executor, txs).await,
BcaReqTypeV0::Identities(pubkeys) => {
let dbs_reader = bda_executor.dbs_reader();
Ok(BcaRespTypeV0::Identities(
@ -89,27 +92,10 @@ pub(super) async fn execute_req_type(
.await??,
))
}
BcaReqTypeV0::LastBlockstampOutOfForkWindow => {
last_blockstamp_out_of_fork_window::exec_req_last_blockstamp_out_of_fork_window(
bda_executor,
)
.await
BcaReqTypeV0::CurrentUd => current_ud::exec_req_current_ud(bda_executor).await,
BcaReqTypeV0::BalancesOfScripts(scripts) => {
balances::exec_req_balances_of_scripts(bda_executor, scripts).await
}
BcaReqTypeV0::MembersCount => members_count::exec_req_members_count(bda_executor).await,
BcaReqTypeV0::PrepareSimplePayment(params) => {
prepare_simple_payment::exec_req_prepare_simple_payment(bda_executor, params).await
}
BcaReqTypeV0::ProofServerPubkey { challenge } => Ok(BcaRespTypeV0::ProofServerPubkey {
challenge,
server_pubkey: bda_executor.self_keypair.public_key(),
sig: bda_executor
.self_keypair
.generate_signator()
.sign(&challenge),
}),
BcaReqTypeV0::Ping => Ok(BcaRespTypeV0::Pong),
BcaReqTypeV0::PeersV10 { n } => peers::exec_req_peers_v1(bda_executor, n).await,
BcaReqTypeV0::SendTxs(txs) => send_txs::send_txs(bda_executor, txs).await,
BcaReqTypeV0::Sync { from, to } => sync::exec_req_sync(bda_executor, from, to).await,
}
}

View file

@ -1,96 +0,0 @@
// Copyright (C) 2020 Éloïs SANCHEZ.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::*;
use duniter_core::bda_types::peer::Peer;
use duniter_gva_db::BLOCKS_CHUNK_SIZE;
pub(super) async fn exec_req_compressed_block_chunk(
bda_executor: &BdaExecutor,
chunk_id: usize,
) -> Result<BcaRespTypeV0, ExecReqTypeError> {
if let Some(ref profile_path) = bda_executor.profile_path_opt {
let chunks_folder_path = profile_path.join("data/gva_v1_blocks_chunks");
if let Some(chunk_data) = duniter_gva_dbs_reader::blocks_chunks::read_compressed_chunk(
chunk_id as u32,
&chunks_folder_path,
false,
)? {
Ok(BcaRespTypeV0::CompressedBlockChunk {
chunk_id,
compressed_data: chunk_data,
})
} else {
Err("not found".into())
}
} else {
Err("Cannot get compressed block chunk in memony mode".into())
}
}
pub(super) async fn exec_req_sync(
bda_executor: &BdaExecutor,
from: u32,
to_opt: Option<u32>,
) -> Result<BcaRespTypeV0, ExecReqTypeError> {
let (target_blockstamp, last_chunk_id_opt) = if let Some(to) = to_opt {
if to < from {
return Err("to < from".into());
}
let dbs_reader = bda_executor.dbs_reader();
if let Some(block_meta) = bda_executor
.dbs_pool
.execute(move |shared_dbs| dbs_reader.block(&shared_dbs.bc_db_ro, U32BE(to)))
.await??
{
(block_meta.blockstamp(), Some(to / BLOCKS_CHUNK_SIZE))
} else {
return Err("Not enough blocks, try another server".into());
}
} else if let Some(current_meta) = bda_executor.cm_accessor.get_current_meta(|cm| *cm).await {
(current_meta.current_block_meta.blockstamp(), None)
} else {
return Err("no blockchain".into());
};
let first_chunk_id = (from + 1) / BLOCKS_CHUNK_SIZE;
let dbs_reader = bda_executor.dbs_reader();
let (peers, blocks_chunks_hashs) = bda_executor
.dbs_pool
.execute(move |shared_dbs| {
Ok::<_, KvError>((
dbs_reader
.get_some_peers(&shared_dbs.dunp_db, 0)?
.into_iter()
.map(|peer_db| Peer {
peer: peer_db.peer,
is_member: peer_db.member,
is_up: peer_db.status,
})
.collect(),
dbs_reader.blocks_chunks_hashs(first_chunk_id, last_chunk_id_opt)?,
))
})
.await??;
Ok(BcaRespTypeV0::Sync {
blocks_chunks_hashs,
peers,
target_blockstamp,
})
}

View file

@ -24,7 +24,9 @@
mod exec_req_type;
pub use duniter_core::dbs::kv_typed::prelude::*;
const MAX_BATCH_SIZE: usize = 10;
const RESP_MIN_SIZE: usize = 64;
type RespBytes = SmallVec<[u8; RESP_MIN_SIZE]>;
use crate::exec_req_type::ExecReqTypeError;
#[cfg(test)]
@ -38,20 +40,17 @@ use duniter_core::bda_types::{
BcaResp, BcaRespTypeV0, BcaRespV0,
};
use duniter_core::crypto::keys::{ed25519::Ed25519KeyPair, Signator};
pub use duniter_core::dbs::kv_typed::prelude::*;
use duniter_core::dbs::{FileBackend, SharedDbs};
#[cfg(not(test))]
use duniter_core::global::AsyncAccessor;
use duniter_gva_dbs_reader::DbsReader;
use futures::{prelude::stream::FuturesUnordered, StreamExt, TryStream, TryStreamExt};
use once_cell::sync::OnceCell;
use smallvec::SmallVec;
use std::path::PathBuf;
use tokio::task::JoinError;
const MAX_BATCH_SIZE: usize = 10;
const RESP_MIN_SIZE: usize = 64;
type RespBytes = SmallVec<[u8; RESP_MIN_SIZE]>;
#[cfg(test)]
use crate::tests::DbsReaderImpl;
#[cfg(not(test))]
@ -59,13 +58,11 @@ use duniter_gva_dbs_reader::DbsReaderImpl;
static BDA_EXECUTOR: OnceCell<BdaExecutor> = OnceCell::new();
#[allow(clippy::too_many_arguments)]
pub fn set_bda_executor(
currency: String,
cm_accessor: AsyncAccessor,
dbs_pool: fast_threadpool::ThreadPoolAsyncHandler<SharedDbs<FileBackend>>,
dbs_reader: DbsReaderImpl,
profile_path_opt: Option<PathBuf>,
self_keypair: Ed25519KeyPair,
software_version: &'static str,
txs_mempool: duniter_core::mempools::TxsMempool,
@ -76,7 +73,6 @@ pub fn set_bda_executor(
cm_accessor,
dbs_pool,
dbs_reader,
profile_path_opt,
self_keypair,
software_version,
txs_mempool,
@ -104,7 +100,6 @@ struct BdaExecutor {
currency: String,
dbs_pool: fast_threadpool::ThreadPoolAsyncHandler<SharedDbs<FileBackend>>,
dbs_reader: DbsReaderImpl,
profile_path_opt: Option<PathBuf>,
self_keypair: Ed25519KeyPair,
software_version: &'static str,
txs_mempool: duniter_core::mempools::TxsMempool,
@ -269,7 +264,6 @@ mod tests {
currency: "g1".to_owned(),
dbs_pool: threadpool.into_async_handler(),
dbs_reader: duniter_core::dbs::kv_typed::prelude::Arc::new(mock_dbs_reader),
profile_path_opt: None,
self_keypair: Ed25519KeyPair::from_seed(
Seed32::random().expect("fail to gen random seed"),
),

View file

@ -49,8 +49,6 @@ pub(crate) use duniter_core::wot::WotId;
pub(crate) use serde::{Deserialize, Serialize};
pub(crate) use std::collections::BTreeSet;
pub const BLOCKS_CHUNK_SIZE: u32 = 4_096;
db_schema!(
GvaV1,
[

View file

@ -19,26 +19,6 @@ use flate2::read::ZlibDecoder;
pub const CHUNK_FILE_PREFIX: &str = "_";
pub const CHUNK_FILE_EXT: &str = ".bin.gz";
impl DbsReaderImpl {
pub(super) fn blocks_chunks_hashs_(
&self,
from: u32,
to_opt: Option<u32>,
) -> KvResult<Vec<Hash>> {
if let Some(to) = to_opt {
self.0
.blocks_chunk_hash()
.iter(U32BE(from)..=U32BE(to), |it| {
it.values().map_ok(|hash_db| hash_db.0).collect()
})
} else {
self.0.blocks_chunk_hash().iter(U32BE(from).., |it| {
it.values().map_ok(|hash_db| hash_db.0).collect()
})
}
}
}
/// Read and decompress chunk file
pub fn read_compressed_chunk(
chunk_index: u32,

View file

@ -86,7 +86,6 @@ pub trait DbsReader {
bc_db: &BcV2DbRo<FileBackend>,
page_info: PageInfo<block::BlockCursor>,
) -> KvResult<PagedData<Vec<(block::BlockCursor, BlockMetaV2)>>>;
fn blocks_chunks_hashs(&self, from: u32, to_opt: Option<u32>) -> KvResult<Vec<Hash>>;
fn endpoints<Db: 'static + NetworkV1DbReadable>(
&self,
network_db: &Db,
@ -230,10 +229,6 @@ impl DbsReader for DbsReaderImpl {
self.blocks_(bc_db, page_info)
}
fn blocks_chunks_hashs(&self, from: u32, to_opt: Option<u32>) -> KvResult<Vec<Hash>> {
self.blocks_chunks_hashs_(from, to_opt)
}
fn endpoints<Db: 'static + NetworkV1DbReadable>(
&self,
network_db: &Db,

View file

@ -8,7 +8,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0.33"
arrayvec = { version = "0.7", features = ["serde"] }
async-graphql = { version = "4.0", features = ["log"] }
async-graphql = { version = "2.8", features = ["log"] }
async-trait = "0.1.41"
duniter-core = { git = "https://git.duniter.org/nodes/rust/duniter-core" }
duniter-gva-db = { path = "../db" }

View file

@ -33,31 +33,6 @@ pub(crate) struct AmountWithBase {
pub(crate) amount: i32,
pub(crate) base: i32,
}
impl AmountWithBase {
fn increment_base(self) -> Self {
Self {
amount: self.amount / 10,
base: self.base + 1,
}
}
}
impl std::ops::Add for AmountWithBase {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
#[allow(clippy::comparison_chain)]
if self.base == rhs.base {
Self {
amount: self.amount + rhs.amount,
base: self.base,
}
} else if self.base > rhs.base {
self.add(rhs.increment_base())
} else {
self.increment_base().add(rhs)
}
}
}
impl From<SourceAmount> for AmountWithBase {
fn from(sa: SourceAmount) -> Self {
Self {
@ -66,11 +41,6 @@ impl From<SourceAmount> for AmountWithBase {
}
}
}
impl std::iter::Sum for AmountWithBase {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.fold(AmountWithBase::default(), std::ops::Add::add)
}
}
#[derive(async_graphql::SimpleObject)]
pub(crate) struct EdgeTx {

View file

@ -32,7 +32,7 @@ impl WalletsQuery {
#[graphql(desc = "minimal balance")] min_balance: Option<i64>,
#[graphql(desc = "pagination", default)] pagination: Pagination,
#[graphql(desc = "Wallet type filter", default)] wallet_type_filter: WalletTypeFilter,
) -> async_graphql::Result<Connection<String, Wallet, AggregateSum, EmptyFields>> {
) -> async_graphql::Result<Connection<String, Wallet, EmptyFields, EmptyFields>> {
let QueryContext { is_whitelisted } = ctx.data::<QueryContext>()?;
let data = ctx.data::<GvaSchemaData>()?;
@ -160,19 +160,7 @@ impl WalletsQuery {
}
};
let sum = if ctx.look_ahead().field("aggregate").field("sum").exists() {
data.iter().map(|wallet| wallet.balance).sum()
} else {
AmountWithBase::default()
};
let mut conn = Connection::with_additional_fields(
has_previous_page,
has_next_page,
AggregateSum {
aggregate: Sum { sum },
},
);
let mut conn = Connection::new(has_previous_page, has_next_page);
conn.append(
data.into_iter()

View file

@ -18,6 +18,8 @@ use duniter_gva_dbs_reader::blocks_chunks::{CHUNK_FILE_EXT, CHUNK_FILE_PREFIX};
use flate2::write::ZlibEncoder;
use flate2::Compression;
const CHUNK_SIZE: u32 = 4_096;
pub fn apply_block_blocks_chunk<B: Backend>(
block: &DubpBlockV10,
gva_db: &GvaV1Db<B>,
@ -31,7 +33,7 @@ pub fn apply_block_blocks_chunk<B: Backend>(
GvaBlockDbV1(DubpBlock::V10(block.clone())),
)?;
if (block_number + 1) % BLOCKS_CHUNK_SIZE == 0 {
if (block_number + 1) % CHUNK_SIZE == 0 {
let current_chunk: Vec<GvaBlockDbV1> = gva_db
.current_blocks_chunk()
.iter(.., |it| it.values().collect::<Result<Vec<_>, _>>())?;
@ -39,7 +41,7 @@ pub fn apply_block_blocks_chunk<B: Backend>(
.serialize(&current_chunk)
.map_err(|e| KvError::DeserError(e.into()))?;
let chunk_hash = Hash::compute_blake3(current_chunk_bin.as_ref());
let chunk_index = U32BE(block_number / BLOCKS_CHUNK_SIZE);
let chunk_index = U32BE(block_number / CHUNK_SIZE);
gva_db
.blocks_chunk_hash_write()
.upsert(chunk_index, HashDb(chunk_hash))?;
@ -64,9 +66,9 @@ pub fn revert_block_blocks_chunk<B: Backend>(
let block_number = block.number().0;
let chunks_folder_path = profile_path.join("data/gva_v1_blocks_chunks");
gva_db.write(|mut db| {
if (block_number + 1) % BLOCKS_CHUNK_SIZE == 0 {
if (block_number + 1) % CHUNK_SIZE == 0 {
// Uncompress last compressed chunk and replace it in current chunk
let chunk_index = U32BE(block_number / BLOCKS_CHUNK_SIZE);
let chunk_index = U32BE(block_number / CHUNK_SIZE);
if let Some(current_chunk_bin) =
duniter_gva_dbs_reader::blocks_chunks::read_compressed_chunk(
chunk_index.0,
@ -79,7 +81,7 @@ pub fn revert_block_blocks_chunk<B: Backend>(
let current_chunk: Vec<GvaBlockDbV1> = bincode_db()
.deserialize(current_chunk_bin.as_ref())
.map_err(|e| KvError::DeserError(e.into()))?;
let current_chunk_begin = block_number - BLOCKS_CHUNK_SIZE + 1;
let current_chunk_begin = block_number - CHUNK_SIZE + 1;
for (i, block) in current_chunk.into_iter().enumerate() {
db.current_blocks_chunk
.upsert(U32BE(current_chunk_begin + i as u32), block);

View file

@ -46,10 +46,7 @@ use duniter_gva_db::*;
use duniter_gva_gql::{GvaSchema, QueryContext};
use duniter_gva_indexer::{get_gva_db_ro, get_gva_db_rw};
use futures::{StreamExt, TryStreamExt};
use std::{
convert::Infallible,
path::{Path, PathBuf},
};
use std::{convert::Infallible, path::Path};
#[cfg(test)]
use tests::get_public_ips;
use warp::{http::Response as HttpResponse, Filter as _, Rejection};
@ -65,7 +62,6 @@ pub struct GvaModule {
gva_db_ro: &'static GvaV1DbRo<FileBackend>,
mempools: Mempools,
mode: DuniterMode,
profile_path_opt: Option<PathBuf>,
self_keypair: Ed25519KeyPair,
software_version: &'static str,
}
@ -129,7 +125,6 @@ impl duniter_core::module::DuniterModule for GvaModule {
gva_db_ro: get_gva_db_ro(profile_path_opt),
mempools,
mode,
profile_path_opt: profile_path_opt.map(ToOwned::to_owned),
self_keypair,
software_version,
},
@ -147,7 +142,6 @@ impl duniter_core::module::DuniterModule for GvaModule {
gva_db_ro,
mempools,
mode,
profile_path_opt,
self_keypair,
software_version,
} = self;
@ -160,7 +154,6 @@ impl duniter_core::module::DuniterModule for GvaModule {
dbs_pool,
gva_db_ro,
mempools,
profile_path_opt,
self_keypair,
software_version,
)
@ -242,14 +235,12 @@ impl duniter_core::module::DuniterModule for GvaModule {
}
impl GvaModule {
#[allow(clippy::too_many_arguments)]
async fn start_inner(
conf: GvaConf,
currency: String,
dbs_pool: fast_threadpool::ThreadPoolAsyncHandler<SharedDbs<FileBackend>>,
gva_db_ro: &'static GvaV1DbRo<FileBackend>,
mempools: Mempools,
profile_path_opt: Option<PathBuf>,
self_keypair: Ed25519KeyPair,
software_version: &'static str,
) {
@ -262,7 +253,6 @@ impl GvaModule {
AsyncAccessor::new(),
dbs_pool.clone(),
duniter_gva_dbs_reader::create_dbs_reader(gva_db_ro),
profile_path_opt,
self_keypair,
software_version,
mempools.txs,