Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
0a5d1ee0
Commit
0a5d1ee0
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Add network discovery
parent
46c42fef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/uml/network.png
+0
-0
0 additions, 0 deletions
doc/uml/network.png
doc/uml/network.pu
+36
-0
36 additions, 0 deletions
doc/uml/network.pu
src/cutecoin/core/net/api/bma/__init__.py
+4
-2
4 additions, 2 deletions
src/cutecoin/core/net/api/bma/__init__.py
with
40 additions
and
2 deletions
doc/uml/network.png
0 → 100644
+
0
−
0
View file @
0a5d1ee0
45.7 KiB
This diff is collapsed.
Click to expand it.
doc/uml/network.pu
0 → 100644
+
36
−
0
View file @
0a5d1ee0
@startuml
Network -->o Node : Connect to node_received()
Network -> Node : Starts network discovery
activate Node
Node -> QNetworkManager : HTTP GET peering/peers?leaves=true
create QNetworkReply
QNetworkManager -> QNetworkReply : Instantiate
Node <- QNetworkManager : QNetworkReply
Node -->o QNetworkReply : Connect to finished()
Network <- Node
deactivate Node
... Request is processed ...
Node <-- QNetworkReply : finished()
destroy QNetworkReply
alt "root" hash changed
loop "for all leaves changed"
activate Node
Node -> QNetworkManager : HTTP GET peering/peers/leaf=leaf_hash
create QNetworkReply
QNetworkManager -> QNetworkReply : Instantiate
Node <- QNetworkManager : QNetworkReply
Node -->o QNetworkReply : Connect to finished()
end
end
... Requests is processed ...
Node <-- QNetworkReply : finished()
destroy QNetworkReply
Network <-- Node : node_received()
ref over Network
New node is instanciated
if pubkey not known yet.
It starts it's own
network discovery
end ref
@enduml
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/cutecoin/core/net/api/bma/__init__.py
+
4
−
2
View file @
0a5d1ee0
...
...
@@ -88,8 +88,10 @@ class API(object):
Arguments:
- `path`: the request path
"""
request
=
QNetworkRequest
(
self
.
reverse_url
(
path
))
url
=
QUrlQuery
(
self
.
reverse_url
(
path
))
for
k
,
v
in
kwargs
.
items
():
url
.
addQueryItem
(
k
,
v
);
request
=
QNetworkRequest
(
url
)
reply
=
request
.
get
(
self
.
reverse_url
(
path
),
params
=
kwargs
,
headers
=
self
.
headers
,
timeout
=
15
)
...
...
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