Jito Labs Geyser Client
Project description
About
This library contains python code to interact with Jito's Geyser Plugin.
Downloading
$ pip install jito_geyser
Access Token
Please request access to geyser by emailing support@jito.wtf
Examples
Printing slot updates
from grpc import ssl_channel_credentials, secure_channel
from jito_geyser.generated.geyser_pb2 import SubscribeSlotUpdateRequest
from jito_geyser.generated.geyser_pb2_grpc import GeyserStub
GEYSER_URL = "mainnet.rpc.jito.wtf"
ACCESS_TOKEN = "ACCESS_TOKEN_HERE"
channel = secure_channel(GEYSER_URL, ssl_channel_credentials())
client = GeyserStub(channel)
for msg in client.SubscribeSlotUpdates(SubscribeSlotUpdateRequest(), metadata=[("access-token", ACCESS_TOKEN)]):
print(msg)
Listening to program account updates
This example listens to pyth-owned accounts
from grpc import ssl_channel_credentials, secure_channel
from solders.pubkey import Pubkey # note: probably need to install solders for this import
from jito_geyser.generated.geyser_pb2 import SubscribeProgramsUpdatesRequest
from jito_geyser.generated.geyser_pb2_grpc import GeyserStub
GEYSER_URL = "mainnet.rpc.jito.wtf"
ACCESS_TOKEN = "ACCESS_TOKEN_HERE"
ACCOUNTS = [bytes(Pubkey.from_string("FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH"))]
channel = secure_channel(GEYSER_URL, ssl_channel_credentials())
client = GeyserStub(channel)
for msg in client.SubscribeProgramUpdates(SubscribeProgramsUpdatesRequest(programs=ACCOUNTS), metadata=[("access-token", ACCESS_TOKEN)]):
print(msg)
Functions available
- There are many functions available including:
- GetHeartbeatInterval
- SubscribeAccountUpdates
- SubscribeProgramUpdates
- SubscribePartialAccountUpdates
- SubscribeSlotUpdates
- SubscribeTransactionUpdates
- SubscribeBlockUpdates
Development
Install pip
$ curl -sSL https://bootstrap.pypa.io/get-pip.py | python 3 -
Install poetry
$ curl -sSL https://install.python-poetry.org | python3 -
Setup environment and build protobufs
$ poetry install
$ poetry shell
$ poetry protoc
Linting
$ poetry run black .
$ poetry run isort .
Publishing package
$ poetry protoc && poetry build && poetry publish
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jito_geyser-0.1.0.tar.gz
(18.4 kB
view hashes)
Built Distribution
Close
Hashes for jito_geyser-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28fd93579d9b7a3c0cb774d51d59cd5bcc13aad8c9ac5dc1898251270a82a453 |
|
MD5 | 3703dd09fb2a5520a27e26846d6c9d1b |
|
BLAKE2b-256 | fa536c259cb254b89379c91693cc46689ccc119b5d3f4bba65486fe2a65ad4f4 |