Swan SDK
Get started with Swan SDK
Overview
Chain Node Web Application
Create Task and Deploy Application Instances
import swan
import json
api_key = '<your_api_key>'
wallet_address = '<WALLET_ADDRESS>'
private_key = '<PRIVATE_KEY>'
swan_orchestrator = swan.resource(
api_key=api_key,
service_name='Orchestrator'
)
result = swan_orchestrator.create_task(
repo_uri='https://github.com/swanchain/awesome-swanchain/tree/main/ChainNode',
wallet_address=wallet_address,
private_key=private_key,
auto_pay=True,
instance_type='C1ae.medium',
)
task_uuid = result['task_uuid']
instance_type = result['instance_type']
task_info = swan_orchestrator.get_deployment_info(task_uuid=task_uuid)
print(json.dumps(task_info.to_dict(), indent=2))
### get real url (if no url, please wait for a while, then check again)
result_url = swan_orchestrator.get_real_url(task_uuid)
print(result_url)View Running Application

Documentation and Support
Last updated