-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: polish commands and overviews
- Loading branch information
Showing
22 changed files
with
677 additions
and
76 deletions.
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,42 @@ | ||
package api | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
type GenesisFileKey string | ||
|
||
const ( | ||
MainnetGenesisKey GenesisFileKey = "mainnet" | ||
TestnetGenesisKey GenesisFileKey = "testnet" | ||
FnetGenesisKey GenesisFileKey = "fnet" | ||
) | ||
|
||
type GenesisFileResponse struct { | ||
ResponseCode int | ||
ResponseStatus string | ||
JSON200 string | ||
} | ||
|
||
func (r GenesisFileResponse) StatusCode() int { | ||
return r.ResponseCode | ||
} | ||
func (r GenesisFileResponse) Status() string { | ||
return r.ResponseStatus | ||
} | ||
func GetGenesis(key GenesisFileKey) { | ||
var url string | ||
if key == FnetGenesisKey { | ||
url = "http://relay-eu-no-1.algorand.green:8184/genesis" | ||
} else { | ||
url = fmt.Sprintf("https://raw.githubusercontent.com/algorand/go-algorand/master/installer/genesis/%s/genesis.json", key) | ||
} | ||
resp, err := http.Get(url) | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer resp.Body.Close() | ||
fmt.Println(resp.StatusCode) | ||
|
||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,46 @@ | ||
package catchup | ||
|
||
import ( | ||
"github.com/algorandfoundation/algorun-tui/cmd/utils" | ||
"github.com/algorandfoundation/algorun-tui/ui/style" | ||
"github.com/charmbracelet/lipgloss" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
// endpoint is a string variable used to store the algod API endpoint address for communication with the node. | ||
endpoint string = "" | ||
|
||
// token is a string flag used to store the admin token required for authenticating with the Algod API. | ||
token string = "" | ||
|
||
// force indicates whether to bypass certain checks or enforcement logic within a function or command execution flow. | ||
force bool = false | ||
|
||
// cmdLong provides a detailed description of the Fast-Catchup feature, explaining its purpose and expected sync durations. | ||
cmdLong = lipgloss.JoinVertical( | ||
lipgloss.Left, | ||
style.Purple(style.BANNER), | ||
"", | ||
style.Bold("Fast-Catchup is a feature that allows your node to catch up to the network faster than normal."), | ||
"", | ||
style.BoldUnderline("Overview:"), | ||
"The entire process should sync a node in minutes rather than hours or days.", | ||
"Actual sync times may vary depending on the number of accounts, number of blocks and the network.", | ||
"", | ||
style.Yellow.Render("Note: Not all networks support Fast-Catchup."), | ||
) | ||
|
||
// Cmd represents the root command for managing an Algorand node, including its description and usage instructions. | ||
Cmd = utils.WithAlgodFlags(&cobra.Command{ | ||
Use: "catchup", | ||
Short: "Manage Fast-Catchup for your node", | ||
Long: cmdLong, | ||
}, &endpoint, &token) | ||
) | ||
|
||
func init() { | ||
Cmd.AddCommand(startCmd) | ||
Cmd.AddCommand(stopCmd) | ||
Cmd.AddCommand(debugCmd) | ||
} |
Oops, something went wrong.