File tree Expand file tree Collapse file tree 6 files changed +18
-7
lines changed
Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ sudo docker run --rm --network=host -d olton/mina_monitor_server:latest -journal
99### Set Mina Monitor Server parameters
1010Begin from 1.1.5, you can redefine config parameters with command line arguments:
1111``` shell
12- node server/index -publicKey B62q... -price:currency usd -alertToDiscord [ " FAIL" ]
12+ node server/index -publicKey B62q... -price:currency usd -alertToDiscord FAIL,EXEC,STATUS
1313```
1414This command overwrite three config parameters:
1515``` json
@@ -18,7 +18,7 @@ This command overwrite three config parameters:
1818 "price" : {
1919 "currency" : " usd"
2020 },
21- "alertToDiscord" : [" FAIL" ]
21+ "alertToDiscord" : [" FAIL" , " EXEC " , " STATUS " ]
2222}
2323```
2424
Original file line number Diff line number Diff line change 1-
21The MIT License (MIT)
32
43Copyright (c) 2021 Serhii Pimenov.
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const updateConfigFromArguments = (c) => {
2828 v = Number ( v )
2929 } else if ( [ 'true' , 'false' ] . includes ( v . toLowerCase ( ) ) ) {
3030 v = v . toLowerCase ( ) === 'true'
31- } else if ( v . includes ( "[" ) ) {
31+ } else if ( v . includes ( "[" ) || v . includes ( "," ) ) {
3232 v = v . replace ( / [ \[ \] " ' ` ] / gi, "" ) . split ( "," )
3333 }
3434
Original file line number Diff line number Diff line change @@ -19,15 +19,20 @@ const {processJournal} = require("./modules/journal")
1919const { updateConfigFromArguments} = require ( "./helpers/arguments" ) ;
2020
2121// const __dirname = dirname(fileURLToPath(import.meta.url))
22+ const configPathLinux = "/etc/minamon/config.json"
2223const configPath = path . resolve ( __dirname , 'config.json' )
2324
2425if ( ! fs . existsSync ( configPath ) ) {
2526 throw new Error ( "Config file not exist!" )
2627}
2728
28- const config = updateConfigFromArguments ( JSON . parse ( fs . readFileSync ( configPath , 'utf-8' ) ) )
29+ const readConfig = ( path ) => updateConfigFromArguments ( JSON . parse ( fs . readFileSync ( path , 'utf-8' ) ) )
30+
31+ const config = readConfig ( process . platform === 'linux' && fs . existsSync ( configPathLinux ) ? configPathLinux : configPath )
2932const [ SERVER_HOST , SERVER_PORT ] = config . host . split ( ":" )
3033
34+ console . log ( config )
35+
3136/* Create log dir */
3237const logDir = path . resolve ( __dirname , "logs" )
3338if ( ! fs . existsSync ( logDir ) ) fs . mkdirSync ( logDir )
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ StartLimitBurst=3
88Type =simple
99Restart =always
1010RestartSec =15
11- ExecStart =/usr/bin/node /home/user-name/mina-monitor /index
12- ExecStop =/usr/bin/pkill -9 -f "node mina-monitor /index"
11+ ExecStart =/usr/bin/node /home/user/minamon /index
12+ ExecStop =/usr/bin/pkill -9 -f "node minamon /index"
1313
1414[Install]
1515WantedBy =multi-user.target
Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ query ($publicKey: String!) {
7373 stateHash
7474 unknown
7575 }
76+ timing {
77+ vesting_period
78+ vesting_increment
79+ initial_mininum_balance
80+ cliff_time
81+ cliff_amount
82+ }
7683 }
7784}
7885` ;
You can’t perform that action at this time.
0 commit comments