diff --git a/components/celestia.go b/components/celestia.go index 4b4d26a..394e65f 100644 --- a/components/celestia.go +++ b/components/celestia.go @@ -32,6 +32,18 @@ func NewCelestiaComponent(root string, home string) *CelestiaComponent { func (c *CelestiaComponent) InitializeConfig() error { lightNodePath := filepath.Join(os.Getenv("HOME"), c.ConfigDir+"/light-node") + // mkdir -p ~/.vimana/celestia/light-node + fmt.Println("๐Ÿš€ Creating Celestia light node config dir: ", lightNodePath) + if _, err := os.Stat(lightNodePath); os.IsNotExist(err) { + err := os.MkdirAll(lightNodePath, 0755) + if err != nil { + fmt.Println("Error creating light node config dir", err) + return err + } + fmt.Println("๐Ÿš€ Celestia light node config dir created: ", lightNodePath) + } else { + fmt.Println("๐Ÿš€ Celestia light node config dir already exists: ", lightNodePath) + } path, err := filepath.Abs(filepath.Join(lightNodePath + "/config.toml")) if err != nil { diff --git a/config.toml b/config.toml index c3aaaae..47e0fc3 100644 --- a/config.toml +++ b/config.toml @@ -5,11 +5,11 @@ [components.celestia.light] binary = "/tmp/vimana/celestia/celestia" -download = "scripts/init.sh" +download = "/tmp/vimana/celestia/init.sh" [components.celestia.bridge] binary = "/tmp/vimana/celestia/celestia" -download = "scripts/init.sh" +download = "/tmp/vimana/celestia/init.sh" # [components.berachain] diff --git a/install.sh b/install.sh index b35937c..4765376 100755 --- a/install.sh +++ b/install.sh @@ -9,8 +9,6 @@ elif [[ "$ARCH" == "arm64" ]] || [[ "$ARCH" == "aarch64" ]]; then fi VIMANA_RELEASE_TAG="0.0.1" GZ_URL="https://github.com/Vistara-Labs/vimana/releases/download/vimana-${VIMANA_RELEASE_TAG}/vimana-${OS}-${ARCH}.tar.gz" -# echo "๐Ÿ’ป OS: $OS" -# echo "๐Ÿ—๏ธ ARCH: $ARCH" INTERNAL_DIR="/usr/local/bin/" VIMANA_BIN_PATH="/usr/local/bin/vimana" @@ -20,15 +18,17 @@ if [ -f "$VIMANA_BIN_PATH" ] || [ -f "$INTERNAL_DIR" ]; then fi sudo mkdir -p "$INTERNAL_DIR" sudo mkdir -p "/tmp/vimana_bins" -echo "๐Ÿ’ฟDownloading vimana..." +echo "๐Ÿ’ฟ Downloading vimana..." curl -O -L $GZ_URL --progress-bar sudo tar -xzf vimana-${OS}-${ARCH}.tar.gz -C "/tmp/vimana_bins" 2>/dev/null -echo "๐Ÿ”จInstalling vimana..." +echo "๐Ÿ”จ Installing vimana..." sudo cp "/tmp/vimana_bins/vimana-${OS}-${ARCH}/vimana" "$INTERNAL_DIR/vimana" sudo chmod +x "$INTERNAL_DIR/vimana" sudo rm -rf "/tmp/vimana_bins" curl -O https://vistara-labs.github.io/vimana/config.toml -sudo mkdir -p ~/.vimana && mv config.toml ~/.vimana/config.toml +sudo mkdir -p ~/.vimana && cp config.toml ~/.vimana/config.toml +curl -O https://vistara-labs.github.io/vimana/scripts/init.sh +sudo mkdir -p /tmp/vimana/celestia && cp init.sh /tmp/vimana/celestia/init.sh echo "โœ… vimana installed!" diff --git a/scripts/init.sh b/scripts/init.sh index cbda775..eed7032 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -INTERNAL_DIR="/tmp/vimana/celestias" +INTERNAL_DIR="/tmp/vimana/celestia" # check if the binary is already installed if [ -f "$INTERNAL_DIR/celestia" ]; then @@ -27,7 +27,7 @@ TGZ_URL="https://github.com/Vistara-Labs/vimana/releases/download/celestia-v0.10 sudo mkdir -p "$INTERNAL_DIR" sudo mkdir -p "/tmp/vimcel" -echo "๐Ÿ’ˆ Downloading vimana..." +echo "๐Ÿ’ˆ Downloading Celestia..." # Replace this with vistara-labs repo sudo curl -o /tmp/vimcel/${OS}_${ARCH}.zip -L "$TGZ_URL" --progress-bar sudo unzip -q /tmp/vimcel/${OS}_${ARCH}.zip -d /tmp/vimcel/