Skip to main content

Jito Labs Python Searcher Client

Project description

About

PyPI

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

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=}")

Sync Client (No Auth)

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 = "frankfurt.mainnet.block-engine.jito.wtf"

client = get_searcher_client(BLOCK_ENGINE_URL)
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())

Async Client (No Auth)

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

BLOCK_ENGINE_URL = "frankfurt.mainnet.block-engine.jito.wtf"

async def main():
    client = await get_async_searcher_client(BLOCK_ENGINE_URL)
    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

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-0.1.5.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

jito_searcher_client-0.1.5-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file jito_searcher_client-0.1.5.tar.gz.

File metadata

  • Download URL: jito_searcher_client-0.1.5.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for jito_searcher_client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 919eca7fb2cc8587c2bb22a3d5ffcea0d4f0db551553136f64d8be2f04c5f90b
MD5 67a7338e543ae35588c68ebc5abafaf6
BLAKE2b-256 d1678a7beea0f6c2d3eed7a440845a83d299e51544404c93c7f19bec456b6419

See more details on using hashes here.

File details

Details for the file jito_searcher_client-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for jito_searcher_client-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5638d22876b40ca2ca5610c9087c875315e0391197f1b9eaef00db640071c023
MD5 c2e4e2030b208dca221f2393251aead5
BLAKE2b-256 8c15909596ffdf88b6c7ce456cf5c9b4678615683848c119f054f22ecaea89b4

See more details on using hashes here.

Supported by

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