Skip to content

sgkim126/codechain-sdk-python

 
 

Repository files navigation

CodeChain SDK for Python

A Python SDK for CodeChain.

API Documentation (For SDK users)

Not prepared

Getting Started (For SDK developers)

Submitting patches

  • Use Black_ to autoformat your code. This should be done for you as a git pre-commit_ hook.

First time setup

  • Clone your GitHub fork locally:
  • Add the main repository as a remote to update later:
  • Create a virtualenv using pipenv:
$ make init
  • Install the pre-commit hooks:
$ pre-commit install --install-hooks

Add dependency

  • Install the dependency using pipenv
  1. In the test environment
$ pipenv install [package] --dev
  1. In the production
$ pip3 install [package]

and specify it to the setup.py

  • lock the dependency
$ pipenv lock

Run test cases

$ make test

Submodules

codechain-crypto

Python implementation of crypto functions and classes used in CodeChain.

Functions

  • sign_schnorr

  • verify_schnorr

  • recover_schnorr

  • sign_ecdsa

  • verify_ecdsa

  • recover_ecdsa

  • blake256, blake256_with_key, blake160, blake160_with_key, blake128, blake128_with_key

  • ripemd160

  • get_public_from_private

  • generate_private_key

codechain-rpc

codechain-rpc is a Python module that calls RPC to a CodeChain node.

RPC list

You can find the RPC list in this link.

codechain-primitives

Python functions and classes for CodeChain's primitives.

Functions

  • to_hex
  • get_account_id_from_private
  • get_account_id_from_public
  • to_locale_string

Classes

  • H128, H160, H256, H512
  • U64, U128, U256
  • AssetAddres
  • PlatformAddress

codechain-keystore

codechain-keystore is a private key management module. It saves CodeChain's asset transfer address safely in a disk. If you want to manage CodeChain keys using python, you should use this.

How your private key is saved

We use a JSON file to save an encrypted private key. You can find the file in ./keystore.db.

About

Python software development kit for CodeChain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Makefile 0.2%