mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 07:24:23 +01:00
proof of concept: log node alias, pubkey, block height
This commit is contained in:
@@ -2,7 +2,9 @@ package de.cotto.lndmanagej;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
public static void main(String[] arguments) {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package de.cotto.lndmanagej;
|
||||
|
||||
import de.cotto.lndmanagej.grpc.GrpcGetInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class InfoLogger {
|
||||
private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
private final GrpcGetInfo grpcGetInfo;
|
||||
|
||||
public InfoLogger(GrpcGetInfo grpcGetInfo) {
|
||||
this.grpcGetInfo = grpcGetInfo;
|
||||
}
|
||||
|
||||
@Scheduled(fixedRate = 60_000)
|
||||
public void logAlias() {
|
||||
logger.info("Alias: {}", grpcGetInfo.getAlias());
|
||||
}
|
||||
|
||||
@Scheduled(fixedRate = 60_000)
|
||||
public void logPubkey() {
|
||||
logger.info("Pubkey: {}", grpcGetInfo.getPubkey());
|
||||
}
|
||||
|
||||
@Scheduled(fixedRate = 5_000)
|
||||
public void logBlockHeight() {
|
||||
logger.info("Block Height: {}", grpcGetInfo.getBlockHeight());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user