python库到etheroll智能合约
etheroll的Python项目详细描述
Pyetheroll
python库到etheroll智能合约
用法
只需在滚动前设置赌注大小、机会和钱包设置:
frompyetheroll.etherollimportEtherolletheroll=Etheroll()bet_size_ether=0.1chances=50wallet_path='wallet.json'wallet_password='password'transaction=etheroll.player_roll_dice(bet_size_ether,chances,wallet_path,wallet_password)
还可以设置不同的合同地址和链ID:
frompyetheroll.constantsimportChainIDfrompyetheroll.etherollimportEtherollchain_id=ChainID.ROPSTENcontract_address='0xe12c6dEb59f37011d2D9FdeC77A6f1A8f3B8B1e8'etheroll=Etheroll(chain_id,contract_address)
在docs/Examples.md中了解更多信息。
安装
pip install pyetheroll
pip install --process-dependency-links \
https://github.com/AndreMiras/pyetheroll/archive/develop.zip