Setup Soroban Python SDK on Windows
Soroban has a Python Software Development Kit (SDK) that allows developers to interact with the Soroban Network using the Python programming language. In this post, we will go over the steps to install Soroban Python SDK on Windows.
1. Install Python
Before we can install the Soroban Python SDK, we need to have Python installed on our Windows computer. In this post, we will install Python via Microsoft Store, since it's easy and simple. Here's how:
- Open the Microsoft Store on your computer.
- Search for "Python" in the search bar.
- Click on the "Python 3.x" option that appears in the search results. (Note: I'm using Python 3.7)
- Click the "Get" button to download and install Python on your computer.
- To verify that Python has been installed correctly, open the command prompt and enter the following command:
python --version
If Python has been installed correctly, you should see the version number, just like in the image above.
2. Install Soroban Python SDK (Stellar Python SDK with Soroban Support)
The Soroban Python SDK that we're going to use is basically the Stellar Python SDK with Soroban support. To install the SDK, we will use the source code from the Stellar Python SDK GitHub but use its Soroban branch. To install, use the following command in the command prompt:
pip install git+https://github.com/StellarCN/py-stellar-base.git@soroban
This will install the Soroban Python SDK and all its dependencies.
3. Verify the installation
To verify that the Soroban Python SDK has been installed correctly, we can write a simple Python script that imports the SDK and prints its version. Open your text editor and create a new file called test.py. Add the following code to the file:
import stellar_sdk
print(stellar_sdk.__version__)
Save the file and run it using the following command in your terminal or command prompt:
python test.py
If the SDK has been installed correctly, you should see the version number printed on the console.
Closing
In this blog post, we have gone over the steps to install the Soroban Python SDK. With the SDK installed, you can start building applications that interact with the Stellar Futurenet (Soroban) network using the Python programming language.
Subscribe to my newsletter
Read articles from Chandra Pratama Ramadhan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by