Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • dev
  • appimage
  • fix_gitlab
  • fixappveyor
  • gitlab
  • fix_ci
  • fix_dbus_error
  • fix_ci_osx
  • sakia020
  • fix_travis#1105
  • feature/backend
  • check_uniq_node_by_endpoints
  • qt5.7
  • feature/agent_architecture
  • translations
  • pyqt5.6
  • qtwebengine
  • pyinstaller
  • landscape
  • 0.53.2
  • 0.53.1
  • 0.53.0
  • 0.52.0
  • 0.51.1
  • 0.51.0
  • 0.50.5
  • 0.50.4
  • 0.50.3
  • 0.50.2
  • 0.50.1
  • 0.50.0
  • 0.33.0rc7
  • 0.33.0rc6
  • 0.33.0rc5
  • 0.33.0rc4
  • 0.33.0rc3
  • 0.33.0rc2
  • 0.33.0rc1
  • 0.32.10post1
40 results

sakia

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Caner Candan authored
    7776e75b
    History

    #ucoin-python-api

    A python implementation of uCoin API

    Requirements

    In order to use the API, you have to first install the required dependencies given below thanks to pip3:

    • requests
    • python-gnupg

    ##Installation

    Here is a fast installation procedure (a bit dirty) we suggest to quickly use this API.

    $ mkdir $HOME/ucoin
    $ cd $HOME/ucoin
    $ git clone git@github.com:canercandan/ucoin-python-api.git ucoinpy
    $ export PYTHONPATH="$HOME/ucoin:$PYTHONPATH"

    Thus you are ready to use it with your own python program. Here is an example illustrating how to use it thanks to the python shell:

    In [1]: import ucoinpy
    
    In [2]: ucoinpy.ucg.Peering(server='mycurrency.candan.fr').get()
    Out[2]:
    {'contract': {'currentNumber': '5',
      'hash': 'FB710AE30F843BF505ABF9DE8CF404B7F35D238A'},
     'currency': 'mycurrency',
     'key': '6282C3F765E560992113137AD149AFF1B07FF751',
     'merkles': {'hdc/amendments/current/votes': {'depth': 1,
       'leavesCount': 2,
       'nodesCount': 1,
       'root': '2CEC90DEBBB89C10B6AB5EAEF17FF1D0BA8B4346'},
      'pks/all': {'depth': 2,
       'leavesCount': 4,
       'nodesCount': 3,
       'root': '944D0A3A0593C4B627BA41F0454BB4A705918CE9'}},
     'remote': {'host': 'mycurrency.candan.fr',
      'ipv4': '62.210.131.202',
      'ipv6': '',
      'port': 8081}}

    Please take a look at the document HTTP API to learn about the API.