Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix node temp dir issue #190

Merged
merged 7 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmd/omniflixhubd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"errors"
"fmt"
"io"
"os"

Expand Down Expand Up @@ -72,6 +73,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
if err := tempApp.Close(); err != nil {
panic(err)
}
if tempDir != app.DefaultNodeHome {
os.RemoveAll(tempDir)
}
}()

initClientCtx := client.Context{}.
Expand Down Expand Up @@ -178,9 +182,9 @@ func addModuleInitFlags(startCmd *cobra.Command) {
}

func tempDir() string {
dir, err := os.MkdirTemp("", "omniflixhubtemp")
dir, err := os.MkdirTemp("", "."+app.Name+"-temp")
if err != nil {
dir = app.DefaultNodeHome
panic(fmt.Sprintf("failed creating temp directory: %s", err.Error()))
}
defer os.RemoveAll(dir)

Expand Down
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OmniFlix Hub blockchain is built using Cosmos-SDK and CometBFT
```
sudo rm -rf /usr/local/go
wget -q -O - https://git.io/vQhTU | bash -s -- --remove
wget -q -O - https://git.io/vQhTU | bash -s -- --version 1.21.3
wget -q -O - https://git.io/vQhTU | bash -s -- --version 1.22.5
```

### Installation
Expand All @@ -24,7 +24,7 @@ wget -q -O - https://git.io/vQhTU | bash -s -- --version 1.21.3
```
git clone https://github.com/Omniflix/omniflixhub.git
cd omniflixhub
git checkout v4.1.1
git checkout v5.0.0
go mod tidy
make install
```
Expand Down Expand Up @@ -77,6 +77,7 @@ curl https://raw.githubusercontent.com/OmniFlix/mainnet/main/omniflixhub-1/genes
- [v3]((https://github.com/OmniFlix/docs/blob/main/guides/mainnet/omniflixhub-1/upgrades/v3-upgrade.md)) at block 10872800
- [v3.3.0]((https://github.com/OmniFlix/docs/blob/main/guides/mainnet/omniflixhub-1/upgrades/v3.3.0-upgrade.md)) at block 11140000
- [v4]((https://github.com/OmniFlix/docs/blob/main/guides/mainnet/omniflixhub-1/upgrades/v4-upgrade.md)) at block 11914000
- [v5](https://github.com/OmniFlix/docs/blob/main/guides/mainnet/omniflixhub-1/upgrades/v5-upgrade.md) at block 13986200

### Testnets

Expand Down
Loading