Skip to content

menarulalam/solana-py

 
 

Repository files navigation

Actions Status PyPI version License: MIT Code style: black

Solana.py

Solana Python API built on the JSON RPC API.

Python version of solana-web3.js for interacting with Solana.

Read the Documentation.

Quickstart

Installation

pip install solana

General Usage

import solana

API Client

from solana.rpc.api import HTTP, WEBSOCKET, Client

http_client = Client(endpoint="https://devnet.solana.com", client_type=HTTP)
websocket_client = Client(endpoint="ws://localhost:8900", client_type=WEBSOCKET)

Development

Setup

  1. Install pipenv.
brew install pipenv
  1. Install dev dependencies.
pipenv install --dev
  1. Activate the pipenv shell.
pipenv shell

Lint

make lint

Tests

# All tests
make tests
# Unit tests only
make unit-tests
# Integration tests only
make int-tests

Start a Solana Localnet

Install docker.

# Update/pull latest docker image
pipenv run update-localnet
# Start localnet instance
pipenv run start-localnet

Using Jupyter Notebook

make notebook

Releases

No releases published

Packages

No packages published

Languages

  • Python 70.5%
  • Jupyter Notebook 27.2%
  • Shell 1.6%
  • Makefile 0.7%