diff --git a/rocketpool/node/node.go b/rocketpool/node/node.go index dcd1da0b9..e9636c318 100644 --- a/rocketpool/node/node.go +++ b/rocketpool/node/node.go @@ -1,6 +1,7 @@ package node import ( + _ "embed" "fmt" "math/big" "net/http" @@ -25,8 +26,13 @@ import ( ) // Config -var tasksInterval, _ = time.ParseDuration("5m") -var taskCooldown, _ = time.ParseDuration("10s") +var ( + tasksInterval, _ = time.ParseDuration("5m") + taskCooldown, _ = time.ParseDuration("10s") +) + +//go:embed saturn-art.txt +var saturnArt string const ( MaxConcurrentEth1Requests = 200 @@ -63,7 +69,6 @@ func RegisterCommands(app *cli.App, name string, aliases []string) { // Run daemon func run(c *cli.Context) error { - // Handle the initial fee recipient file deployment err := deployDefaultFeeRecipientFile(c) if err != nil { @@ -338,22 +343,18 @@ func run(c *cli.Context) error { // Wait for both threads to stop wg.Wait() return nil - } // Configure HTTP transport settings func configureHTTP() { - // The daemon makes a large number of concurrent RPC requests to the Eth1 client // The HTTP transport is set to cache connections for future re-use equal to the maximum expected number of concurrent requests // This prevents issues related to memory consumption and address allowance from repeatedly opening and closing connections http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = MaxConcurrentEth1Requests - } // Copy the default fee recipient file into the proper location func deployDefaultFeeRecipientFile(c *cli.Context) error { - cfg, err := services.GetConfig(c) if err != nil { return err @@ -364,7 +365,7 @@ func deployDefaultFeeRecipientFile(c *cli.Context) error { if os.IsNotExist(err) { // Make sure the validators dir is created validatorsFolder := filepath.Dir(feeRecipientPath) - err = os.MkdirAll(validatorsFolder, 0755) + err = os.MkdirAll(validatorsFolder, 0o755) if err != nil { return fmt.Errorf("could not create validators directory: %w", err) } @@ -378,7 +379,7 @@ func deployDefaultFeeRecipientFile(c *cli.Context) error { // Docker and Hybrid just need the address itself defaultFeeRecipientFileContents = cfg.Smartnode.GetRethAddress().Hex() } - err := os.WriteFile(feeRecipientPath, []byte(defaultFeeRecipientFileContents), 0664) + err := os.WriteFile(feeRecipientPath, []byte(defaultFeeRecipientFileContents), 0o664) if err != nil { return fmt.Errorf("could not write default fee recipient file to %s: %w", feeRecipientPath, err) } @@ -387,12 +388,10 @@ func deployDefaultFeeRecipientFile(c *cli.Context) error { } return nil - } // Remove the old fee recipient files that were created in v1.5.0 func removeLegacyFeeRecipientFiles(c *cli.Context) error { - legacyFeeRecipientFile := "rp-fee-recipient.txt" cfg, err := services.GetConfig(c) @@ -416,7 +415,6 @@ func removeLegacyFeeRecipientFiles(c *cli.Context) error { } return nil - } // Update the latest network state at each cycle @@ -450,22 +448,8 @@ func GetPriorityFee(priorityFee *big.Int, maxFee *big.Int) *big.Int { // Print a message if Saturn has been deployed yet func printSaturnMessage(log *log.ColorLogger) { log.Println(` -* . -* / \ -* |.'.| -* |'.'| -* ,'| |'. -* |,-'-|-'-.| -* __|_| | _ _ _____ _ -* | ___ \| | | | | | ___ \ | | -* | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | -* | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | -* | |\ \ (_) | (__| < __/ |_ | | | (_) | (_) | | -* \_| \_\___/ \___|_|\_\___|\__| \_| \___/ \___/|_| -* +---------------------------------------------------+ -* | DECENTRALISED STAKING PROTOCOL FOR ETHEREUM | -* +---------------------------------------------------+ -* * ============== Saturn 1 has launched! =============== `) + + fmt.Print(saturnArt) } diff --git a/rocketpool/node/saturn-art.txt b/rocketpool/node/saturn-art.txt new file mode 100644 index 000000000..0b809e0fc --- /dev/null +++ b/rocketpool/node/saturn-art.txt @@ -0,0 +1,20 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^""""""""""""""""""""""""""""""""^^^"""""""^^ +^^^^^^^^^^^^^^^^^^^^^^"""""""""""",,,,,,,,,,,,,,,,,:,,::::,,,,,,,::::,,""""""""" +""""""""""""""""""""""""",,,,,,,,,:::::,,::::;;;II;;::::::;Il!i>><<>iii<>!;,,,,, +""""""""""""""""",,,,,,,,::::::::;;Ili>~++~<illlIl!i<_]{)\fjrrxxxrjt\1<I<]}~:,,, +""""",,,,,,,,,,,,,,,::::::;;;IIl!<_]{(\tfffjjf\(jxvUUJJJYzvcXJJJJJJLLQx:l}/_:,,, +,,,,,,,,,,,,,,:::::::;;;IIIIl!i<+-][{{1)(\/fxvXJOZz||1}[1xvvYZ0ZO0000u<<(/+:::,: +,,,,,,,,,,:::::::;;;IIIll!!illii<~+-?[}1(\/fxucYCwbx<~<_}YQLZwwmOO0z)_1t}l,::::: +,,,,::::::::::;;IIIll!!i!l>I`,;li<~_?]}1(\tjxvYLZqaBu+)uQZmqppwOJn)[)\[!::;;:::: +,,,::::::::;;;IIll!!!!!<]r/```^:li<+-]}1(/fxcULOmm0CXXOqqppqZJu/11)1+I:;I;;;:::: +::::::::::;;IIlll!i<-(cmpw1`^``^,I>~_]})/jnvzXXzvcXLmddqmLXx\)11{-iI;II;;;;;;;;; +::::::;;;;IIIIli<]/UpbOx]>l;:,,,,:I!<_]{(|/tfxvU0wqqOJzr/)11{[_>llllII;;;;;;;;;; +:::::;;;II;I!<?\zqkOr_Ili~<IIIII;:::;!+[(fvULOmZQUuf|1{{{[-~illllIII;;;;;;;;;::; +:::::;;;:I>+{jCqqc[il;li!!!;",:;!<-{\xzJQO0CYvj\1}[[[?_<illlllIII;;;;;;;:::::::: +:::::::I~?}rCqdmznjt([-___-[})\juXJLLCYcrt(1[]-+~<<>!lIllIII;;;:::::::::,,,,,,,, +:::::;<}]}Y0m0LJXznrjjjrxnuvzXXzcnj/)}]-_+~>l:,,:;I;I;;::::::::,,,,,,,,,,,,,"""" +::::i]{?;fUuvvvvvunxxxrrjft\(1}?-+~~~~il:,^^^,:;::,,,,,,,,,,,,,""""""""""^^^^^^^ +:::i??_<II~?]}}}}}}[]?-+~~<>ii!lllI;:,"",,::,,,"""""""""""""^^^^^^^^^^^````````` +,,,Il>i!!lIIIIIllllIIII;;;::,""^^^^^^"""^^^^^^^^^^^^^^^^``````````````````'''''' +"""^""""",,,,,,,"""^^^^```````^^^^`````````````````````````''''''''''''''''''''' +^^^````````````````````````````````'`''''''''''''''''''''''''''................. diff --git a/shared/services/rocketpool/assets/install/templates/node.tmpl b/shared/services/rocketpool/assets/install/templates/node.tmpl index 1fe7025d4..3f564e086 100644 --- a/shared/services/rocketpool/assets/install/templates/node.tmpl +++ b/shared/services/rocketpool/assets/install/templates/node.tmpl @@ -10,6 +10,7 @@ services: image: {{.Smartnode.GetSmartnodeContainerTag}} container_name: {{.Smartnode.ProjectName}}_node restart: unless-stopped + tty: true volumes: - /var/run/docker.sock:/var/run/docker.sock - {{.RocketPoolDirectory}}:/.rocketpool diff --git a/shared/services/rocketpool/assets/install/templates/watchtower.tmpl b/shared/services/rocketpool/assets/install/templates/watchtower.tmpl index 01e7ee423..e412411b7 100644 --- a/shared/services/rocketpool/assets/install/templates/watchtower.tmpl +++ b/shared/services/rocketpool/assets/install/templates/watchtower.tmpl @@ -10,6 +10,7 @@ services: image: {{.Smartnode.GetSmartnodeContainerTag}} container_name: {{.Smartnode.ProjectName}}_watchtower restart: unless-stopped + tty: true volumes: - {{.RocketPoolDirectory}}:/.rocketpool - {{.Smartnode.DataPath}}:/.rocketpool/data