From f78594f39e810028ae93def96364c352c6efab0e Mon Sep 17 00:00:00 2001 From: skynetcap <100323448+skynetcap@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:25:48 -0800 Subject: [PATCH] The README.md and application code have been updated to include instructions and logging for using a specific RPC without having to recompile. This improves usability by allowing users to change the RPC at runtime. Also, added log.info to display the endpoint, this can be helpful in troubleshooting and ensuring correct configuration. --- README.md | 5 ++++- .../java/markets/arcana/obcranker/ObCrankerApplication.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b411d1a..086c114 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,13 @@ ## Building -- Place private key in `main/resources` (JSON/Array format, generated by solana-keygen) +- Place private key (privateKey.json) in `main/resources` (JSON/Array format, generated by solana-keygen) - Set `application.endpoint` (RPC) & `application.privateKey` (file name) in application.properties - `docker build .` ## Running `docker run CONTAINER_NAME` + +## Running w/ Specific RPC (without recompiling) +`docker run -e APPLICATION_ENDPOINT=YOURSOLANA_RPC_HERE CONTAINER_NAME` \ No newline at end of file diff --git a/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java b/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java index 6da495c..4cd30f0 100644 --- a/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java +++ b/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java @@ -49,6 +49,8 @@ public void crankEventHeapLoop() { } Account finalTradingAccount = tradingAccount; + log.info("RPC: {}", endpoint); + scheduler.scheduleAtFixedRate(() -> { try { // SOL/USDC