配置Yellowstone gRPC插件

更新于2024/12/15

Yellowstone gRPC插件数据流服务支持数据订阅和过滤,相比与普通的rpc请求可以更快速的获取链上数据。本文教你如何在自建rpc上安装geyser插件,结合上部分的RPC节点搭建教程,只需要下载和配置geyser文件和在启动参数中添加geyser配置文件路径。

下载Yellowstone gRPC插件

根据自己solana-cli的版本在官方仓库找到对应版本,此处的solana-cli版本为2.0.18

wget https://github.com/rpcpool/yellowstone-grpc/releases/download/v3.0.0%2Bsolana.2.0.18/yellowstone-grpc-geyser-release22-x86_64-unknown-linux-gnu.tar.bz2

apt-get install bzip2

tar -xvjf yellowstone-grpc-geyser-release22-x86_64-unknown-linux-gnu.tar.bz2

配置

vim yellowstone-config.json
{
    "libpath": "/root/yellowstone-grpc-geyser-release/lib/libyellowstone_grpc_geyser.so",
    "log": {
        "level": "info"
    },
    "grpc": {
        "address": "0.0.0.0:10001",
        "max_decoding_message_size": "8_388_608",
        "snapshot_plugin_channel_capacity": null,
        "snapshot_client_channel_capacity": "50_000_000",
        "channel_capacity": "200_000",
        "unary_concurrency_limit": 1000,
        "unary_disabled": false,
        "filters": {
            "accounts": {
                "max": 100,
                "any": false,
                "account_max": 100,
                "account_reject": [
                    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                ],
                "owner_max": 10,
                "owner_reject": [
                    "11111111111111111111111111111111"
                ]
            },
            "slots": {
                "max": 1
            },
            "transactions": {
                "max": 100,
                "any": false,
                "account_include_max": 100,
                "account_include_reject": [
                    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                ],
                "account_exclude_max": 100,
                "account_required_max": 100
            },
            "transactions_status": {
                "max": 100,
                "any": false,
                "account_include_max": 100,
                "account_include_reject": [
                    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                ],
                "account_exclude_max": 100,
                "account_required_max": 100
            },
            "blocks": {
                "max": 1,
                "account_include_max": 100,
                "account_include_any": false,
                "account_include_reject": [
                    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                ],
                "include_transactions": true,
                "include_accounts": false,
                "include_entries": false
            },
            "blocks_meta": {
                "max": 1
            },
            "entries": {
                "max": 1
            }
        }
    }
}

检查配置

启用

参照先前的solana rpc节点启动脚本,需要在脚本中添加配置文件的位置

完整的启动脚本如下

一些使用教程

最后更新于