Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
py-g1-migrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
py-g1-migrator
Commits
c854646e
Commit
c854646e
authored
2 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove old certs
parent
fc9a8080
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
currency_parameters.py
+25
-19
25 additions, 19 deletions
currency_parameters.py
generate_dex_data.sh
+1
-1
1 addition, 1 deletion
generate_dex_data.sh
lib/functions.py
+2
-1
2 additions, 1 deletion
lib/functions.py
lib/utility.py
+4
-16
4 additions, 16 deletions
lib/utility.py
with
32 additions
and
37 deletions
currency_parameters.py
+
25
−
19
View file @
c854646e
# Utility
def
b_minutes
(
minutes
):
return
int
(
minutes
*
60
/
6
)
def
b_hours
(
hours
):
return
int
(
b_minutes
(
hours
)
*
60
)
def
b_days
(
days
):
return
int
(
b_hours
(
days
)
*
24
)
def
b_months
(
months
):
return
int
(
b_days
(
months
)
*
30
)
# Global parameters
FIRST_UD_REEVAL
=
2629800
FIRST_UD_REEVAL
=
b_months
(
6
)
# 6 months
# Genesis parameters
GENESIS_CERTS_EXPIRE_ON
=
15
GENESIS_CERTS_MIN_RECEIVED
=
0
GENESIS_MEMBERSHIPS_EXPIRE_ON
=
1051200
GENESIS_SMITH_CERTS_EXPIRE_ON
=
2102400
GENESIS_MEMBERSHIPS_EXPIRE_ON
=
b_months
(
12
)
GENESIS_SMITH_CERTS_EXPIRE_ON
=
b_months
(
24
)
GENESIS_SMITH_CERTS_MIN_RECEIVED
=
1
GENESIS_SMITH_MEMBERSHIPS_EXPIRE_ON
=
1051200
GENESIS_SMITH_MEMBERSHIPS_EXPIRE_ON
=
b_months
(
12
)
# Parameters
BABE_EPOCH_DURATION
=
600
CERT_PERIOD
=
14400
CERT_PERIOD
=
b_days
(
1
)
# 1 day
CERT_MAX_BY_ISSUER
=
100
CERT_MIN_RECEIVED_CERT_TO_ISSUE_CERT
=
5
CERT_VALIDITY_PERIOD
=
10512000
IDTY_CONFIRM_PERIOD
=
100800
IDTY_CREATION_PERIOD
=
100800
MEMBERSHIP_PERIOD
=
5256000
PENDING_MEMBERSHIP_PERIOD
=
172800
UD_CREATION_PERIOD
=
14400
UD_REEVAL_PERIOD
=
2629800
SMITH_CERT_PERIOD
=
14400
CERT_VALIDITY_PERIOD
=
b_months
(
24
)
IDTY_CONFIRM_PERIOD
=
b_days
(
7
)
IDTY_CREATION_PERIOD
=
b_days
(
7
)
MEMBERSHIP_PERIOD
=
b_months
(
12
)
PENDING_MEMBERSHIP_PERIOD
=
b_months
(
1
)
UD_CREATION_PERIOD
=
b_days
(
1
)
UD_REEVAL_PERIOD
=
b_months
(
6
)
SMITH_CERT_PERIOD
=
b_days
(
1
)
SMITH_CERT_MAX_BY_ISSUER
=
15
SMITH_CERT_MIN_RECEIVED_CERT_TO_ISSUE_CERT
=
3
SMITH_CERT_VALIDITY_PERIOD
=
10512000
SMITH_MEMBERSHIP_PERIOD
=
5256000
SMITH_PENDING_MEMBERSHIP_PERIOD
=
172800
SMITHS_WOT_FIRST_CERT_ISSUABLE_ON
=
14400
SMITH_CERT_VALIDITY_PERIOD
=
b_months
(
24
)
SMITH_MEMBERSHIP_PERIOD
=
b_months
(
12
)
SMITH_PENDING_MEMBERSHIP_PERIOD
=
b_months
(
1
)
SMITHS_WOT_FIRST_CERT_ISSUABLE_ON
=
b_days
(
1
)
SMITHS_WOT_MIN_CERT_FOR_MEMBERSHIP
=
3
WOT_FIRST_CERT_ISSUABLE_ON
=
15
WOT_FIRST_CERT_ISSUABLE_ON
=
b_minutes
(
5
)
# 5 minutes
WOT_MIN_CERT_FOR_CREATE_IDTY_RIGHT
=
5
WOT_MIN_CERT_FOR_MEMBERSHIP
=
5
This diff is collapsed.
Click to expand it.
generate_dex_data.sh
+
1
−
1
View file @
c854646e
#!/bin/bash
echo
"Export wallets data in progress..."
yes
|./dex find wallet
-p
balance
-o
json
-f
input/wallets.json
>
/dev/null
&&
echo
"Done"
yes
|./dex find wallet
-p
balance
-o
json
-f
input/wallets.json
>
/dev/null
&&
echo
"Done"
||
exit
1
echo
"Export certs data in progress..."
yes
|./dex find cindex
-p
issued
-o
json
-f
input/certs.json
>
/dev/null
&&
echo
"Done"
...
...
This diff is collapsed.
Click to expand it.
lib/functions.py
+
2
−
1
View file @
c854646e
...
...
@@ -77,6 +77,7 @@ def get_identities_and_wallets(start_timestamp):
if
start_timestamp
==
''
:
start_timestamp
=
int
(
time
())
cert_expire_on_bloc
=
dateToBlocNumber
(
blocs
[
str
(
cert
[
'
writtenOn
'
])],
start_timestamp
)
if
cert_expire_on_bloc
<=
0
:
continue
if
r_username
not
in
identities
:
identities
.
update
({
r_username
:
{}})
if
'
certs
'
not
in
identities
[
r_username
]:
identities
[
r_username
].
update
({
'
certs
'
:
[]})
...
...
This diff is collapsed.
Click to expand it.
lib/utility.py
+
4
−
16
View file @
c854646e
import
json
,
math
import
base58
from
currency_parameters
import
CERT_VALIDITY_PERIOD
from
currency_parameters
import
*
from
substrateinterface
import
Keypair
,
KeypairType
...
...
@@ -20,22 +20,10 @@ def v1_pubkey_to_v2_address(pubkey):
def
dateToBlocNumber
(
timestamp
,
start_timestamp
):
cert_duration
=
int
(
start_timestamp
)
-
timestamp
cert_duration_bloc_number
=
math
.
trunc
(
cert_duration
/
60
0
)
cert_expire_on_bloc
=
CERT_VALIDITY_PERIOD
-
cert_duration_bloc_number
return
cert_expire_on_bloc
cert_duration_bloc_number
=
b_minutes
(
cert_duration
/
60
)
# print(
cert_duration_bloc_number
)
return
CERT_VALIDITY_PERIOD
-
cert_duration_bloc_number
def
load_json
(
data
):
get_data
=
open
(
data
)
return
json
.
load
(
get_data
)
# def progressbar(it, prefix="", size=60, out=sys.stdout):
# count = len(it)
# def show(j):
# x = int(size*j/count)
# print("{}[{}{}] {}/{}".format(prefix, "#"*x, "."*(size-x), j, count),
# end='\r', file=out, flush=True)
# show(0)
# for i, item in enumerate(it):
# yield item
# show(i+1)
# print("\n", flush=True, file=out)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment