Solana Python API built on the JSON RPC API.
Python version of solana-web3.js for interacting with Solana.
Read the Documentation.
pip install solanaimport solanafrom 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)- Install pipenv.
brew install pipenv- Install dev dependencies.
pipenv install --dev- Activate the pipenv shell.
pipenv shellmake lint# All tests
make tests
# Unit tests only
make unit-tests
# Integration tests only
make int-testsInstall docker.
# Update/pull latest docker image
pipenv run update-localnet
# Start localnet instance
pipenv run start-localnetmake notebook