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
Built Distribution
File details
Details for the file jito_searcher_client-0.1.4.tar.gz
.
File metadata
- Download URL: jito_searcher_client-0.1.4.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 498d29aeaa1f520218f5e3859b03a8a0048e96566c13dfa545dbaeb36b57c5fa |
|
MD5 | 8fedcee30a314a43c1969f1f08dfaa66 |
|
BLAKE2b-256 | 9f6ddef7bd38295232a29f105db6585425ff3f132a59ad1fc6dafb12ce4bef7f |
File details
Details for the file jito_searcher_client-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: jito_searcher_client-0.1.4-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e65778f5519dcdbd9066b9f81130e840e25f63f65176d964efdeae813dd406 |
|
MD5 | a32e97707615d3caddd3d8a633718bc7 |
|
BLAKE2b-256 | 62f8d9e36746952ab9bbd8aa5b9aed17bbb114b175fe7c96fd68163dcd0942ae |