The package is published in PyPI at the following link:
Package | Description |
---|---|
snet.cli | Command line interface to interact with the SingularityNET platform |
This project is licensed under the MIT License - see the LICENSE file for details.
The instruction down below describes the installation of the SingularityNET CLI. Please check our full Documentation.
You should have Python>=3.10 with pip installed.
Additionally, you should make sure that you have the following packages in your system:
- libudev
- libusb 1.0
If you use Ubuntu (or any Linux distribution with APT support) you could run the following:
sudo apt-get install libudev-dev libusb-1.0-0-dev
$ pip3 install snet.cli
If you want to enable the autocompletion of commands, you should install the
- python-argcomplete
On ubuntu (or any Linux distribution with APT support), you could run the following
sudo apt install python3-argcomplete
After the package is installed, activate autocomplete
sudo activate-global-python-argcomplete3
Note: Changes will not take effect until shell is restarted.
echo 'eval "$(register-python-argcomplete3 snet)"' >> ~/.bashrc
then
source ~/.bashrc
Complete documentation is available here
We will use the Sepolia testnet for this example:
snet network sepolia
Create the identity:
snet identity create example_identity key
and enter your private key when asked.
OR
you can pass the private key directly:
snet identity create --private-key "a7638fd785fdb5cf13df0a1d7b5584cc20d4e8526403f0df105eedf23728f538" test key
You can also use other identity options. See documentation.
You can check your balance using the
snet account balance
Deposit 70 tokens:
snet account deposit 70
Press y to confirm.
You can check your balance again to ensure that the transaction was successfull.
Before making a call we need to open the payment channel. In this example we will use the organization with id= 26072b8b6a0e448180f8c0e702ab6d2f and group_name= default_group. We will transfer there 70 tokens for 4 weeks:
snet channel open-init 26072b8b6a0e448180f8c0e702ab6d2f default_group 70 +4weeks
And now we can call the "Exampleservice" service:
snet client call 26072b8b6a0e448180f8c0e702ab6d2f Exampleservice default_group add '{"a":10,"b":32}'
Press 'Y' to confirm and get service`s response:
value: 42
Backward compatibility for other Python versions is not guaranteed.
- Clone the git repository
$ git clone https://github.com/singnet/snet-cli.git
$ cd snet-cli/packages/snet_cli
-
Install the package in development/editable mode
$ pip3 install -e .
- Clone repository and install dependencies
$ git clone https://github.com/singnet/snet-cli.git
$ cd snet-cli
$ pip install -r docs/requirements.txt
- Run the build-docs.sh in the docs directory
$ cd docs
$ sh build-docs.sh
- Install
make
utility and run the build-docs.ps1 in the docs directory
choco install make # install choco if it is not already installed
cd docs
powershell -file build-docs.ps1
The documentation is generated under the docs/build/markdown folder
This project is published to PyPI.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE file for details.