Skip to content
Snippets Groups Projects
Commit d3cc2a13 authored by Caner Candan's avatar Caner Candan
Browse files

* renamed api to ucoin

parent 51990ebb
No related branches found
No related tags found
No related merge requests found
......@@ -19,20 +19,20 @@
from parser import Parser
from pprint import pprint
import api
import ucoin
URL = 'http://mycurrency.candan.fr:8081'
AUTH = False
def action_peering():
pprint(api.ucg.Peering().get())
pprint(ucoin.ucg.Peering().get())
def action_amendments():
for am in api.hdc.amendments.List().get():
for am in ucoin.hdc.amendments.List().get():
print(am['number'])
def action_transactions():
for tx in api.hdc.transactions.All().get():
for tx in ucoin.hdc.transactions.All().get():
print(tx['hash'])
if __name__ == '__main__':
......
File moved
File moved
File moved
File moved
File moved
......@@ -34,4 +34,28 @@ class Peering(UCG):
def get(self):
return self.requests_get('/peering').json()
class THT(UCG):
"""GET/POST THT entries."""
def __init__(self, pgp_fingerprint=None):
"""
Use the pgp fingerprint parameter in order to fit the result.
Arguments:
- `pgp_fingerprint`: pgp fingerprint to use as a filter
"""
super().__init__()
self.pgp_fingerprint = pgp_fingerprint
def get(self):
if not self.pgp_fingerprint:
return self.merkle_easy_parser('/tht').json()
return self.merkle_easy_parser('/tht/%s' % self.pgp_fingerprint).json()
def post(self):
pass
from . import peering
......@@ -49,4 +49,16 @@ class Peers(Base):
def post(self):
pass
class Forward(Base):
"""POST a UCG forward document to this node in order to be sent back incoming transactions."""
def post(self):
pass
class Status(Base):
"""POST a UCG status document to this node in order notify of its status."""
def post(self):
pass
from . import peers
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment