Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scheduling Scripts
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xx network
Scheduling Scripts
Merge requests
!6
Fix error handling on push_point_info
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Fix error handling on push_point_info
hotfix/errors
into
master
Overview
0
Commits
2
Pipelines
0
Changes
1
Closed
Jonah Husson
requested to merge
hotfix/errors
into
master
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
version 1
version 1
02a47cdb
3 years ago
master (base)
and
latest version
latest version
662c3807
2 commits,
3 years ago
version 1
02a47cdb
1 commit,
3 years ago
Show latest version
1 file
+
4
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
points.py
+
4
−
2
Options
@@ -11,6 +11,7 @@ import json
import
logging
as
log
import
psycopg2
import
sys
import
os
from
substrateinterface
import
SubstrateInterface
,
Keypair
import
time
@@ -21,6 +22,7 @@ import time
substrate_conn_freq
=
10
# Frequency of attempting reconnects in seconds
xxdot_url
=
""
ns_in_s
=
float
(
1e+9
)
# Conversion from nanosecond to second
ms_in_ns
=
1e+6
THOUSAND
=
1_000
state_key
=
"
consensus_points_timestamp
"
# Static key used for states table
positive_points_func
=
'
submit_cmix_points
'
@@ -39,7 +41,7 @@ def main():
args
=
get_args
()
log
.
info
(
"
Running with configuration: {}
"
.
format
(
args
))
xxdot_url
=
args
[
'
xxdot_url
'
]
wallet_path
=
args
[
'
wallet_path
'
]
wallet_path
=
os
.
path
.
expanduser
(
args
[
'
wallet_path
'
]
)
db_host
=
args
[
'
host
'
]
db_port
=
args
[
'
port
'
]
db_name
=
args
[
'
db
'
]
@@ -76,7 +78,7 @@ def main():
try
:
# Get up-to-date period information from blockchain
point_info
=
poll_point_info
(
substrate
)
period
=
point_info
[
'
period
'
]
*
1e+6
period
=
int
(
point_info
[
'
period
'
]
*
ms_in_ns
)
# Wait until the next period arrives
next_period
=
last_checked_ts
+
period
Loading