-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage.bat
More file actions
145 lines (134 loc) · 2.73 KB
/
manage.bat
File metadata and controls
145 lines (134 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
@echo off
setlocal enabledelayedexpansion
echo ========================================
echo Bit Core Docker Management
echo ========================================
echo.
:menu
echo Please select an option:
echo.
echo 1. Start Bit Core
echo 2. Stop Bit Core
echo 3. Restart Bit Core
echo 4. View Logs
echo 5. Check Status
echo 6. Update Configuration
echo 7. Clean Data (WARNING: Deletes blockchain data)
echo 8. Exit
echo.
set /p choice="Enter your choice (1-8): "
if "%choice%"=="1" goto start
if "%choice%"=="2" goto stop
if "%choice%"=="3" goto restart
if "%choice%"=="4" goto logs
if "%choice%"=="5" goto status
if "%choice%"=="6" goto update_config
if "%choice%"=="7" goto clean_data
if "%choice%"=="8" goto exit
echo Invalid choice. Please try again.
echo.
goto menu
:start
echo.
echo Starting Bit Core...
docker compose up -d
if %errorlevel% equ 0 (
echo Bit Core started successfully!
) else (
echo Failed to start Bit Core
)
echo.
pause
goto menu
:stop
echo.
echo Stopping Bit Core...
docker compose down
if %errorlevel% equ 0 (
echo Bit Core stopped successfully!
) else (
echo Failed to stop Bit Core
)
echo.
pause
goto menu
:restart
echo.
echo Restarting Bit Core...
docker compose down
docker compose up -d
if %errorlevel% equ 0 (
echo Bit Core restarted successfully!
) else (
echo Failed to restart Bit Core
)
echo.
pause
goto menu
:logs
echo.
echo Viewing Bit Core logs (Press Ctrl+C to exit)...
echo.
docker compose logs -f
goto menu
:status
echo.
echo Bit Core Status:
echo.
docker compose ps
echo.
echo Container Details:
docker compose logs --tail=10
echo.
pause
goto menu
:update_config
echo.
echo Updating configuration...
echo.
echo This will restart Bit Core with the updated config/bit.conf template.
echo.
set /p confirm="Continue? (y/N): "
if /i "%confirm%"=="y" (
echo Stopping Bit Core...
docker compose down
echo Removing old configuration...
if exist "data\bit.conf" del "data\bit.conf"
echo Starting Bit Core with new configuration...
docker compose up -d
echo Configuration updated successfully!
) else (
echo Update cancelled.
)
echo.
pause
goto menu
:clean_data
echo.
echo WARNING: This will delete ALL blockchain data!
echo This includes:
echo - Wallet data
echo - Blockchain blocks
echo - Transaction index
echo - All other Bit Core data
echo.
set /p confirm="Are you sure you want to continue? Type 'DELETE' to confirm: "
if "%confirm%"=="DELETE" (
echo Stopping Bit Core...
docker compose down
echo Removing all data...
if exist "data" rmdir /s /q "data"
mkdir data
echo Starting Bit Core with fresh data...
docker compose up -d
echo Data cleaned successfully!
) else (
echo Clean cancelled.
)
echo.
pause
goto menu
:exit
echo.
echo Goodbye!
exit /b 0