README
ΒΆ
Jito Go SDK
This library contains tooling to interact with Jito Labs software.
We currently use gagliardetto/solana-go to interact with Solana. PRs and contributions are welcome.
βοΈ Contents
- Support
- Features
- ToDo
- Methods
- Installing
- Update Proto
- Keypair Authentication
- Examples
- Common errors
- Disclaimer
- License
π Support
If my work has been useful in building your for-profit services/infra/bots/etc, consider donating at
ACPc147BD5SE7Rh2HKLED7nLWJyiNNHM8ruyGNHqcE8U
(Solana address).
β¨ Features
- Searcher
- Block Engine
- Relayer
- Geyser π³
- Shredstream
- JSON RPC API
- Others
- API
π ToDo
- tbd
π‘ Methods
-
π* methods which are deprecated by Jito
-
most methods have wrappers for ease of use
-
both gRPC and JSON-RPC methods are supported
-
Searcher
SubscribeMempoolAccounts
πSubscribeMempoolPrograms
πGetNextScheduledLeader
GetRegions
GetConnectedLeaders
GetConnectedLeadersRegioned
GetTipAccounts
SimulateBundle
SendBundle
(gRPC & JSON-RPC)SendBundleWithConfirmation
(gRPC & JSON-RPC)SubscribeBundleResults
GetBundleStatuses
(gRPC & JSON-RPC)
-
Block Engine
- Validator
SubscribePackets
SubscribeBundles
GetBlockBuilderFeeInfo
- Relayer
SubscribeAccountsOfInterest
SubscribeProgramsOfInterest
StartExpiringPacketStream
- Validator
-
ShredStream
SendHeartbeat
-
Others (pkg/util.go & pkg/convert.go)
SubscribeTipStream
- Converting functions
-
API (api/api.go)
RetrieveRecentBundles
RetrieveBundleIDfromTransactionSignature
πΎ Installing
Go 1.22.0 or higher.
go get github.com/weeaa/jito-go@latest
If you want to run tests:
- Install Task.
- Initialize your
.env
file by runningtask install:<os>
(darwin/linux/windows). - Run tests with
task test
.
π Update Proto
π¨ Beware that due to duplicate types from jito proto files it will cause an error when building, this issue has been submitted to the team. π¨
In order to get latest proto generated files, make sure you have protobuf & its plugins installed!
Using Homebrew (macOS).
brew install protobuf
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Edit perms.
chmod +x ./scripts/generate_protos.sh
Run script.
./scripts/generate_protos.sh
π Keypair Authentication
The following isn't mandatory anymore for Searcher access.
To access Jito MEV functionalities, you'll need a whitelisted Public Key obtained from a fresh KeyPair; submit your Public Key here.
In order to generate a new KeyPair, you can use the following function GenerateKeypair()
from the /pkg
package.
π» Examples
π₯ Common errors
The supplied pubkey is not authorized to generate a token.
The public key you supplied is not whitelisted by Jito, you may either use NewNoAuth
instead of New
to authenticate, or apply for whitelist here.
π¨ Disclaimer
This library is not affiliated with Jito Labs. It is a community project and is not officially supported by Jito Labs. Use at your own risk.
π License
Documentation
ΒΆ
Index ΒΆ
Constants ΒΆ
const JitoMainnet = "mainnet.rpc.jito.wtf"
Variables ΒΆ
var Amsterdam = JitoEndpoints["AMS"]
var Frankfurt = JitoEndpoints["FFM"]
var JitoEndpoints = map[string]JitoEndpointInfo{ "AMS": { Region: "amsterdam", BlockEngineURL: "amsterdam.mainnet.block-engine.jito.wtf:443", RelayerURL: "amsterdam.mainnet.relayer.jito.wtf:8100", ShredReceiverAddr: "74.118.140.240:1002", Ntp: "ntp.amsterdam.jito.wtf", }, "FFM": { Region: "frankfurt", BlockEngineURL: "frankfurt.mainnet.block-engine.jito.wtf:443", RelayerURL: "frankfurt.mainnet.relayer.jito.wtf:8100", ShredReceiverAddr: "145.40.93.84:1002", Ntp: "ntp.frankfurt.jito.wtf", }, "NY": { Region: "ny", BlockEngineURL: "ny.mainnet.block-engine.jito.wtf:443", RelayerURL: "ny.mainnet.relayer.jito.wtf:8100", ShredReceiverAddr: "141.98.216.96:1002", Ntp: "ntp.dallas.jito.wtf", }, "SLC": { Region: "slc", BlockEngineURL: "slc.mainnet.block-engine.jito.wtf:443", RelayerURL: "slc.mainnet.relayer.jito.wtf:8100", ShredReceiverAddr: "64.130.53.8:1002", }, "TKY": { Region: "tokyo", BlockEngineURL: "tokyo.mainnet.block-engine.jito.wtf:443", RelayerURL: "tokyo.mainnet.relayer.jito.wtf:8100", ShredReceiverAddr: "202.8.9.160:1002", Ntp: "ntp.tokyo.jito.wtf", }, "BigD-TESTNET": { BlockEngineURL: "dallas.testnet.block-engine.jito.wtf:443", RelayerURL: "dallas.testnet.relayer.jito.wtf:8100", ShredReceiverAddr: "147.28.154.132:1002", Ntp: "ntp.dallas.jito.wtf", }, "NY-TESTNET": { BlockEngineURL: "ny.testnet.block-engine.jito.wtf:443", RelayerURL: "nyc.testnet.relayer.jito.wtf:8100", ShredReceiverAddr: "141.98.216.97:1002", Ntp: "ntp.dallas.jito.wtf", }, }
var MainnetMerkleUploadAuthorityProgram = solana.MustPublicKeyFromBase58("GZctHpWXmsZC1YHACTGGcHhYxjdRqQvTpYkb9LMvxDib")
var MainnetTipAccounts = []solana.PublicKey{
solana.MustPublicKeyFromBase58("96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5"),
solana.MustPublicKeyFromBase58("HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe"),
solana.MustPublicKeyFromBase58("Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY"),
solana.MustPublicKeyFromBase58("ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49"),
solana.MustPublicKeyFromBase58("DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh"),
solana.MustPublicKeyFromBase58("ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt"),
solana.MustPublicKeyFromBase58("DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"),
solana.MustPublicKeyFromBase58("3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT"),
}
var MainnetTipDistributionProgram = solana.MustPublicKeyFromBase58("4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7")
var MainnetTipPaymentProgram = solana.MustPublicKeyFromBase58("T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt")
var NewYork = JitoEndpoints["NY"]
var SaltLakeCity = JitoEndpoints["SLC"]
var TestnetDallas = JitoEndpoints["BigD-TESTNET"]
var TestnetMerkleUploadAuthorityProgram = solana.MustPublicKeyFromBase58("GZctHpWXmsZC1YHACTGGcHhYxjdRqQvTpYkb9LMvxDib")
var TestnetNewYork = JitoEndpoints["NY-TESTNET"]
var TestnetTipAccounts = []solana.PublicKey{
solana.MustPublicKeyFromBase58("B1mrQSpdeMU9gCvkJ6VsXVVoYjRGkNA7TtjMyqxrhecH"),
solana.MustPublicKeyFromBase58("aTtUk2DHgLhKZRDjePq6eiHRKC1XXFMBiSUfQ2JNDbN"),
solana.MustPublicKeyFromBase58("E2eSqe33tuhAHKTrwky5uEjaVqnb2T9ns6nHHUrN8588"),
solana.MustPublicKeyFromBase58("4xgEmT58RwTNsF5xm2RMYCnR1EVukdK8a1i2qFjnJFu3"),
solana.MustPublicKeyFromBase58("EoW3SUQap7ZeynXQ2QJ847aerhxbPVr843uMeTfc9dxM"),
solana.MustPublicKeyFromBase58("ARTtviJkLLt6cHGQDydfo1Wyk6M4VGZdKZ2ZhdnJL336"),
solana.MustPublicKeyFromBase58("9n3d1K5YD2vECAbRFhFFGYNNjiXtHXJWn9F31t89vsAV"),
solana.MustPublicKeyFromBase58("9ttgPBBhRYFuQccdR1DSnb7hydsWANoDsV3P9kaGMCEh"),
}
var TestnetTipDistributionProgram = solana.MustPublicKeyFromBase58("F2Zu7QZiTYUhPd7u9ukRVwxh7B71oA3NMJcHuCHc29P2")
var TestnetTipPaymentProgram = solana.MustPublicKeyFromBase58("DCN82qDxJAQuSqHhv2BJuAgi41SPeKZB5ioBCTMNDrCC")
var Tokyo = JitoEndpoints["TKY"]
Functions ΒΆ
This section is empty.