From 99fc28372a00ace3aea650ac5aa10bb0ad2f5ecc Mon Sep 17 00:00:00 2001 From: alphaflows Date: Tue, 7 May 2024 16:37:04 -0400 Subject: [PATCH 1/4] fix to wei --- swan/contract/swan_contract.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/swan/contract/swan_contract.py b/swan/contract/swan_contract.py index f92751f..94675a0 100644 --- a/swan/contract/swan_contract.py +++ b/swan/contract/swan_contract.py @@ -97,7 +97,7 @@ def submit_payment( nonce = self.w3.eth.get_transaction_count(self.account.address) base_fee = self.w3.eth.get_block('latest')['baseFeePerGas'] - max_priority_fee_per_gas = self.w3.toWei(2, 'gwei') + max_priority_fee_per_gas = self.w3.to_wei(2, 'gwei') max_fee_per_gas = base_fee + max_priority_fee_per_gas if max_fee_per_gas < max_priority_fee_per_gas: max_fee_per_gas = max_priority_fee_per_gas + base_fee @@ -114,7 +114,7 @@ def submit_payment( signed_tx = self.w3.eth.account.sign_transaction(tx, self.account._private_key) tx_hash = self.w3.eth.send_raw_transaction(signed_tx.rawTransaction) self.w3.eth.wait_for_transaction_receipt(tx_hash, timeout=CONTRACT_TIMEOUT) - return self.w3.toHex(tx_hash) + return self.w3.to_hex(tx_hash) def _approve_payment(self, amount): @@ -126,7 +126,7 @@ def _approve_payment(self, amount): """ nonce = self.w3.eth.get_transaction_count(self.account.address) base_fee = self.w3.eth.get_block('latest')['baseFeePerGas'] - max_priority_fee_per_gas = self.w3.toWei(2, 'gwei') + max_priority_fee_per_gas = self.w3.to_wei(2, 'gwei') max_fee_per_gas = base_fee + max_priority_fee_per_gas if max_fee_per_gas < max_priority_fee_per_gas: max_fee_per_gas = max_priority_fee_per_gas + base_fee @@ -142,7 +142,7 @@ def _approve_payment(self, amount): signed_tx = self.w3.eth.account.sign_transaction(tx, self.account._private_key) tx_hash = self.w3.eth.send_raw_transaction(signed_tx.rawTransaction) self.w3.eth.wait_for_transaction_receipt(tx_hash, timeout=CONTRACT_TIMEOUT) - return self.w3.toHex(tx_hash) + return self.w3.to_hex(tx_hash) def lock_revenue(self, task_id: str, hardware_id: int, duration: int): @@ -151,7 +151,7 @@ def lock_revenue(self, task_id: str, hardware_id: int, duration: int): """ nonce = self.w3.eth.get_transaction_count(self.account.address) base_fee = self.w3.eth.get_block('latest')['baseFeePerGas'] - max_priority_fee_per_gas = self.w3.toWei(2, 'gwei') + max_priority_fee_per_gas = self.w3.to_wei(2, 'gwei') max_fee_per_gas = base_fee + max_priority_fee_per_gas if max_fee_per_gas < max_priority_fee_per_gas: max_fee_per_gas = max_priority_fee_per_gas + base_fee @@ -168,7 +168,7 @@ def lock_revenue(self, task_id: str, hardware_id: int, duration: int): signed_tx = self.w3.eth.account.sign_transaction(tx, self.account._private_key) tx_hash = self.w3.eth.send_raw_transaction(signed_tx.rawTransaction) self.w3.eth.wait_for_transaction_receipt(tx_hash, timeout=CONTRACT_TIMEOUT) - return self.w3.toHex(tx_hash) + return self.w3.to_hex(tx_hash) def _approve_swan_token(self, amount): """ @@ -176,7 +176,7 @@ def _approve_swan_token(self, amount): """ nonce = self.w3.eth.get_transaction_count(self.account.address) base_fee = self.w3.eth.get_block('latest')['baseFeePerGas'] - max_priority_fee_per_gas = self.w3.toWei(2, 'gwei') + max_priority_fee_per_gas = self.w3.to_wei(2, 'gwei') max_fee_per_gas = base_fee + max_priority_fee_per_gas if max_fee_per_gas < max_priority_fee_per_gas: max_fee_per_gas = max_priority_fee_per_gas + base_fee @@ -192,7 +192,7 @@ def _approve_swan_token(self, amount): signed_tx = self.w3.eth.account.sign_transaction(tx, self.account._private_key) tx_hash = self.w3.eth.send_raw_transaction(signed_tx.rawTransaction) self.w3.eth.wait_for_transaction_receipt(tx_hash, timeout=CONTRACT_TIMEOUT) - return self.w3.toHex(tx_hash) + return self.w3.to_hex(tx_hash) def _get_swan_balance(self, address=None): """Retrieve swan token balance of any wallet from Swan token contract. From 9585b11b8095f749c20769255176670493495b44 Mon Sep 17 00:00:00 2001 From: alphaflows Date: Wed, 15 May 2024 11:24:43 -0400 Subject: [PATCH 2/4] update docs --- README.md | 41 +-- docs/configuration.md | 4 +- docs/installation.md | 10 +- docs/object.md | 6 +- docs/sample_tutorial.md | 29 +- ...e-demo-v0.0.2.ipynb => example-demo.ipynb} | 2 +- .../example-deploy-v0.0.1-deprecated.ipynb | 319 ------------------ setup-.py | 35 ++ setup.py | 18 +- 9 files changed, 92 insertions(+), 372 deletions(-) rename examples/{example-demo-v0.0.2.ipynb => example-demo.ipynb} (99%) delete mode 100644 examples/example-deploy-v0.0.1-deprecated.ipynb create mode 100644 setup-.py diff --git a/README.md b/README.md index 2de2062..58534af 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,30 @@ -# PYTHON SWAN SDK +# PYTHON SWAN SDK [![Made by FilSwan](https://img.shields.io/badge/made%20by-FilSwan-green.svg)](https://www.filswan.com/) [![Chat on discord](https://img.shields.io/badge/join%20-discord-brightgreen.svg)](https://discord.com/invite/swanchain) ## Table Of Contents +- [Table Of Contents](#table-of-contents) - [Overview](#overview) - [Features](#features) - [Installation](#installation) -- [Use Python dotenv (Optional)](#use-python-dotenv) -- [Quick Guide](#quick-start-guide-sdk-v2) - 1. [Get Orchestrator API Key](#1-get-orchestrator-api-key) - 2. [Login to Orchestrator](#2-login-into-Orchestrator-through-sdk) - 3. [Use Swan Payment Contract](#3-connect-to-swan-payment-contract) - 4. [Retrieve CP Hardware Info](#4-retrieve-available-hardware-information) - 5. [Get Job Source URI](#5-get-job_source_uri) - 6. [Esitmate Task Payment](#6-esitmate-payment-amount) - 7. [Create Task](#7-create-task) - 8. [Submit Payment](#8-submit-payment) - 9. [Validate Payment and Deploy Task](#9-validate-payment-to-deploy-task) - 10. [Follow-Up Deployed Task Status (Optional)](#10-follow-up-task-status-optional) -- [Executable Example](#examples) +- [Use Python dotenv](#use-python-dotenv) +- [Quick Start Guide for Swan SDK](#quick-start-guide-for-swan-sdk) + - [1. Get Orchestrator API Key](#1-get-orchestrator-api-key) + - [2. Login into Orchestrator Through SDK](#2-login-into-orchestrator-through-sdk) + - [3. Connect to Swan Payment Contract](#3-connect-to-swan-payment-contract) + - [4. Retrieve available hardware information](#4-retrieve-available-hardware-information) + - [5. Get job\_source\_uri](#5-get-job_source_uri) + - [6. Estimate Payment Amount](#6-estimate-payment-amount) + - [7. Create Task](#7-create-task) + - [8. Submit Payment](#8-submit-payment) + - [9. Validate Payment to Deploy Task](#9-validate-payment-to-deploy-task) + - [10. Follow-up Task Status (Optional)](#10-follow-up-task-status-optional) + - [Show results](#show-results) + - [Show task details](#show-task-details) +- [Examples](#examples) - [Documentation](#documentation) -- [Contribution](#contributions) - [License](#license) ## Overview @@ -47,13 +49,13 @@ To use Python Swan SDK, use **Python 3.8 or later** and **web3.py 6.15 or later* **Install via PyPI:** ```bash -pip install swan-sdk==0.0.2 +pip install swan-sdk ``` **Clone from GitHub:** ```bash -git clone https://github.com/swanchain/orchestrator-sdk.git +git clone https://github.com/swanchain/python-swan-sdk.git ``` ## Use Python dotenv @@ -307,11 +309,12 @@ Simple output ## Examples -For executable examples consult https://github.com/swanchain/python-swan-sdk/tree/release/v0.0.2.post1/examples + +For executable examples consult [examples](./examples/). ## Documentation -For comprehensive documentation, including detailed installation guides, usage examples, and complete API references, please consult https://github.com/swanchain/python-swan-sdk/tree/release/v0.0.2.post1/docs +For comprehensive documentation, including detailed installation guides, usage examples, and complete API references, please consult [more docs](./docs/) ## License diff --git a/docs/configuration.md b/docs/configuration.md index cd50015..8f5b750 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,6 +1,6 @@ -# Swan SDK Configuration +# Swan SDK Configuration -## Table Of Contents +## Table Of Contents - [Introduction](#introduction) - [Use Python dotenv](#use-python-dotenv) diff --git a/docs/installation.md b/docs/installation.md index ba72323..7565aa4 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,9 +1,9 @@ -# Install Python Swan SDK +# Install Python Swan SDK -## Table Of Contents -- [Create Virtual Env](#create-virtual-environment) -- [Install from PyPI](#install-python-swan-sdk) -- [Clone from GitHub](#clone-from-github) +## Table Of Contents +- [Create Virtual Environment](#create-virtual-environment) +- [Install via PyPI](#install-via-pypi) +- [Clone from Github](#clone-from-github) ## Create Virtual Environment diff --git a/docs/object.md b/docs/object.md index b4372cb..2b6d279 100644 --- a/docs/object.md +++ b/docs/object.md @@ -1,8 +1,8 @@ -# Swan SDK Object Documentation +# Swan SDK Object Documentation -## Table Of Contents +## Table Of Contents - [Introduction](#introduction) -- [Hardware Config](#hardwareconfig) +- [HardwareConfig](#hardwareconfig) ## Introduction diff --git a/docs/sample_tutorial.md b/docs/sample_tutorial.md index ef1f19c..7396fd1 100644 --- a/docs/sample_tutorial.md +++ b/docs/sample_tutorial.md @@ -1,23 +1,24 @@ -# Sample Tutorial for Swan SDK +# Sample Tutorial for Swan SDK Jump into using the SDK with this quick example: -## Table Of Contents -1. [Get Orchestrator API Key](#1-get-orchestrator-api-key) -2. [Login to Orchestrator](#2-login-into-orchestrator-through-sdk) -3. [Use Swan Payment Contract](#3-connect-to-swan-payment-contract) -4. [Retrieve CP Hardware Info](#4-retrieve-available-hardware-information) -5. [Get Job Source URI](#5-get-job_source_uri) -6. [Esitmate Task Payment](#6-esitmate-payment-amount) -7. [Create Task](#7-create-task) -8. [Submit Payment](#8-submit-payment) -9. [Validate Payment and Delpoy Task](#9-validate-payment-to-deploy-task) -10. [Follow Up Deployed Task Status (Optional)](#10-follow-up-task-status-optional) +## Table Of Contents +- [1. Get Orchestrator API Key](#1-get-orchestrator-api-key) +- [2. Login into Orchestrator Through SDK](#2-login-into-orchestrator-through-sdk) +- [3. Connect to Swan Payment Contract](#3-connect-to-swan-payment-contract) +- [4. Retrieve available hardware information](#4-retrieve-available-hardware-information) +- [5. Get job\_source\_uri](#5-get-job_source_uri) +- [6. Estimate Payment Amount](#6-estimate-payment-amount) +- [7. Create Task](#7-create-task) +- [8. Submit Payment](#8-submit-payment) +- [9. Validate Payment to Deploy Task](#9-validate-payment-to-deploy-task) +- [10. Follow-up Task Status (Optional)](#10-follow-up-task-status-optional) + - [Show results](#show-results) ### 1. Get Orchestrator API Key To use `swan-sdk`, an Orchestrator API key is required. -- Go to Orchestrator Dashboard: https://orchestrator.swanchain.io/provider-status +- Go to [Orchestrator Dashboard](https://orchestrator.swanchain.io/provider-status) - Login through MetaMask. - Click the user icon on the top right. - Click 'Show API-Key' -> 'New API Key' @@ -99,7 +100,7 @@ print(chosen_hardware.price) # current hardware price print(chosen_hardware.status) # overall hardware avaliablility ``` -More detials go oject documentation: https://github.com/swanchain/python-swan-sdk/blob/release/v0.0.2.post1/docs/object.md +More detials go [object documentation](./object.md). ### 5. Get job_source_uri diff --git a/examples/example-demo-v0.0.2.ipynb b/examples/example-demo.ipynb similarity index 99% rename from examples/example-demo-v0.0.2.ipynb rename to examples/example-demo.ipynb index 7d38566..a383d97 100644 --- a/examples/example-demo-v0.0.2.ipynb +++ b/examples/example-demo.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Demo for SDK (v0.0.2)\n", + "## Demo for SDK\n", "\n", "This example shows how to use SDK to deploy a task. The demo notebook includes the following steps:\n", "- [initialization](#initialization)\n", diff --git a/examples/example-deploy-v0.0.1-deprecated.ipynb b/examples/example-deploy-v0.0.1-deprecated.ipynb deleted file mode 100644 index 7cfcdcd..0000000 --- a/examples/example-deploy-v0.0.1-deprecated.ipynb +++ /dev/null @@ -1,319 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example for SDK\n", - "\n", - "This example shows how to use SDK to deploy a task (deprecated version)\n", - "\n", - "### Initialization" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "import sys\n", - "sys.path.insert(0, '..')\n", - "\n", - "import os\n", - "import time\n", - "import dotenv\n", - "dotenv.load_dotenv(\"../.env\")\n", - "from swan import SwanAPI , MCSAPI\n", - "\n", - "dev_url = \"https://swanhub-cali.swanchain.io\"\n", - "# dev_url = \"http://127.0.0.1:5008\"\n", - "\n", - "# Initialize the Swan Service\n", - "# get user api_key in dashboard page: https://orchestrator-test.swanchain.io/provider-status\n", - "swan_api = SwanAPI(api_key=os.getenv(\"API_KEY\"), environment=dev_url)\n", - "\n", - "# api_key = os.getenv(\"MCS_API_KEY\")\n", - "# mcs_api = MCSAPI(api_key)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Available hardware information" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "hardwares = swan_api.get_hardware_config()\n", - "hardwares_info = [hardware.to_dict() for hardware in hardwares if hardware.status == \"available\"] \n", - "# hardwares_info" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "choose hardware config" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1\n", - "('C1ae.medium', 1, ['Quebec-CA', 'North Carolina-US'])\n" - ] - } - ], - "source": [ - "device = 'C1ae.medium' #\"G1ae.medium\"\n", - "obj = [hardware for hardware in hardwares if hardware.name == device][0]\n", - "print(obj.id)\n", - "print([(hardware.name, hardware.id, hardware.region) for hardware in hardwares if hardware.name == device][0])" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "to simplify the process, here we use a existing `job_source_uri` which is a hello world application, used to create task." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "job_source_uri = 'https://test-api.lagrangedao.org/spaces/5117e998-c623-4837-8af9-2b7b0ce2de7f'" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Contract and Payment" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2000000000000000000\n" - ] - } - ], - "source": [ - "from swan import SwanContract\n", - "dotenv.load_dotenv(\"../.env\")\n", - " \n", - "pk = os.getenv('PK')\n", - "rpc = os.getenv('RPC')\n", - "\n", - "c = SwanContract(pk, swan_api.contract_info)\n", - " \n", - "# Test esimate lock revenue\n", - "r = c.estimate_payment(obj.id, 2)\n", - "print(r)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0x800bbde44740faa1d44b1cf9c3b1a3b629b43742c427fdd743a0ec8e571ad703\n", - "0x0682f87926cd8db6ce3465772bb36f3ae09696443d9a065f5403e0c3e2fe7ce1\n" - ] - } - ], - "source": [ - "r = c._approve_swan_token(2000000000000000000)\n", - "print(r)\n", - " \n", - "r = c.lock_revenue('1', obj.id, 1)\n", - "print(r)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Deploy task\n", - "\n", - "This step shows how to use SDK's interface for deploying task, which calls Orchestrator's task deployment API (V1), given the `job_source_uri` and **payment information** (`paid`, `tx_hash`) in the previous steps." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/var/folders/f1/12wnv55x7vz6rr1ts9l6lytm0000gn/T/ipykernel_38565/44368673.py:2: DeprecationWarning: Call to deprecated method deploy_task. (This API will be removed in the future version.) -- Deprecated since version 0.0.2.\n", - " result = swan_api.deploy_task(\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'data': {'task': {'created_at': '1714764579', 'end_at': '1714768172', 'leading_job_id': None, 'refund_amount': None, 'status': 'created', 'task_detail_cid': 'https://plutotest.acl.swanipfs.com/ipfs/QmcSoSW6MvSyNQesEMTJLSPWEpngCVwyXfbnN12bmbtN2p', 'tx_hash': None, 'updated_at': '1714764579', 'uuid': '226ea8b5-8d91-4470-8002-68fbd89232a2'}}, 'message': 'Task_uuid created.', 'status': 'success'}\n", - "Task UUID: 226ea8b5-8d91-4470-8002-68fbd89232a2\n" - ] - } - ], - "source": [ - "# Deploy task\n", - "result = swan_api.deploy_task(\n", - " cfg_name=device, \n", - " region='Quebec-CA', \n", - " start_in=5, duration=3600*1, \n", - " job_source_uri=job_source_uri, \n", - " paid=1,\n", - " tx_hash=r,\n", - " wallet_address=os.getenv('WALLET'),\n", - " )\n", - "print(result)\n", - "task_uuid = result['data']['task']['uuid']\n", - "print(\"Task UUID:\", task_uuid)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The following step is optional, shows information when waiting for task being deployed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Check task info\n", - "while True:\n", - " info = swan_api.get_deployment_info(task_uuid=task_uuid)\n", - " if len(info['data']['jobs']) > 0:\n", - " \n", - " status = info['data']['jobs'][0]['status']\n", - " print(status)\n", - " \n", - " job_res_uri = info['data']['jobs'][0]['job_result_uri']\n", - " job_real_uri = info['data']['jobs'][0]['job_real_uri']\n", - " print(\"Job Result URL: \", job_res_uri)\n", - " print(\"Job Real URL: \", job_real_uri)\n", - " \n", - " # break\n", - " if status == 'deployToK8s' or status == \"Cancelled\" or status == \"Failed\":\n", - " break\n", - " \n", - " time.sleep(30)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Show result\n", - "\n", - "`job_real_uri` is for show the result of application you deployed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['https://cf24tc2oot.dev2.crosschain.computer']\n" - ] - } - ], - "source": [ - "r = swan_api.get_real_url(task_uuid)\n", - "print(r)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"Hello\": \"World! Today - 06.21\"\n", - "}\n" - ] - } - ], - "source": [ - "import requests\n", - "import json\n", - "\n", - "headers = {\n", - " 'Content-Type': 'application/json',\n", - "}\n", - "\n", - "response = requests.get(r[0], headers=headers)\n", - "\n", - "try:\n", - " print(json.dumps(response.json(), indent=4))\n", - "except Exception as e:\n", - " print(e)\n", - " print(response)\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "swanchain", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.14" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/setup-.py b/setup-.py new file mode 100644 index 0000000..f26fa1c --- /dev/null +++ b/setup-.py @@ -0,0 +1,35 @@ +""" SwanSDK setup code """ + +from setuptools import setup, find_packages + + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup( + name="orchestrator-sdk", + version="0.0.3.post1", + packages=['swan', 'swan.api', 'swan.common', 'swan.contract', 'swan.object', 'swan.contract.abi'], + # package_data={'swan.contract.abi': ['swan/contract/abi/PaymentContract.json', 'swan/contract/abi/SwanToken.json']}, + include_package_data=True, + description="A python developer tool kit for Swan Orchestrator services.", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/swanchain/python-swan-sdk", + author="ZihangChenNBAI", + author_email="zhchen@nbai.io", + license="MIT", + classifiers=[ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + ], + install_requires=[ + "requests==2.28.1", + "requests-toolbelt==0.10.1", + "web3==6.15.1", + "tqdm==4.64.1" + ], + entry_points={ + # placeholder + }, + ) \ No newline at end of file diff --git a/setup.py b/setup.py index bd9c0b5..ecf8d1a 100644 --- a/setup.py +++ b/setup.py @@ -1,23 +1,23 @@ """ SwanSDK setup code """ - + from setuptools import setup, find_packages - - + + with open("README.md", "r") as fh: long_description = fh.read() - + setup( - name="orchestrator-sdk", - version="0.0.2.post1", + name="swan-sdk", + version="0.0.3", packages=['swan', 'swan.api', 'swan.common', 'swan.contract', 'swan.object', 'swan.contract.abi'], # package_data={'swan.contract.abi': ['swan/contract/abi/PaymentContract.json', 'swan/contract/abi/SwanToken.json']}, include_package_data=True, description="A python developer tool kit for Swan Orchestrator services.", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/swanchain/orchestrator-sdk", - author="ZihangChenNBAI", - author_email="zhchen@nbai.io", + url="https://github.com/swanchain/python-swan-sdk", + author="SwanCloud", + author_email="swan.development@nbai.io", license="MIT", classifiers=[ "License :: OSI Approved :: MIT License", From d5d5d0adec10b850afccc9cebefee0b1ca9670c3 Mon Sep 17 00:00:00 2001 From: alphaflows Date: Wed, 15 May 2024 11:25:50 -0400 Subject: [PATCH 3/4] update docs --- README.md | 3 +-- setup-.py | 35 ----------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 setup-.py diff --git a/README.md b/README.md index 58534af..934b8b4 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,8 @@ [![Made by FilSwan](https://img.shields.io/badge/made%20by-FilSwan-green.svg)](https://www.filswan.com/) [![Chat on discord](https://img.shields.io/badge/join%20-discord-brightgreen.svg)](https://discord.com/invite/swanchain) -## Table Of Contents +## Table Of Contents -- [Table Of Contents](#table-of-contents) - [Overview](#overview) - [Features](#features) - [Installation](#installation) diff --git a/setup-.py b/setup-.py deleted file mode 100644 index f26fa1c..0000000 --- a/setup-.py +++ /dev/null @@ -1,35 +0,0 @@ -""" SwanSDK setup code """ - -from setuptools import setup, find_packages - - -with open("README.md", "r") as fh: - long_description = fh.read() - -setup( - name="orchestrator-sdk", - version="0.0.3.post1", - packages=['swan', 'swan.api', 'swan.common', 'swan.contract', 'swan.object', 'swan.contract.abi'], - # package_data={'swan.contract.abi': ['swan/contract/abi/PaymentContract.json', 'swan/contract/abi/SwanToken.json']}, - include_package_data=True, - description="A python developer tool kit for Swan Orchestrator services.", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/swanchain/python-swan-sdk", - author="ZihangChenNBAI", - author_email="zhchen@nbai.io", - license="MIT", - classifiers=[ - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - ], - install_requires=[ - "requests==2.28.1", - "requests-toolbelt==0.10.1", - "web3==6.15.1", - "tqdm==4.64.1" - ], - entry_points={ - # placeholder - }, - ) \ No newline at end of file From 7e7fed832be363d75e023b6df428da2bf12e4074 Mon Sep 17 00:00:00 2001 From: alphaflows Date: Wed, 15 May 2024 11:41:21 -0400 Subject: [PATCH 4/4] update docs --- README.md | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 934b8b4..f2fa8e4 100644 --- a/README.md +++ b/README.md @@ -309,11 +309,11 @@ Simple output ## Examples -For executable examples consult [examples](./examples/). +For executable examples consult [examples](https://github.com/swanchain/python-swan-sdk/tree/release/v0.0.3.post1/examples). ## Documentation -For comprehensive documentation, including detailed installation guides, usage examples, and complete API references, please consult [more docs](./docs/) +For comprehensive documentation, including detailed installation guides, usage examples, and complete API references, please consult [more docs](https://github.com/swanchain/python-swan-sdk/tree/release/v0.0.3.post1/docs) ## License diff --git a/setup.py b/setup.py index ecf8d1a..ca3730e 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="swan-sdk", - version="0.0.3", + version="0.0.3.post1", packages=['swan', 'swan.api', 'swan.common', 'swan.contract', 'swan.object', 'swan.contract.abi'], # package_data={'swan.contract.abi': ['swan/contract/abi/PaymentContract.json', 'swan/contract/abi/SwanToken.json']}, include_package_data=True,