rpcpool / yellowstone-grpc

solana geyser grpc service
GNU Affero General Public License v3.0
138 stars 62 forks source link

X token #353

Closed obvious123 closed 1 day ago

obvious123 commented 1 month ago

Can someone please tell me what is the X token required by jupiter swap api? The guide there says to run jupiter using this command:

RUST_LOG=info ./jupiter-swap-api --rpc-url --yellowstone-grpc-endpoint --yellowstone-grpc-x-token

the example they publish: https://supersolnode.jup/91842103123091841 --yellowstone-grpc-endpoint https://supersolnode.jup --yellowstone-grpc-x-token 91842103123091841

this is the url for the full guide: https://station.jup.ag/docs/apis/self-hosted

this is my solana.sh:

!/bin/bash

set -e set -u export RUST_LOG=info solana-validator \ --ledger /var/solana/data/ledger \ --accounts /var/solana/accounts \ --identity /var/solana/data/config/validator-keypair.json \ --known-validator 7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2 \ --known-validator GdnSyH3YtwcxFvQrVVJMm1JhTS4QVX7MFsX56uJLUfiZ \ --known-validator DE1bawNcRJB9rVm3buyMVfr8mBEoyyu73NBovf2oXJsJ \ --known-validator CakcnaRDHka2gXyfbEd2d3xsvkJkqsLw2akB3zsN1D2S \ --known-validator 5D1fNXzvv5NjV1ysLjirC4WY92RNsVH18vjmcszZd8on \ --expected-genesis-hash 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d \ --entrypoint entrypoint.mainnet-beta.solana.com:8001 \ --entrypoint entrypoint2.mainnet-beta.solana.com:8001 \ --entrypoint entrypoint3.mainnet-beta.solana.com:8001 \ --entrypoint entrypoint4.mainnet-beta.solana.com:8001 \ --entrypoint entrypoint5.mainnet-beta.solana.com:8001 \ --rpc-port 8899 \ --rpc-bind-address 0.0.0.0 \ --private-rpc \ --dynamic-port-range 8000-8020 \ --wal-recovery-mode skip_any_corrupted_record \ --init-complete-file /var/solana/data/init-completed \ --limit-ledger-size \ --log /home/solana/solana-validator2.log \ --only-known-rpc \ --full-rpc-api \ --no-voting \ --enable-rpc-transaction-history \ --enable-cpi-and-log-storage

this is my yellowstone-grpc-config.json: { "libpath": "../target/debug/libyellowstone_grpc_geyser.so", "log": { "level": "info" }, "grpc": { "tls_config": { "cert_path": "/home/solana/tlscert/certificate.pem", "key_path": "/home/solana/tlscert/key.pem" }, "address": "0.0.0.0:10000", "max_decoding_message_size": "4_194_304", "snapshot_plugin_channel_capacity": null, "snapshot_client_channel_capacity": "50_000_000", "channel_capacity": "100_000", "unary_concurrency_limit": 100, "unary_disabled": false, "filters": { "accounts": { "max": 1, "any": false, "account_max": 10, "account_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "owner_max": 10, "owner_reject": ["11111111111111111111111111111111"] }, "slots": { "max": 1 }, "transactions": { "max": 1, "any": false, "account_include_max": 10, "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "account_exclude_max": 10, "account_required_max": 10 }, "transactions_status": { "max": 1, "any": false, "account_include_max": 10, "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "account_exclude_max": 10, "account_required_max": 10 }, "blocks": { "max": 1, "account_include_max": 10, "account_include_any": false, "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], "include_transactions": true, "include_accounts" : false, "include_entries" : false }, "blocks_meta": { "max": 1 }, "entry": { "max": 1 } } }, "prometheus": { "address": "0.0.0.0:8999" }, "block_fail_action": "log" }

does it means that I need to connect using the jupiter to 8899 or port 10000 like this grpc config says? It will be very helpfull if you can write the full jupiter run command for this configuration.

Lusitaniae commented 1 month ago

