Contains python program examples for interacting with Sui blockchain. The demo applications
require pysui Python SUI Client SDK to run.
If not already done, you should first install suibase
$ cd ~/suibase/python $ python3 -m venv env $ . env/bin/activate $ pip install -U pip $ pip install -r requirements.txt
The examples for python target the
active workdir (one of localnet/testnet/devnet etc...). Type
asui to display the active.
To switch the active, use the workdir "set-active" command. Example,
The workdir should be initialized/started before running the demos. As an example, if 'localnet' then
localnet start should have been done.
For convenience, shell scripts have been added to
suibase/python/bin. It is expected
that when you want to run a script you are in the python folder, and you've activated the
virtual environment (
|Demo||What it does||Invoke||source|
|sysinfo||displays general sui chain information||src/demo1|
|coinage||displays information about coins and balanced||src/demo2|
|pkgtxn||demonstrate programmable transaction||src/demo3|
When pysui runs with suibase installed, it will look for a client.yaml in:
active portion of the path is a symlink resolving to either
devnet etc... as an example, when localnet is active, the resolved path becomes:
pysui you also have access to a number of installed utilities:
wallet --local [command]