Skip to content

Commit f753637

Browse files
authored
Merge pull request ton-blockchain#515 from yungwine/ls-proxy
fix LS proxy installation script
2 parents bc190e4 + 80f9b02 commit f753637

File tree

1 file changed

+8
-37
lines changed

1 file changed

+8
-37
lines changed

mytoninstaller/scripts/ls_proxy_installer.sh

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ check_superuser
1010

1111
# install parameters
1212
src_path=/usr/src
13-
bin_path=/usr/bin
14-
openssl_path=${bin_path}/openssl_3
1513

1614
# Get arguments
17-
while getopts u:s:b:o: flag
15+
while getopts u:s: flag
1816
do
1917
case "${flag}" in
2018
u) user=${OPTARG};;
2119
s) src_path=${OPTARG};;
22-
b) bin_path=${OPTARG};;
23-
o) openssl_path=${OPTARG};;
2420
*)
2521
echo "Flag -${flag} is not recognized. Aborting"
2622
exit 1;;
@@ -37,50 +33,25 @@ bin_name=ls_proxy
3733
COLOR='\033[95m'
3834
ENDC='\033[0m'
3935

40-
# Клонирование репозиториев с github.com
41-
echo -e "${COLOR}[1/4]${ENDC} Cloning github repository"
36+
echo -e "${COLOR}[1/3]${ENDC} Cloning github repository"
4237
echo "https://github.com/${author}/${repo}.git -> ${branch}"
4338

44-
4539
package_src_path=${src_path}/${repo}
4640
rm -rf ${package_src_path}
4741

4842
cd ${src_path}
49-
git clone --branch=${branch} --recursive https://github.com/${author}/${repo}.git
43+
git clone --branch=${branch} https://github.com/${author}/${repo}.git
5044

51-
# Установка компонентов
52-
echo -e "${COLOR}[2/4]${ENDC} Installing required packages"
45+
echo -e "${COLOR}[2/3]${ENDC} Installing required packages"
5346
go_path=/usr/local/go/bin/go
5447
check_go_version "${package_src_path}/go.mod" ${go_path}
5548

56-
# Компилируем из исходников
57-
cpu_number=$(get_cpu_number)
58-
echo -e "${COLOR}[3/4]${ENDC} Source compilation, use ${cpu_number} cpus"
59-
60-
ton_src_path=${package_src_path}/ton
61-
proxy_internal_path=${package_src_path}/internal/emulate/lib
62-
63-
proxy_build_path=${bin_path}/${bin_name}
64-
ton_build_path=${proxy_build_path}/ton
6549
db_path=/var/${bin_name}
66-
lib_path=${db_path}/lib
67-
68-
mkdir -p ${lib_path}
69-
mkdir -p ${ton_build_path} && cd ${ton_build_path}
70-
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=${openssl_path}/include -DOPENSSL_CRYPTO_LIBRARY=${openssl_path}/libcrypto.a ${ton_src_path}
71-
make emulator -j ${cpu_number}
72-
cp ${ton_build_path}/emulator/libemulator.so ${lib_path}
73-
cp ${ton_build_path}/emulator/libemulator.so ${proxy_internal_path}
74-
cp ${ton_build_path}/emulator/emulator_export.h ${proxy_internal_path}
50+
mkdir -p ${db_path}
7551

76-
# Компилируем
77-
cd ${package_src_path}
78-
entry_point=$(find ${package_src_path} -name "main.go" | head -n 1)
79-
CGO_ENABLED=1 ${go_path} build -o ${db_path}/${bin_name} ${entry_point}
52+
cd "${package_src_path}"
53+
${go_path} build -o ${db_path}/${bin_name} cmd/main.go
8054

81-
# Настроить директорию работы
8255
chown -R ${user}:${user} ${db_path}
8356

84-
# Выход из программы
85-
echo -e "${COLOR}[4/4]${ENDC} ${bin_name} installation complete"
86-
exit 0
57+
echo -e "${COLOR}[3/3]${ENDC} ${bin_name} installation complete"

0 commit comments

Comments
 (0)