Skip to content

Commit

Permalink
create directory, config updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mmchougule committed Sep 17, 2023
1 parent 94cf411 commit 2bc4c87
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
12 changes: 12 additions & 0 deletions components/celestia.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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!"
4 changes: 2 additions & 2 deletions scripts/init.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/
Expand Down

0 comments on commit 2bc4c87

Please sign in to comment.