76: Introduce the Nenjim component registry and move runtime composition into its manager
This commit is contained in:
+18
-15
@@ -4,10 +4,11 @@ The Jupiter Perps Price Alarm monitors the Jupiter Perps aggregated oracle accou
|
||||
|
||||
Oracle prices are received through Solana WebSocket `accountSubscribe` using `processed` commitment. The application does not poll prices once per second. It also fetches the current oracle account state whenever a WebSocket connection opens, reconnects automatically, and supports multiple RPC endpoints for redundancy.
|
||||
|
||||
The alarm is currently initialized and started by `NenjimHubImpl`. Its
|
||||
`SolanaWallet` and `JupiterPerpsService` are selected by the Hub and injected
|
||||
before startup. The alarm action configuration files do not select a wallet or
|
||||
signing key.
|
||||
The Registry service manager currently constructs and registers the alarm as
|
||||
`jupiter-perps-alarm.default`, but deliberately does not start it. Its
|
||||
`SolanaWallet` and `JupiterPerpsService` are selected by the manager's hardcoded
|
||||
composition and injected before registration. The alarm action configuration
|
||||
files do not select a wallet or signing key.
|
||||
|
||||
> **Important:** This application is not necessarily notification-only. Every active entry in a Jupiter Perps position action file can sign and submit a real transaction. Review both transaction action files before running it.
|
||||
|
||||
@@ -56,27 +57,29 @@ There is currently no alarm-specific automated self-test task.
|
||||
|
||||
## Running through Nenjim
|
||||
|
||||
The alarm no longer has a standalone `main` method. `NenjimHubImpl` constructs
|
||||
the wallet, Jupiter service and alarm, then starts the alarm as part of normal
|
||||
Hub startup. Run the configured application with:
|
||||
The alarm no longer has a standalone `main` method. The Registry service
|
||||
manager constructs and registers the wallet, Jupiter service and alarm, but the
|
||||
alarm is intentionally absent from the current explicit application startup
|
||||
list. Running the Hub therefore leaves the registered alarm inactive:
|
||||
|
||||
```bash
|
||||
./gradlew run
|
||||
```
|
||||
|
||||
After `./gradlew prepareLibs`, it can also be started explicitly with the Nenjim
|
||||
Hub main class:
|
||||
After `./gradlew prepareLibs`, the same Registry-managed Hub can be invoked with
|
||||
its main class (the alarm still remains inactive):
|
||||
|
||||
```bash
|
||||
java --enable-preview \
|
||||
-cp "build/libs/*" \
|
||||
com.r35157.nenjim.hubd.impl.ref.Main
|
||||
com.r35157.nenjim.hubd.Main
|
||||
```
|
||||
|
||||
The current Hub composition binds the alarm to `conf/alarms.conf` and to the
|
||||
The current manager composition binds the alarm to `conf/alarms.conf` and to the
|
||||
test Jupiter Perps wallet and service. Until Nenjim provides configured
|
||||
injection, a different configuration or wallet must be selected in the Hub's
|
||||
composition code, not in an alarm action file.
|
||||
injection and activation, a different configuration, wallet, or startup choice
|
||||
must be selected in the Registry manager's composition code, not in an alarm
|
||||
action file.
|
||||
|
||||
The repository contains example files for the alarm configuration and every
|
||||
action configuration. The real `conf/*.conf` files are ignored by Git; keep
|
||||
@@ -84,8 +87,8 @@ credentials and operational details out of version control.
|
||||
|
||||
### Environment variables
|
||||
|
||||
The Hub does not currently forward alarm-specific command-line options. Solana
|
||||
WebSocket endpoints can be overridden with:
|
||||
The Registry manager does not currently forward alarm-specific command-line
|
||||
options. Solana WebSocket endpoints can be overridden with:
|
||||
|
||||
```bash
|
||||
export SOLANA_WS_URLS='wss://first-provider.example,wss://second-provider.example'
|
||||
|
||||
Reference in New Issue
Block a user