Skip to content

ZihangChenNBAI/python-sdk-docs-samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python SDK Docs Samples

Python samples for the Swan SDK

Setup

  1. Install [pip and virtualenv][cloud_python_setup] if you do not already have them
  2. Clone the repository
git clone https://github.com/swanchain/python-sdk-docs-samples.git
  1. Obtain authentication credentials. To use swan-sdk, an Orchestrator API key is required.
  • Go to Orchestrator Dashboard, switch network to Mainnet.
  • Login through MetaMask.
  • Click the user icon on the top right.
  • Click 'Show API-Key' -> 'New API Key'
  1. Set up environment variables Create a .env file in the root directory and add the following environment variables:
WALLET_ADDRESS=<your_wallet_address>
PRIVATE_KEY=<your_private_key>
SWAN_API_KEY=<your_swanchain_api_key>

Make sure to replace the placeholders with your actual values. And have enough balance in your wallet to run the test.

How to run a sample

  1. Change directory to one of the sample folders, e.g. cd computing
cd compute 
  1. Set Up the Virtual Environment:**
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the dependencies:
pip install -r requirements.txt
  1. Run the sample:
python -m pytest -s  <test_file_name>.py

References

https://github.com/GoogleCloudPlatform/python-docs-samples

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%