try ./jupiter-swap-api --rpc-url localhost:8899 --yellowstone-grpc-endpoint localhost:10000

x-token is for when you're running a web proxy in front of solana and may have some authentication

in this case you running both solana rpc + grpc and jupiter swap locally, so no need

obvious123 commented 1 month ago

Tried, but still error, here's the jupiter log: solana@Solana:~$ sudo docker run --add-host host.docker.internal:host-gateway -p 9700:8080 -it jupiter2 ./jupiter-swap-api --rpc-url http://host.docker.internal:8899 --yellowstone-grpc-endpoint host.docker.internal:10000 [2024-06-02T09:25:47.363747Z INFO jupiter_swap_api] Found 48 logical cores, using 48 for the api [2024-06-02T09:25:47.366739Z INFO jupiter_swap_api] Loading Jupiter router... [2024-06-02T09:26:14.109746Z INFO jupiter_core::amms::loader] markets len(): 78301 [2024-06-02T09:26:15.088124Z INFO jupiter_core::amms::loader] Found 0 not supported markets for owners: {} [2024-06-02T09:26:15.115753Z WARN jupiter_core::amms::loader] Stakedex AMMs where not found in the cache, 274 out of 1482 [2024-06-02T09:26:15.115776Z INFO jupiter_core::amms::loader] New dexes are disabled, ["Clone Protocol", "Sanctum Infinity"] are not loaded [2024-06-02T09:26:15.118545Z INFO jupiter_core::amms::loader] updating amms with account_keys.len(): 62 [2024-06-02T09:26:15.622755Z INFO jupiter_core::amms::loader] Loaded 78044 amms from market cache [2024-06-02T09:26:15.769412Z INFO jupiter_core::amms::loader] AMMS per label loaded: {"GooseFX": 15, "Orca V1": 14, "Sanctum": 274, "Dexlab": 92, "Cropper": 15, "Oasis": 10, "Aldrin": 16, "Saros": 26, "StepN": 3, "Saber": 65, "Saber (Decimals)": 16, "Raydium CLMM": 451, "Lifinity V2": 25, "Raydium CP": 373, "Openbook": 38, "FluxBeam": 1484, "Invariant": 26, "Helium Network": 2, "OpenBook V2": 23, "Bonkswap": 15, "Token Swap": 32, "Perps": 1, "Phoenix": 33, "Penguin": 11, "Orca V2": 114, "Aldrin V2": 25, "Meteora": 1616, "Crema": 8, "Mercurial": 13, "Meteora DLMM": 1160, "Whirlpool": 1619, "Lifinity V1": 2, "Raydium": 70401, "Cropper Legacy": 25, "Marinade": 1} [2024-06-02T09:26:16.173870Z INFO jupiter_core::address_lookup_table_cache] Loading AddressLookupTableCache... [2024-06-02T09:26:16.180030Z INFO jupiter_core::address_lookup_table_cache] Fetching 10261 address lookup tables [2024-06-02T09:26:17.877268Z INFO jupiter_core::address_lookup_table_cache] Update 10259 ALTs into the AddressLookupTableCache in 1.697366647s [2024-06-02T09:26:17.877294Z INFO jupiter_core::router] 78044 amms for 78044 lookup tables [2024-06-02T09:26:20.567880Z INFO jupiter_core::router] Fetched 72830 mints [2024-06-02T09:26:20.769224Z INFO jupiter_core::slippage] Loaded 1276 jupiter strict tokens [2024-06-02T09:26:20.999565Z INFO jupiter_core::router] Perform initial update #1 [2024-06-02T09:26:21.069099Z INFO jupiter_core::router] create key_set: 69.51ms [2024-06-02T09:26:35.683079Z INFO jupiter_core::router] getMA + insert 14.61s [2024-06-02T09:26:36.305463Z ERROR jupiter_core::router] AMM Ex3b4KtP8bZpEYW5EnQDN16bcgSxTHeMetciy8kEoqnw update returns err: Could not find address: Ex3b4KtP8bZpEYW5EnQDN16bcgSxTHeMetciy8kEoqnw [2024-06-02T09:26:36.379343Z INFO jupiter_core::router] update: 696.23ms [2024-06-02T09:26:36.379364Z INFO jupiter_core::router] Perform initial update #2 [2024-06-02T09:26:36.440413Z INFO jupiter_core::router] create key_set: 61.04ms [2024-06-02T09:26:37.756234Z INFO jupiter_core::router] getMA + insert 1.32s [2024-06-02T09:26:38.087059Z INFO jupiter_core::router] update: 330.78ms [2024-06-02T09:26:38.087084Z INFO jupiter_core::router] Perform initial update #3 [2024-06-02T09:26:38.147329Z INFO jupiter_core::router] create key_set: 60.23ms [2024-06-02T09:26:38.430687Z INFO jupiter_core::router] getMA + insert 283.33ms [2024-06-02T09:26:38.545497Z INFO jupiter_core::router] update: 114.77ms [2024-06-02T09:26:39.640354Z INFO jupiter_core::price_tracker] Price tracker updated 72696 prices in 1.094824478s [2024-06-02T09:26:39.642622Z INFO jupiter_swap_api] Started jupiter swap api on 0.0.0.0:8080, in 52.27588421s [2024-06-02T09:26:39.733071Z INFO jupiter_core::geyser_client] geyser_subscribe_accounts_loop start, initial filter with 244451 [2024-06-02T09:26:39.733093Z INFO jupiter_core::geyser_client] chunk size: 81484 [2024-06-02T09:26:39.873057Z INFO jupiter_core::geyser_client] Connect to subscribe to the geyser server [2024-06-02T09:26:40.010541Z INFO jupiter_core::geyser_client] Connect to subscribe to the geyser server [2024-06-02T09:26:40.151652Z INFO jupiter_core::geyser_client] Connect to subscribe to the geyser server [2024-06-02T09:26:40.151750Z ERROR jupiter_core::geyser_client] Geyser grpc client error gRPC status: status: Unknown, message: "transport error", details: [], metadata: MetadataMap { headers: {} } [2024-06-02T09:26:40.151767Z ERROR jupiter_core::geyser_client] Geyser grpc client error gRPC status: status: Unknown, message: "transport error", details: [], metadata: MetadataMap { headers: {} } [2024-06-02T09:26:40.154003Z ERROR jupiter_core::geyser_client] Geyser grpc client error gRPC status: status: Unknown, message: "transport error", details: [], metadata: MetadataMap { headers: {} } [2024-06-02T09:26:40.745702Z INFO jupiter_core::geyser_client] Retry to connect to subscribe to the geyser server [2024-06-02T09:26:40.745787Z INFO jupiter_core::geyser_client] Retry to connect to subscribe to the geyser server [2024-06-02T09:26:40.745803Z INFO jupiter_core::geyser_client] Retry to connect to subscribe to the geyser server [2024-06-02T09:26:40.746013Z ERROR jupiter_core::geyser_client] Geyser grpc client error gRPC status: status: Unknown, message: "transport error", details: [], metadata: MetadataMap { headers: {} } [2024-06-02T09:26:40.746042Z ERROR jupiter_core::geyser_client] Geyser grpc client error gRPC status: status: Unknown, message: "transport error", details: [], metadata: MetadataMap { headers: {} } [2024-06-02T09:26:40.746064Z ERROR jupiter_core::geyser_client] Geyser grpc client error gRPC status: status: Unknown, message: "transport error", details: []

I can also confirm that running the following command works: sudo docker run --add-host host.docker.internal:host-gateway -p 9700:8080 -it jupiter2 ./jupiter-swap-api --rpc-url http://host.docker.internal:8899

but it's not with the grpc plugin, I can also confirm that port 10000 listening by solana-validator.

Juanito87 commented 1 month ago

Try to remove the tls config on the grpc config. Also, ensure that your grpc plugin is running properly. These repo is for grpc, not for the swap api. In order for the swap api you need to have a working solana rpc endpoint and a grpc endpoint.