Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
BTCxZelko
whirlpool_stats
Commits
11e7171b
Commit
11e7171b
authored
Nov 15, 2019
by
LaurentMT
Browse files
Updated txid prefix length to target value
parent
4653a8f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
whirlpool_stats/services/snapshot.py
whirlpool_stats/services/snapshot.py
+2
-2
whirlpool_stats/utils/constants.py
whirlpool_stats/utils/constants.py
+6
-2
whirlpool_stats/wst.py
whirlpool_stats/wst.py
+7
-3
No files found.
whirlpool_stats/services/snapshot.py
View file @
11e7171b
...
...
@@ -81,7 +81,7 @@ class Snapshot(object):
tiid
=
int
(
row
[
0
])
self
.
l_mix_txs
.
append
(
tiid
)
self
.
s_mix_txs
.
add
(
tiid
)
txid_prefix
=
row
[
1
][
0
:
9
]
txid_prefix
=
row
[
1
][
0
:
2
*
TXID_PREFIX_LENGTH
+
1
]
self
.
d_txids
[
txid_prefix
]
=
mix_round
ts
=
int
(
row
[
2
])
self
.
l_ts_mix_txs
.
append
(
ts
)
...
...
@@ -100,7 +100,7 @@ class Snapshot(object):
tiid
=
int
(
row
[
0
])
self
.
l_tx0s
.
append
(
tiid
)
self
.
s_tx0s
.
add
(
tiid
)
txid_prefix
=
row
[
1
][
0
:
9
]
txid_prefix
=
row
[
1
][
0
:
2
*
TXID_PREFIX_LENGTH
+
1
]
self
.
d_tx0s
[
txid_prefix
]
=
tiid
ts
=
int
(
row
[
2
])
self
.
l_ts_tx0s
.
append
(
ts
)
...
...
whirlpool_stats/utils/constants.py
View file @
11e7171b
...
...
@@ -5,7 +5,8 @@ Set of constants used by the scripts
'''
# OXT base url for whirpool snapshots
BASE_URL_SNAPSHOTS
=
'https://oxt.me/static/share/whirlpool'
#TODO Replace with correct URL
BASE_URL_SNAPSHOTS
=
'https://oxt.me/static/share/whirlpooltest'
# Filename templates composing the snapshot for a given denomination
FN_MIX_TXS
=
'whirlpool_mix_txs'
...
...
@@ -30,4 +31,7 @@ ALL_DENOMS = [
]
# Number of participants per mix
NB_PARTICIPANTS
=
5
\ No newline at end of file
NB_PARTICIPANTS
=
5
# TXID prefix length (in bytes)
TXID_PREFIX_LENGTH
=
8
whirlpool_stats/wst.py
View file @
11e7171b
...
...
@@ -7,12 +7,11 @@ import os
import
sys
import
getopt
from
cmd
import
Cmd
from
collections
import
defaultdict
# Adds whirlpool_stats directory into path
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
+
"/../"
)
from
whirlpool_stats.utils.constants
import
ALL_DENOMS
from
whirlpool_stats.utils.constants
import
ALL_DENOMS
,
TXID_PREFIX_LENGTH
from
whirlpool_stats.utils.charts
import
*
from
whirlpool_stats.services.downloader
import
Downloader
from
whirlpool_stats.services.snapshot
import
Snapshot
...
...
@@ -144,7 +143,7 @@ Examples:
print
(
' '
)
return
txid_prefix
=
args
[
0
:
9
]
txid_prefix
=
args
[
0
:
2
*
TXID_PREFIX_LENGTH
+
1
]
if
txid_prefix
in
self
.
snapshot
.
d_txids
.
keys
():
mix_round
=
self
.
snapshot
.
d_txids
[
txid_prefix
]
...
...
@@ -215,6 +214,7 @@ Examples:
lbl_y
=
'anonset'
chart_title
=
'Whirlpool %s %s (pools %s)'
%
\
(
lbl_direction
,
lbl_y
,
o_metrics
.
snapshot
.
denom
)
elif
metrics
==
'spread'
:
chart_type
=
CT_SCATTERPLOT
y_values
=
o_metrics
.
l_spreads
...
...
@@ -223,6 +223,7 @@ Examples:
lbl_y
=
'spread'
chart_title
=
'Whirlpool %s %s (pools %s)'
%
\
(
lbl_direction
,
lbl_y
,
o_metrics
.
snapshot
.
denom
)
else
:
print
(
'Invalid metrics (values: anonset, spread).'
)
...
...
@@ -239,6 +240,7 @@ Examples:
lbl_y
=
'heterogeneity ratio (#counterparties / #mixed outputs)'
chart_title
=
'Whirlpool %s (pools %s)'
%
\
(
lbl_direction
,
o_metrics
.
snapshot
.
denom
)
elif
metrics
==
'hrout'
:
chart_type
=
CT_SCATTERPLOT
l_metrics
=
list
(
o_metrics
.
d_metrics
.
values
())
...
...
@@ -248,6 +250,7 @@ Examples:
lbl_y
=
'heterogeneity ratio'
chart_title
=
'Whirlpool %s vs %s (pools %s)'
%
\
(
lbl_y
,
lbl_x
,
o_metrics
.
snapshot
.
denom
)
elif
metrics
==
'hrdist'
:
chart_type
=
CT_BARCHART
l_metrics
=
list
(
o_metrics
.
d_metrics
.
values
())
...
...
@@ -256,6 +259,7 @@ Examples:
lbl_y
=
'percentage of all Tx0s'
chart_title
=
'Whirlpool distribution of Tx0s per %s (pools %s)'
%
\
(
lbl_x
,
o_metrics
.
snapshot
.
denom
)
else
:
print
(
'Invalid metrics (values: hr, hrout, hrdist).'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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