-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall-ipfs-win-cygwin.sh
executable file
·57 lines (47 loc) · 1.85 KB
/
install-ipfs-win-cygwin.sh
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
#!/bin/bash
# This script installs IPFS.
# https://github.com/ipfs/kubo/releases/download/v0.29.0/kubo_v0.29.0_linux-arm64.tar.gz
# https://github.com/ipfs/kubo/releases/download/v0.29.0/kubo_v0.29.0_darwin-amd64.tar.gz
# https://github.com/ipfs/kubo/releases/download/v0.29.0/kubo_v0.29.0_windows-amd64.zip
# Navigate to the directory where the script resides
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CORTENSOR_DIR="$HOME/.cortensor"
cd $DIR
echo "Starting IPFS installation process..."
echo "======================================="
echo "1. Downloading IPFS package - Windows AMD64 (Cygwin)"
# Download the IPFS package
IPFS_VERSION="v0.29.0"
IPFS_PACKAGE="kubo_${IPFS_VERSION}_windows-amd64.zip"
IPFS_URL="https://github.com/ipfs/kubo/releases/download/${IPFS_VERSION}/${IPFS_PACKAGE}"
curl -fsSL $IPFS_URL -o $IPFS_PACKAGE
if [[ $? -ne 0 ]]; then
echo " - Error: Failed to download IPFS package from $IPFS_URL"
exit 1
fi
echo " - IPFS package downloaded successfully"
echo "2. Extracting IPFS package"
# Extract the package
unzip $IPFS_PACKAGE
if [[ $? -ne 0 ]]; then
echo " - Error: Failed to extract $IPFS_PACKAGE"
exit 1
fi
echo " - IPFS package extracted successfully"
echo "3. Installing IPFS"
# Run the installation script
mkdir -p ~/.cortensor/bin
cp -f ./kubo/ipfs.exe ~/.cortensor/bin/
if [[ $? -ne 0 ]]; then
echo " - Error: Failed to install IPFS"
exit 1
fi
echo " - IPFS installed successfully"
echo "======================================="
echo "IPFS installation process completed successfully!"
mkdir -p "${CORTENSOR_DIR}/logs"
echo " - Created logs directory: ${CORTENSOR_DIR}/logs"
touch "${CORTENSOR_DIR}/logs/cortensord.log"
echo " - Created log file: ${CORTENSOR_DIR}/logs/cortensord.log"
touch "${CORTENSOR_DIR}/logs/cortensord-llm.log"
echo " - Created log file: ${CORTENSOR_DIR}/logs/cortensord-llm.log"