-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
69 lines (55 loc) · 1.92 KB
/
main.go
File metadata and controls
69 lines (55 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import (
_ "encoding/json"
"github.com/achnir97/go_lang_filbytes/api"
_ "github.com/robfig/cron"
_ "gorm.io/gorm"
)
type Total_Quality_adjP_and_Fil_Reward_for_Vogo_network struct {
Date string
Total_Quality_adjP_For_Vogo_Daily_Basis float32
Total_FIL_Reward_Vogo_daily_Basis float32
Current_Sector_Initial_Pledge_32GB float32
Fil_Price float32
}
//var hasRunToday bool
func main() {
// r := mux.NewRouter()
// // Register the endpoints with gorilla/mux router
// r.HandleFunc("/pledge_inv", endpoints.GetInvFormation).Methods("GET")
// r.HandleFunc("/info_for_25th_month", endpoints.GetInffrom_25_month).Methods("GET")
// r.HandleFunc("/daily_price", endpoints.Get_Fil_price).Methods("GET")
// corsHandler := cors.New(cors.Options{
// AllowedOrigins: []string{"http://222.112.183.197:3001"},
// AllowedMethods: []string{"GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS"},
// AllowCredentials: true,
// }).Handler(r)
// fmt.Printf("Serving is running at port 8080")
// log.Fatal(http.ListenAndServe(":8080", corsHandler))
api.FIL_Price_n_Block_rewards_for_Each_Node_from_API()
/*t := time.Date(time.Now().Year(), time.Now().Month(), time.Now().Day(), 19, 0, 0, 0, time.Local)
if t.Before(time.Now()) {
t = t.AddDate(0, 0, 1)
}
// Create a ticker with a 1-minute delay
ticker := time.NewTicker(1 * time.Minute)
// Run the functions on schedule
for {
select {
case <-ticker.C:
// Get the current time
now := time.Now()
// Check if it's time to run the functions
if now.Equal(t) {
// Run the functions
api.FIL_Price_n_Block_rewards_for_Each_Node_from_API()
time.Sleep(1 * time.Minute)
api.FRP_Calculate_total_Fil_Reward_After_fetched_From_API()
time.Sleep(1 * time.Minute)
api.Calculate_KSL_FRP_500()
// Set the schedule for the next day
t = t.AddDate(0, 0, 1)
}
}
}*/
}