синхронизация с солана
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
Нужно также добавить в существующий AppConfig:
|
||||
|
||||
public String rpcUrl() {
|
||||
String host = switch (network) {
|
||||
case "devnet" -> "https://devnet.helius-rpc.com/";
|
||||
case "mainnet" -> "https://mainnet.helius-rpc.com/";
|
||||
default -> throw new IllegalStateException("Unsupported network: " + network);
|
||||
};
|
||||
return host + "?api-key=" + heliusApiKey;
|
||||
}
|
||||
|
||||
И в HeliusWebSocketClient:
|
||||
|
||||
1. Поле:
|
||||
private final CompletableFuture<Void> subscribed = new CompletableFuture<>();
|
||||
|
||||
2. Метод:
|
||||
public CompletableFuture<Void> subscribedFuture() {
|
||||
return subscribed;
|
||||
}
|
||||
|
||||
3. В обработчике успешной подписки после лога:
|
||||
subscribed.complete(null);
|
||||
Reference in New Issue
Block a user