Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tools
gexplore
Commits
bf481be0
Commit
bf481be0
authored
Apr 05, 2022
by
Hugo Trentesaux
Browse files
Consts
parent
0d281886
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bc_dup.rs
View file @
bf481be0
use
crate
::{
blockchain
,
state
};
use
crate
::{
blockchain
,
consts
,
state
};
use
dup_crypto
::
keys
::{
ed25519
::
PublicKey
as
Pubkey
,
PublicKey
};
use
indicatif
::
ProgressBar
;
...
...
@@ -64,18 +64,14 @@ impl blockchain::BcReader<Config> for BcDup {
impl
BcDup
{
pub
fn
new
()
->
Self
{
let
bar
=
ProgressBar
::
new
(
std
::
fs
::
read_dir
(
"/home/tuxmain/.config/duniter/duniter_default/g1"
)
.unwrap
()
.count
()
as
u64
,
);
let
bar
=
ProgressBar
::
new
(
std
::
fs
::
read_dir
(
consts
::
G1_PATH
)
.unwrap
()
.count
()
as
u64
);
let
mut
blocks
=
Vec
::
new
();
for
i
in
0usize
..
{
m
at
c
h
std
::
fs
::
File
::
open
(
format!
(
"/home/tuxmain/.config/duniter/duniter_default/g1
/chunk_{}-250.json"
,
i
)
)
{
let
mut
p
ath
=
String
::
from
(
consts
::
G1_PATH
);
path
.push_str
(
&
format!
(
"
/chunk_{}-250.json"
,
i
));
match
std
::
fs
::
File
::
open
(
path
)
{
Ok
(
chunk
)
=>
{
if
let
Ok
(
chunk
)
=
simd_json
::
from_reader
::
<
_
,
serde_json
::
Value
>
(
chunk
)
{
for
block
in
chunk
[
"blocks"
]
.as_array
()
.unwrap
()
{
...
...
src/consts.rs
0 → 100644
View file @
bf481be0
pub
const
G1_PATH
:
&
str
=
"/home/tuxmain/.config/duniter/duniter_default/g1"
;
// pub const G1_PATH: &str = "/home/hugo/Téléchargements/TMP_g1/chunks";
src/main.rs
View file @
bf481be0
mod
bc_dup
;
mod
bc_mock
;
mod
blockchain
;
mod
consts
;
mod
state
;
use
crate
::
blockchain
::
BcReader
;
...
...
@@ -146,7 +147,7 @@ impl<C: 'static + Debug + blockchain::Config, R: 'static + BcReader<C>> Gexplore
.add_plugin
(
PolylinePlugin
)
.add_plugin
(
EguiPlugin
)
.add_plugin
(
bevy_atmosphere
::
AtmospherePlugin
{
dynamic
:
false
,
// Set to false since we aren't changing the sky's appearance
dynamic
:
false
,
// Set to false since we aren't changing the sky's appearance
sky_radius
:
10000.0
,
})
.add_system
(
Self
::
keyboard_event_system
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment