Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
clients
python
DuniterPy
Commits
32488928
Commit
32488928
authored
5 years ago
by
Vincent Texier
Committed by
Vincent Texier
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#58
enhance request_ws2p example comment
parent
5f1796dc
No related branches found
No related tags found
2 merge requests
!94
Merge dev into master for release 0.56.0
,
!84
#58: WS2P support
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/request_ws2p.py
+10
-5
10 additions, 5 deletions
examples/request_ws2p.py
with
10 additions
and
5 deletions
examples/request_ws2p.py
+
10
−
5
View file @
32488928
...
...
@@ -19,8 +19,10 @@ from duniterpy.api.client import Client
# You can either use a complete defined endpoint : [NAME_OF_THE_API] [DOMAIN] [IPv4] [IPv6] [PORT]
# or the simple definition : [NAME_OF_THE_API] [DOMAIN] [PORT]
# Here we use the WS2P API (WS2P)
WS2P_ENDPOINT
=
"
WS2P 2f731dcd 127.0.0.1 20900
"
# Here we use the WS2P API (WS2P [UUID] [DOMAIN] [PORT])
# You can find the UUID of a node with the /network/ws2p/heads BMA API request
# or in your node user interface in the network view in the WS2PID column
WS2P_ENDPOINT
=
"
WS2P 96675302 g1-test.duniter.org 443
"
CURRENCY
=
"
g1-test
"
...
...
@@ -31,13 +33,16 @@ async def main():
"""
Main code
"""
# You can connect with member credentials in case there is not much slots available on the endpoint
#
# # Prompt hidden user entry
# salt = getpass.getpass("Enter your passphrase (salt): ")
#
# # Prompt hidden user entry
# password = getpass.getpass("Enter your password: ")
salt
=
password
=
"
toto
"
# dummy credentials
salt
=
password
=
"
test
"
# Init signing_key instance
signing_key
=
SigningKey
.
from_credentials
(
salt
,
password
)
...
...
@@ -49,7 +54,7 @@ async def main():
# Create a Web Socket connection
ws
=
await
client
.
connect_ws
()
print
(
"
Connected s
uccessfully
to
web socket endpoint
"
)
print
(
"
S
uccessfully
connected to the
web socket endpoint
"
)
# HANDSHAKE #######################################################
try
:
...
...
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