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

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


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 details)

Uploaded Source

Built Distribution

jito_searcher_client-0.1.2-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jito_searcher_client-0.1.2.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.8 Darwin/21.6.0

File hashes

Hashes for jito_searcher_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fa285d4e8e0d7f520edd4668c5389cae96247fbf4b661d5966156584ede8f118
MD5 46a269247b16e0c77c308e4d067e4ec3
BLAKE2b-256 6501c74a5ebfeeb23eb7851d378ec20f20125337fd9fb521a6ee24f63a752d4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jito_searcher_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a493588e3d3f18fd0ae98e77b0bfa6cc7ab7fa495aca9be64424d29e47fc2935
MD5 998047de523676be1bd8421180d6ac9a
BLAKE2b-256 ca3e016c9dffebd79c264d65650e0850f10d56ab02c35458983150fee93e5ef4

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