xuperchain / contract-sdk-py

The Python SDK for XuperChain smart contract

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

contract-sdk-py 是 XuperChain 的官方python 合约SDK,使用前请先在本地运行最新的XuperChain,并确保开启 native 合约支持

要求 python 版本为 python3.6+

  1. 安装 python 合约 SDK
    git clone https://github.com/xuperchain/contract-sdk-py.git
    cd contract-sdk-py
    pip install -r requirements.txt
    python3 setup.py install 
  1. 部署和调用第一个 python 合约
    ./xchain-cli native deploy --account XC1111111111111111@xuper --fee 15587517 --runtime py  -a '{"creator":"xchain"}' --cname counter <PATH_TO_CONTRACT_SDK_PY>/example/counter/counter.py 
    ./xchain-cli native invoke --method Increase -a '{"key":"xchain"}' counter --fee 10
    ./xchain-cli native invoke --method  Get -a '{"key":"xchain"}' counter --fee 10

About

The Python SDK for XuperChain smart contract

License:Apache License 2.0


Languages

Language:Python 92.0%Language:JavaScript 8.0%