IPYEOS project
Project description
Interactive Python for Eos
What Is IPyEos
- IPyEos is a Smart Contracts test framework for Eos
- IPyEos is a Python binding for Eos
Installation
python3 -m pip install ipyeos
cdt-init
on the macOS platform, you may need to install gmp
and zstd
if you don't install them.
brew reinstall gmp
brew reinstall zstd
Also, you can install the ipyeos
docker image with the following command if your machine does not support install ipyeos
directly.
docker pull ghcr.io/uuosio/ipyeos:latest
Building
To build this project, please follow the steps below:
- Clone the source code from the repository:
git clone https://github.com/uuosio/ipyeos --branch main --recursive
-
Build the forked leap source code under the
leap
directory by following the instructions in the build-and-install-from-source documentation. -
Build the Python release package:
cd ipyeos
./build.sh
- Install the Python package
python3 -m pip install dist/pyeos-0.4.1**.whl
Run a Node
eosnode
Run a Debugging Server
eosdebugger
or use the following command if you have installed ipyeos
docker image:
docker run -it --rm -p 9090:9090 -p 9092:9092 -t ghcr.io/uuosio/ipyeos
Testing
test example code
#test.py
import os
from ipyeos.chaintester import ChainTester
chaintester.chain_config['contracts_console'] = True
def test_example():
t = ChainTester(True)
with open('./hello/build/hello/hello.wasm', 'rb') as f:
code = f.read()
with open('./hello/build/hello/hello.abi', 'rb') as f:
abi = f.read()
t.deploy_contract('hello', code, abi)
t.produce_block()
t.push_action('hello', 'hi', {'nm': 'alice'}, {'hello': 'active'})
t.produce_block()
ipyeos -m pytest -x -s tests/test.py
Run a Testnet
ipyeos -m ipyeos eosnode --data-dir dd --config-dir cd -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::producer_api_plugin --plugin eosio::history_api_plugin -e --resource-monitor-space-threshold 99 --http-server-address 127.0.0.1:8889 --contracts-console --access-control-allow-origin="*" --backing-store rocksdb --wasm-runtime eos-vm-jit
Also, you can run a test node with eosnode
command directly.
eosnode --data-dir dd --config-dir cd -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::producer_api_plugin --plugin eosio::history_api_plugin -e --resource-monitor-space-threshold 99 --http-server-address 127.0.0.1:8889 --contracts-console --access-control-allow-origin="*" --backing-store rocksdb --wasm-runtime eos-vm-jit
Note
If you encounter the error message during running the above commands like Failed to load libpython3.7m.so!
, try running the following command in your terminal:
export PYTHON_SHARED_LIB_PATH=path/to/libpython[.so|.dylib]
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ipyeos-0.4.1-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16d09a8385e5a07dceaca2e3d4b690ce8e5ac71267c2ff31c2c73d7af9714f69 |
|
MD5 | 8e16bb1ad58c204730ded700520112bf |
|
BLAKE2b-256 | 6ecab1c4cf0b870b4305fc83ea9af9d9d24809da23ea4bb20e7cca8c84ad9b6e |
Hashes for ipyeos-0.4.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d2bf337a7a36a6adc8b1f63bd1293d318551b50c8009cf43adcff9412410b1 |
|
MD5 | 8e0983c64acde43e90f9d3d62adb7f0f |
|
BLAKE2b-256 | 5023cc3ad1726dc8269f576009f40cbcf807a8f7f9bac89cd9b5f9914ad08be1 |
Hashes for ipyeos-0.4.1-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2132dbd94558a682fa9d3e67bf092de6c169e9fc16ab964086a9c62fffa8c5d6 |
|
MD5 | 948355b91869234ccd00fc41aaabb20e |
|
BLAKE2b-256 | 3364a654acd6e6715b53d744252275504654d55b27798da4d811177e04afbb93 |
Hashes for ipyeos-0.4.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b01c4c97c27b8a78378d472e4a32a074768989a22b2e7b051407032673524c2 |
|
MD5 | 3f5fc2a44c6e1c024c12c9415a5d7f47 |
|
BLAKE2b-256 | dd21ce75844c9e96e4e46f83653aac9e352a0894797d624a0492502e91149d82 |
Hashes for ipyeos-0.4.1-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ca68fbb9da296c073ddf5a635d547658f768aef26b04bc3066a9a0a98ec319 |
|
MD5 | bade9ea92c68940f949fb5a710ed5b52 |
|
BLAKE2b-256 | fda9192d2469d1d08c811293ba6878c0a0441ac4fdc77da1524cfacacd1949d3 |
Hashes for ipyeos-0.4.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f2024696e95f356c7807ea09ec67a2ed525aa0d89233ba2472705739b96b338 |
|
MD5 | 209fd2ac71a334a6e0a795d532bebfc0 |
|
BLAKE2b-256 | 1bc14258975b49bfc8bc864eab30743c66a8d77db5016c4c1d889f1a7ca02b4a |
Hashes for ipyeos-0.4.1-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a17ec13a54869444c1551b4d5ddf61215aa90d093918069c6b5002254fa93982 |
|
MD5 | 13d45e9d95e2d298e4da3f3a6e151d96 |
|
BLAKE2b-256 | 86d4dc33b8625435839b5e108554791a519e8fa36eb3e5fd2616692294849999 |
Hashes for ipyeos-0.4.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9baaf8d0fc553a2cdaccd006e1f3ce95347d6d8e3c61d243438b693a5fda5caf |
|
MD5 | 3de2d3f9c3eff224c9445f5e5c3a63bf |
|
BLAKE2b-256 | 534261d138f9660ef1a82e360f4e1e2a59317a76a51491f3d4ff9e70f4e3180e |