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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Commits
7d822aee
Commit
7d822aee
authored
6 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Add blockchain/with/revoked and blockchain/branches in bma api
parent
4d8a26d8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
duniterpy/api/bma/blockchain.py
+28
-0
28 additions, 0 deletions
duniterpy/api/bma/blockchain.py
with
28 additions
and
0 deletions
duniterpy/api/bma/blockchain.py
+
28
−
0
View file @
7d822aee
...
...
@@ -342,6 +342,14 @@ DIFFICULTIES_SCHEMA = {
]
}
BRANCHES_SCHEMA
=
{
"
type
"
:
"
object
"
,
"
properties
"
:
{
"
blocks
"
:
BLOCKS_SCHEMA
}
}
async
def
parameters
(
client
:
Client
)
->
dict
:
"""
GET the blockchain parameters used by this node
...
...
@@ -439,6 +447,16 @@ async def difficulties(client: Client) -> dict:
return
await
client
.
get
(
MODULE
+
'
/difficulties
'
,
schema
=
DIFFICULTIES_SCHEMA
)
async
def
branches
(
client
:
Client
)
->
list
:
"""
GET current branches of the node (top block of each branch)
:param client: Client to connect to the api
:return:
"""
return
await
client
.
get
(
MODULE
+
'
/branches
'
,
schema
=
BRANCHES_SCHEMA
)
async
def
newcomers
(
client
:
Client
)
->
dict
:
"""
GET the block numbers containing newcomers
...
...
@@ -489,6 +507,16 @@ async def leavers(client: Client) -> dict:
return
await
client
.
get
(
MODULE
+
'
/with/leavers
'
,
schema
=
BLOCK_NUMBERS_SCHEMA
)
async
def
revoked
(
client
:
Client
)
->
dict
:
"""
GET the block numbers containing revoked members.
:param client: Client to connect to the api
:return:
"""
return
await
client
.
get
(
MODULE
+
'
/with/excluded
'
,
schema
=
BLOCK_NUMBERS_SCHEMA
)
async
def
excluded
(
client
:
Client
)
->
dict
:
"""
GET the block numbers containing excluded
...
...
This diff is collapsed.
Click to expand it.
Moul
@moul
mentioned in issue
#114 (closed)
·
5 years ago
mentioned in issue
#114 (closed)
mentioned in issue #114
Toggle commit list
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