diff --git a/snet_cli/README.md b/snet_cli/README.md index c9bd46b4..d3401870 100644 --- a/snet_cli/README.md +++ b/snet_cli/README.md @@ -121,4 +121,4 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available, ## License This project is licensed under the MIT License - see the -[LICENSE](https://github.com/singnet/alpha-daemon/blob/master/LICENSE) file for details. +[LICENSE](https://github.com/singnet/snet-cli/blob/master/snet_cli/LICENSE) file for details. diff --git a/snet_sdk/README.md b/snet_sdk/README.md index 4d2cb275..66cf47da 100644 --- a/snet_sdk/README.md +++ b/snet_sdk/README.md @@ -6,56 +6,68 @@ SingularityNET SDK for Python These instructions are for the development and use of the SingularityNET SDK for Python. -### Usage +### Core concepts + +The SingularityNET SDK allows you to make calls to SingularityNET services programmatically from your application. +To communicate between clients and services, SingularityNET uses [gRPC](https://grpc.io/). +To handle payment of services, SingularityNET uses [Ethereum state channels](https://dev.singularitynet.io/docs/concepts/multi-party-escrow/). +The SingularityNET SDK abstracts and manages state channels with service providers on behalf of the user and handles authentication with the SingularityNET services. -The SingularityNET SDK allows you to import compiled client libraries for your service or services or choice and make calls to those services programmatically from your application by setting up state channels with the providers of those services and making gRPC calls to the SingularityNET daemons for those services by selecting a channel with sufficient funding and supplying the appropriate metadata for authentication. +### Usage -Once you have installed the snet-sdk in your current environment and it's in your PYTHONPATH, you should import it and create an instance of the base sdk class: +To call a SingularityNET service, the user must be able to deposit funds (AGI tokens) to the [Multi-Party Escrow](https://dev.singularitynet.io/docs/concepts/multi-party-escrow/) Smart Contract. +To deposit these tokens or do any other transaction on the Ethereum blockchain, the user must possess an Ethereum identity with available Ether. -```python -from snet_sdk import Snet -import config -snet = Snet(private_key=config.private_key) -``` -Now, the instance of the sdk can be used to instantiate clients for SingularityNET services. To interact with those services, the sdk needs to be supplied the compiled client libraries and a reference to their path on your file system. - -To generate the client libraries, you need the SingularityNET Command Line Interface, or CLI, which you can download from PyPi, see [https://github.com/singnet/snet-cli#installing-with-pip](https://github.com/singnet/snet-cli#installing-with-pip) +To interact with SingularityNET services, you must compile the appropriate client libraries for that service. +To generate the client libraries to use in your application, you need the SingularityNET Command Line Interface, or CLI, which you can download from PyPi, see [https://github.com/singnet/snet-cli#installing-with-pip](https://github.com/singnet/snet-cli/snet_cli#installing-with-pip) Once you have the CLI installed, run the following command: ```bash snet sdk generate-client-library python ``` -Optionally, you can specify an output path; otherwise it's going to be `./client_libraries/python//` +Optionally, you can specify an output path; otherwise it's going to be `./client_libraries/python///`. +You should move or copy these generated files to the root of your project. -Now, by default the sdk is going to look for those client libraries in the `./grpc//` in the directory of the main process of the module it's being imported by. - -Once you have the generated client libraries in place, you can create an instance of a SingularityNET service client: +Once you have installed the snet-sdk in your current environment and it's in your PYTHONPATH, you should import it and create an instance of the base sdk class: + ```python -client = snet.client("", "") +from snet_sdk import SnetSDK +from config import config +snet = SnetSDK(config) ``` -The client exposes the following properties and methods: -- All of the modules from the generated client library as `client.grpc.