Skip to content

Commit

Permalink
Merge pull request #25 from swanchain/release/v0.0.3.post1
Browse files Browse the repository at this point in the history
Release/v0.0.3.post1
  • Loading branch information
alphaflows committed May 15, 2024
2 parents 85dd6d0 + 7e7fed8 commit 4914dd7
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 381 deletions.
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# PYTHON SWAN SDK
# PYTHON SWAN SDK <!-- omit in toc -->

[![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<!-- omit in toc -->

- [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
Expand All @@ -47,13 +48,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
Expand Down Expand Up @@ -307,11 +308,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](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 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](https://github.com/swanchain/python-swan-sdk/tree/release/v0.0.3.post1/docs)

## License

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Swan SDK Configuration
# Swan SDK Configuration<!-- omit in toc -->

## Table Of Contents
## Table Of Contents<!-- omit in toc -->
- [Introduction](#introduction)
- [Use Python dotenv](#use-python-dotenv)

Expand Down
10 changes: 5 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Install Python Swan SDK
# Install Python Swan SDK<!-- omit in toc -->

## 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<!-- omit in toc -->
- [Create Virtual Environment](#create-virtual-environment)
- [Install via PyPI](#install-via-pypi)
- [Clone from Github](#clone-from-github)


## Create Virtual Environment
Expand Down
6 changes: 3 additions & 3 deletions docs/object.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Swan SDK Object Documentation
# Swan SDK Object Documentation <!-- omit in toc -->

## Table Of Contents
## Table Of Contents<!-- omit in toc -->
- [Introduction](#introduction)
- [Hardware Config](#hardwareconfig)
- [HardwareConfig](#hardwareconfig)

## Introduction

Expand Down
29 changes: 15 additions & 14 deletions docs/sample_tutorial.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Sample Tutorial for Swan SDK
# Sample Tutorial for Swan SDK <!-- omit in toc -->
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<!-- omit in toc -->
- [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'
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 4914dd7

Please sign in to comment.