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.2.tar.gz
(25.0 kB
view hashes)
Built Distribution
Close
Hashes for jito_searcher_client-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa285d4e8e0d7f520edd4668c5389cae96247fbf4b661d5966156584ede8f118 |
|
MD5 | 46a269247b16e0c77c308e4d067e4ec3 |
|
BLAKE2b-256 | 6501c74a5ebfeeb23eb7851d378ec20f20125337fd9fb521a6ee24f63a752d4b |
Close
Hashes for jito_searcher_client-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a493588e3d3f18fd0ae98e77b0bfa6cc7ab7fa495aca9be64424d29e47fc2935 |
|
MD5 | 998047de523676be1bd8421180d6ac9a |
|
BLAKE2b-256 | ca3e016c9dffebd79c264d65650e0850f10d56ab02c35458983150fee93e5ef4 |