Jito Labs Python Searcher Client
Project description
About
This library contains tooling to interact with Jito Lab's Block Engine as a searcher.
Downloading
$ pip install jito_searcher_client
Keypair Authentication
Please request access to the block engine by creating a solana keypair and emailing the public key to support@jito.wtf.
Examples
Sync Client
from jito_searcher_client import get_searcher_client
from jito_searcher_client.generated.searcher_pb2 import ConnectedLeadersRequest
from solders.keypair import Keypair
KEYPAIR_PATH = "/path/to/authenticated/keypair.json"
BLOCK_ENGINE_URL = "frankfurt.mainnet.block-engine.jito.wtf"
with open(KEYPAIR_PATH) as kp_path:
kp = Keypair.from_json(kp_path.read())
client = get_searcher_client(BLOCK_ENGINE_URL, kp)
leaders = client.GetConnectedLeaders(ConnectedLeadersRequest())
print(f"{leaders=}")
Async Client
import asyncio
from jito_searcher_client import get_async_searcher_client
from jito_searcher_client.generated.searcher_pb2 import ConnectedLeadersRequest
from solders.keypair import Keypair
KEYPAIR_PATH = "/path/to/authenticated/keypair.json"
BLOCK_ENGINE_URL = "frankfurt.mainnet.block-engine.jito.wtf"
async def main():
with open(KEYPAIR_PATH) as kp_path:
kp = Keypair.from_json(kp_path.read())
client = await get_async_searcher_client(BLOCK_ENGINE_URL, kp)
leaders = await client.GetConnectedLeaders(ConnectedLeadersRequest())
print(f"{leaders=}")
asyncio.run(main())
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 .
Linting:
poetry run isort .
poetry run black .
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_searcher_client-0.1.3.tar.gz
(24.5 kB
view hashes)
Built Distribution
Close
Hashes for jito_searcher_client-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2b5f10d0d558c4ac31eaefdb49282077faf4b3af425dd14274e91db054184c |
|
MD5 | 48c9e1f3a9539b922925899f7f00e69d |
|
BLAKE2b-256 | e4e7470d4ab0017926dc71e9ebe24ce662087f534732bbbaf49a1825a9d9e401 |
Close
Hashes for jito_searcher_client-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc88ff179259860903d83fe26a4425380ae15be691b1b6650563a446e164ecf |
|
MD5 | 79fde6b503fb66da451f265f1a43f5fe |
|
BLAKE2b-256 | b047ba6d544d35e5d209bf99675d03cd94f35b323ee5669079844d08beb9df5a |