github.com/klaytn/klaytn@v1.12.1/build/packaging/windows/start-kpn.bat (about)

     1  @echo off
     2  
     3  set HOME=%~dp0
     4  set CONF=%HOME%\conf
     5  
     6  call %CONF%\kpn-conf.cmd
     7  
     8  REM Check if exist data directory
     9  set "NOT_INIT="
    10  IF NOT EXIST %KLAY_HOME% (
    11      set NOT_INIT=1
    12  )
    13  IF NOT EXIST %DATA_DIR% (
    14      set NOT_INIT=1
    15  )
    16  
    17  IF DEFINED NOT_INIT (
    18      echo "[ERROR] : kpn is not initiated, Initiate kpn with genesis file first."
    19      GOTO end
    20  )
    21  
    22  set OPTIONS=--nodiscover
    23  
    24  IF DEFINED NETWORK_ID (
    25      set OPTIONS=%OPTIONS% --networkid %NETWORK_ID%
    26  )
    27  
    28  IF DEFINED DATA_DIR (
    29      set OPTIONS=%OPTIONS% --datadir %DATA_DIR%
    30  )
    31  
    32  IF DEFINED PORT (
    33      set OPTIONS=%OPTIONS% --port %PORT%
    34  )
    35  
    36  IF DEFINED SERVER_TYPE (
    37      set OPTIONS=%OPTIONS% --srvtype %SERVER_TYPE%
    38  )
    39  
    40  IF DEFINED VERBOSITY (
    41      set OPTIONS=%OPTIONS% --verbosity %VERBOSITY%
    42  )
    43  
    44  IF DEFINED TXPOOL_EXEC_SLOTS_ALL (
    45      set OPTIONS=%OPTIONS% --txpool.exec-slots.all %TXPOOL_EXEC_SLOTS_ALL%
    46  )
    47  
    48  IF DEFINED TXPOOL_NONEXEC_SLOTS_ALL (
    49      set OPTIONS=%OPTIONS% --txpool.nonexec-slots.all %TXPOOL_NONEXEC_SLOTS_ALL%
    50  )
    51  
    52  IF DEFINED TXPOOL_EXEC_SLOTS_ACCOUNT (
    53      set OPTIONS=%OPTIONS% --txpool.exec-slots.account %TXPOOL_EXEC_SLOTS_ACCOUNT%
    54  )
    55  
    56  IF DEFINED TXPOOL_NONEXEC_SLOTS_ACCOUNT (
    57      set OPTIONS=%OPTIONS% --txpool.nonexec-slots.account %TXPOOL_NONEXEC_SLOTS_ACCOUNT%
    58  )
    59  
    60  IF DEFINED TXPOOL_LIFE_TIME (
    61      set OPTIONS=%OPTIONS% --txpool.lifetime %TXPOOL_LIFE_TIME%
    62  )
    63  
    64  IF DEFINED SYNCMODE (
    65      set OPTIONS=%OPTIONS% --syncmode %SYNCMODE%
    66  )
    67  
    68  IF DEFINED MAXCONNECTIONS (
    69      set OPTIONS=%OPTIONS% --maxconnections %MAXCONNECTIONS%
    70  )
    71  
    72  IF DEFINED LDBCACHESIZE (
    73      set OPTIONS=%OPTIONS% --db.leveldb.cache-size %LDBCACHESIZE%
    74  )
    75  
    76  IF DEFINED RPC_ENABLE (
    77      IF %RPC_ENABLE%==1 (
    78          set OPTIONS=%OPTIONS% --rpc --rpcapi %RPC_API% --rpcport %RPC_PORT% --rpcaddr %RPC_ADDR% --rpccorsdomain ^
    79  %RPC_CORSDOMAIN% --rpcvhosts %RPC_VHOSTS%
    80      )
    81  )
    82  
    83  IF DEFINED WS_ENABLE (
    84      IF %WS_ENABLE%==1 (
    85          set OPTIONS=%OPTIONS% --ws --wsapi %WS_API% --wsaddr %WS_ADDR% --wsport %WS_PORT% --wsorigins %WS_ORIGINS%
    86      )
    87  )
    88  
    89  IF DEFINED METRICS (
    90      IF %METRICS%==1 (
    91          set OPTIONS=%OPTIONS% --metrics
    92      )
    93  )
    94  
    95  IF DEFINED PROMETHEUS (
    96      IF %PROMETHEUS%==1 (
    97          set OPTIONS=%OPTIONS% --prometheus
    98      )
    99  )
   100  
   101  IF DEFINED DB_NO_PARALLEL_WRITE (
   102      IF %DB_NO_PARALLEL_WRITE%==1 (
   103          set OPTIONS=%OPTIONS% --db.no-parallel-write
   104      )
   105  )
   106  
   107  IF DEFINED MULTICHANNEL (
   108      IF %MULTICHANNEL%==1 (
   109          set OPTIONS=%OPTIONS% --multichannel
   110      )
   111  )
   112  
   113  IF DEFINED ADDITIONAL (
   114      IF NOT %ADDITIONAL%=="" (
   115          set OPTIONS=%OPTIONS% %ADDITIONAL%
   116      )
   117  )
   118  
   119  %HOME%\bin\kpn.exe %OPTIONS%
   120  
   121  :end
   122  @pause