Skip to main content

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

Basic access(5 req/second per region) no longer requires approval. Please visit our Discord dev channel, if you have other questions. If your application requires higher rate limits, please complete this form

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

BLOCK_ENGINE_URL = "nyc.testnet.block-engine.jito.wtf"

kp = None
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


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_no_auth-0.1.6.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jito_searcher_client_no_auth-0.1.6-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file jito_searcher_client_no_auth-0.1.6.tar.gz.

File metadata

File hashes

Hashes for jito_searcher_client_no_auth-0.1.6.tar.gz
Algorithm Hash digest
SHA256 dd8f6d14cb6ed4a2771321f698f1155d83e709b1d41a7f0d26070954eda5b454
MD5 06ac3fd9b08a8fd5c4b381a509a8249e
BLAKE2b-256 e8224dc9d6da26232af872c1b0f9fd060265790c780e08a87cc17b9c3d19e5c9

See more details on using hashes here.

File details

Details for the file jito_searcher_client_no_auth-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for jito_searcher_client_no_auth-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 92e00eda5e1dba3a76476aa7b429cbf273690ca56c2ecd3f0849ae71bc3e9292
MD5 c9ba3506341a7f0ab84c64c826f936d0
BLAKE2b-256 2b1d2d58c5458e5a677671cd7b14965fa0e001f91cf591bbeceff34d7c2bfd91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page