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

     1  @echo off
     2  
     3  set HOME=%~dp0
     4  set CONF=%HOME%\conf
     5  
     6  call %CONF%\kcn-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] : kcn is not initiated, Initiate kcn 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 REWARDBASE (
    77      set OPTIONS=%OPTIONS% --rewardbase %REWARDBASE%
    78  )
    79  
    80  IF DEFINED RPC_ENABLE (
    81      IF %RPC_ENABLE%==1 (
    82          set OPTIONS=%OPTIONS% --rpc --rpcapi %RPC_API% --rpcport %RPC_PORT% --rpcaddr %RPC_ADDR% --rpccorsdomain ^
    83  %RPC_CORSDOMAIN% --rpcvhosts %RPC_VHOSTS%
    84      )
    85  )
    86  
    87  IF DEFINED WS_ENABLE (
    88      IF %WS_ENABLE%==1 (
    89          set OPTIONS=%OPTIONS% --ws --wsapi %WS_API% --wsaddr %WS_ADDR% --wsport %WS_PORT% --wsorigins %WS_ORIGINS%
    90      )
    91  )
    92  
    93  IF DEFINED METRICS (
    94      IF %METRICS%==1 (
    95          set OPTIONS=%OPTIONS% --metrics
    96      )
    97  )
    98  
    99  IF DEFINED PROMETHEUS (
   100      IF %PROMETHEUS%==1 (
   101          set OPTIONS=%OPTIONS% --prometheus
   102      )
   103  )
   104  
   105  IF DEFINED NO_DISCOVER (
   106      IF %NO_DISCOVER%==1 (
   107          set OPTIONS=%OPTIONS% --nodiscover
   108      )
   109  )
   110  
   111  IF DEFINED DB_NO_PARALLEL_WRITE (
   112      IF %DB_NO_PARALLEL_WRITE%==1 (
   113          set OPTIONS=%OPTIONS% --db.no-parallel-write
   114      )
   115  )
   116  
   117  IF DEFINED MULTICHANNEL (
   118      IF %MULTICHANNEL%==1 (
   119          set OPTIONS=%OPTIONS% --multichannel
   120      )
   121  )
   122  
   123  IF DEFINED ADDITIONAL (
   124      IF NOT %ADDITIONAL%=="" (
   125          set OPTIONS=%OPTIONS% %ADDITIONAL%
   126      )
   127  )
   128  
   129  %HOME%\bin\kcn.exe %OPTIONS%
   130  
   131  :end
   132  @pause