-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8835af1
commit 9a5e664
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os/exec" | ||
) | ||
|
||
func backupGenesisInitFile(homePath string) { | ||
// Copy genesis.json to genesis_init.json | ||
args := []string{ | ||
homePath + "/config/genesis.json", | ||
homePath + "/config/genesis_init.json", | ||
} | ||
|
||
if err := exec.Command("cp", args...).Run(); err != nil { | ||
log.Fatalf(ColorRed+"Failed to copy genesis.json to genesis_init.json: %v", err) | ||
} | ||
|
||
// If execution reaches here, the command was successful | ||
log.Printf(ColorYellow + "Genesis file copied to genesis_init.json") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os/exec" | ||
) | ||
|
||
func restoreGenesisInitFile(homePath string) { | ||
// Copy genesis_init.json to genesis.json | ||
args := []string{ | ||
homePath + "/config/genesis_init.json", | ||
homePath + "/config/genesis.json", | ||
} | ||
|
||
if err := exec.Command("cp", args...).Run(); err != nil { | ||
log.Fatalf(ColorRed+"Failed to copy genesis_init.json to genesis.json: %v", err) | ||
} | ||
|
||
// If execution reaches here, the command was successful | ||
log.Printf(ColorYellow + "Genesis file copied to genesis.json") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters