jito-geyser


Namejito-geyser JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryJito Labs Geyser Client
upload_time2023-01-31 01:08:48
maintainer
docs_urlNone
authorJito Labs
requires_python>=3.10,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # About
This library contains python code to interact with [Jito's Geyser Plugin](https://github.com/jito-foundation/geyser-grpc-plugin).

# Downloading
```bash
$ pip install jito_geyser
```

# Access Token
Please request access to geyser by emailing support@jito.wtf

# Examples

### Printing slot updates
```python
from grpc import ssl_channel_credentials, secure_channel

from jito_geyser.generated.geyser_pb2 import SubscribeSlotUpdateRequest
from jito_geyser.generated.geyser_pb2_grpc import GeyserStub

GEYSER_URL = "mainnet.rpc.jito.wtf"
ACCESS_TOKEN = "ACCESS_TOKEN_HERE"

channel = secure_channel(GEYSER_URL, ssl_channel_credentials())
client = GeyserStub(channel)
for msg in client.SubscribeSlotUpdates(SubscribeSlotUpdateRequest(), metadata=[("access-token", ACCESS_TOKEN)]):
    print(msg)
```

### Listening to program account updates
This example listens to pyth-owned accounts
```python
from grpc import ssl_channel_credentials, secure_channel
from solders.pubkey import Pubkey # note: probably need to install solders for this import

from jito_geyser.generated.geyser_pb2 import SubscribeProgramsUpdatesRequest
from jito_geyser.generated.geyser_pb2_grpc import GeyserStub

GEYSER_URL = "mainnet.rpc.jito.wtf"
ACCESS_TOKEN = "ACCESS_TOKEN_HERE"
ACCOUNTS = [bytes(Pubkey.from_string("FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH"))]

channel = secure_channel(GEYSER_URL, ssl_channel_credentials())
client = GeyserStub(channel)
for msg in client.SubscribeProgramUpdates(SubscribeProgramsUpdatesRequest(programs=ACCOUNTS), metadata=[("access-token", ACCESS_TOKEN)]):
    print(msg)
```

### Functions available
- There are many functions available including:
  - GetHeartbeatInterval
  - SubscribeAccountUpdates
  - SubscribeProgramUpdates
  - SubscribePartialAccountUpdates
  - SubscribeSlotUpdates
  - SubscribeTransactionUpdates
  - SubscribeBlockUpdates

# Development

Install pip
```bash
$ curl -sSL https://bootstrap.pypa.io/get-pip.py | python 3 -
```

Install poetry
```bash
$ curl -sSL https://install.python-poetry.org | python3 -
```

Setup environment and build protobufs
```bash
$ poetry install
$ poetry shell
$ poetry protoc
```

Linting
```bash
$ poetry run black .
$ poetry run isort .
```

Publishing package
```bash
$ poetry protoc && poetry build && poetry publish
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "jito-geyser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jito Labs",
    "author_email": "support@jito.wtf",
    "download_url": "https://files.pythonhosted.org/packages/39/97/a841bf2dcdae71df28d02605381a0085080ce1976717c4c63093e6a580dd/jito_geyser-0.1.0.tar.gz",
    "platform": null,
    "description": "# About\nThis library contains python code to interact with [Jito's Geyser Plugin](https://github.com/jito-foundation/geyser-grpc-plugin).\n\n# Downloading\n```bash\n$ pip install jito_geyser\n```\n\n# Access Token\nPlease request access to geyser by emailing support@jito.wtf\n\n# Examples\n\n### Printing slot updates\n```python\nfrom grpc import ssl_channel_credentials, secure_channel\n\nfrom jito_geyser.generated.geyser_pb2 import SubscribeSlotUpdateRequest\nfrom jito_geyser.generated.geyser_pb2_grpc import GeyserStub\n\nGEYSER_URL = \"mainnet.rpc.jito.wtf\"\nACCESS_TOKEN = \"ACCESS_TOKEN_HERE\"\n\nchannel = secure_channel(GEYSER_URL, ssl_channel_credentials())\nclient = GeyserStub(channel)\nfor msg in client.SubscribeSlotUpdates(SubscribeSlotUpdateRequest(), metadata=[(\"access-token\", ACCESS_TOKEN)]):\n    print(msg)\n```\n\n### Listening to program account updates\nThis example listens to pyth-owned accounts\n```python\nfrom grpc import ssl_channel_credentials, secure_channel\nfrom solders.pubkey import Pubkey # note: probably need to install solders for this import\n\nfrom jito_geyser.generated.geyser_pb2 import SubscribeProgramsUpdatesRequest\nfrom jito_geyser.generated.geyser_pb2_grpc import GeyserStub\n\nGEYSER_URL = \"mainnet.rpc.jito.wtf\"\nACCESS_TOKEN = \"ACCESS_TOKEN_HERE\"\nACCOUNTS = [bytes(Pubkey.from_string(\"FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH\"))]\n\nchannel = secure_channel(GEYSER_URL, ssl_channel_credentials())\nclient = GeyserStub(channel)\nfor msg in client.SubscribeProgramUpdates(SubscribeProgramsUpdatesRequest(programs=ACCOUNTS), metadata=[(\"access-token\", ACCESS_TOKEN)]):\n    print(msg)\n```\n\n### Functions available\n- There are many functions available including:\n  - GetHeartbeatInterval\n  - SubscribeAccountUpdates\n  - SubscribeProgramUpdates\n  - SubscribePartialAccountUpdates\n  - SubscribeSlotUpdates\n  - SubscribeTransactionUpdates\n  - SubscribeBlockUpdates\n\n# Development\n\nInstall pip\n```bash\n$ curl -sSL https://bootstrap.pypa.io/get-pip.py | python 3 -\n```\n\nInstall poetry\n```bash\n$ curl -sSL https://install.python-poetry.org | python3 -\n```\n\nSetup environment and build protobufs\n```bash\n$ poetry install\n$ poetry shell\n$ poetry protoc\n```\n\nLinting\n```bash\n$ poetry run black .\n$ poetry run isort .\n```\n\nPublishing package\n```bash\n$ poetry protoc && poetry build && poetry publish\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Jito Labs Geyser Client",
    "version": "0.1.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa536c259cb254b89379c91693cc46689ccc119b5d3f4bba65486fe2a65ad4f4",
                "md5": "3703dd09fb2a5520a27e26846d6c9d1b",
                "sha256": "28fd93579d9b7a3c0cb774d51d59cd5bcc13aad8c9ac5dc1898251270a82a453"
            },
            "downloads": -1,
            "filename": "jito_geyser-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3703dd09fb2a5520a27e26846d6c9d1b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 22120,
            "upload_time": "2023-01-31T01:08:46",
            "upload_time_iso_8601": "2023-01-31T01:08:46.218555Z",
            "url": "https://files.pythonhosted.org/packages/fa/53/6c259cb254b89379c91693cc46689ccc119b5d3f4bba65486fe2a65ad4f4/jito_geyser-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3997a841bf2dcdae71df28d02605381a0085080ce1976717c4c63093e6a580dd",
                "md5": "76102071fee23ef6bd124506109f12b5",
                "sha256": "db1e6a2c1b7e178edfe9767e1da62080b3315e9fead9f6a51f3b7e9603da0b2a"
            },
            "downloads": -1,
            "filename": "jito_geyser-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "76102071fee23ef6bd124506109f12b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 18364,
            "upload_time": "2023-01-31T01:08:48",
            "upload_time_iso_8601": "2023-01-31T01:08:48.139482Z",
            "url": "https://files.pythonhosted.org/packages/39/97/a841bf2dcdae71df28d02605381a0085080ce1976717c4c63093e6a580dd/jito_geyser-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-31 01:08:48",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "jito-geyser"
}
        
Elapsed time: 0.05277s