From 79246a9cfe64cc3b09b9ee5fa3b1da1eed888abd Mon Sep 17 00:00:00 2001 From: Nugget Date: Sat, 6 Apr 2024 18:48:39 +0700 Subject: [PATCH 01/16] init dashboard --- .gitignore | 1 + dashboard/server.go | 22 ++++++++++++++++++++++ static/index.html | 17 +++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 dashboard/server.go create mode 100644 static/index.html diff --git a/.gitignore b/.gitignore index 2aea70c..a463e08 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ data /.idea/vcs.xml /.idea/modules.xml /coverage.txt +.DS_Store diff --git a/dashboard/server.go b/dashboard/server.go new file mode 100644 index 0000000..a4c89e2 --- /dev/null +++ b/dashboard/server.go @@ -0,0 +1,22 @@ +package dashboard + +import ( + "fmt" + "log" + "net/http" +) + +func RunThis() { + fmt.Printf("running...") + http.HandleFunc("/", serveFiles) + log.Fatal(http.ListenAndServe(":3001", nil)) +} + +func serveFiles(w http.ResponseWriter, r *http.Request) { + fmt.Println(r.URL.Path) + p := "." + r.URL.Path + if p == "./" { + p = "./static/index.html" + } + http.ServeFile(w, r, p) +} diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..4d6a595 --- /dev/null +++ b/static/index.html @@ -0,0 +1,17 @@ + + + + + + + Provider Dashboard + + + + +
+

Provider Dashboard

+
+ + + From 58166fd0d45cd802ad4ef695e27f84ec2b8faeb3 Mon Sep 17 00:00:00 2001 From: Nugget Date: Tue, 9 Apr 2024 20:45:10 +0700 Subject: [PATCH 02/16] hmmm --- api/index.go | 6 ++++++ api/server.go | 5 ++++- dashboard/server.go | 22 ---------------------- static/index.html | 45 ++++++++++++++++++++++++++++++--------------- static/index.js | 22 ++++++++++++++++++++++ static/style.css | 0 6 files changed, 62 insertions(+), 38 deletions(-) delete mode 100644 dashboard/server.go create mode 100644 static/index.js create mode 100644 static/style.css diff --git a/api/index.go b/api/index.go index d952aba..b911b53 100644 --- a/api/index.go +++ b/api/index.go @@ -10,6 +10,9 @@ import ( func IndexHandler(address string) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, req *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + v := types.IndexResponse{ Status: "online", Address: address, @@ -31,6 +34,9 @@ func VersionHandler(wallet *wallet.Wallet) func(http.ResponseWriter, *http.Reque return } + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + v := types.VersionResponse{ Version: "1.1.0-lite", ChainID: chainId, diff --git a/api/server.go b/api/server.go index a0c4beb..778f5dd 100644 --- a/api/server.go +++ b/api/server.go @@ -15,8 +15,9 @@ import ( "github.com/desmos-labs/cosmos-go-wallet/wallet" "github.com/gorilla/mux" + + jsoniter "github.com/json-iterator/go" ) -import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary @@ -50,6 +51,8 @@ func (a *API) Serve(f *file_system.FileSystem, p *proofs.Prover, wallet *wallet. r.Handle("/metrics", promhttp.Handler()) + r.PathPrefix("/static/").Handler(http.FileServer(http.Dir("./static/"))) + a.srv = &http.Server{ Handler: r, Addr: fmt.Sprintf("0.0.0.0:%d", a.port), diff --git a/dashboard/server.go b/dashboard/server.go deleted file mode 100644 index a4c89e2..0000000 --- a/dashboard/server.go +++ /dev/null @@ -1,22 +0,0 @@ -package dashboard - -import ( - "fmt" - "log" - "net/http" -) - -func RunThis() { - fmt.Printf("running...") - http.HandleFunc("/", serveFiles) - log.Fatal(http.ListenAndServe(":3001", nil)) -} - -func serveFiles(w http.ResponseWriter, r *http.Request) { - fmt.Println(r.URL.Path) - p := "." + r.URL.Path - if p == "./" { - p = "./static/index.html" - } - http.ServeFile(w, r, p) -} diff --git a/static/index.html b/static/index.html index 4d6a595..6af9f76 100644 --- a/static/index.html +++ b/static/index.html @@ -1,17 +1,32 @@ - + - - - - - Provider Dashboard - - - - -
-

Provider Dashboard

-
- - + + + + + Provider Dashboard + + + + + + +

Provider Dashboard

+ +
+
+

Account

+ Withdraw to: + + +
+ +
+

Stats

+
+ +
+

Network

+
+ diff --git a/static/index.js b/static/index.js new file mode 100644 index 0000000..c3617f5 --- /dev/null +++ b/static/index.js @@ -0,0 +1,22 @@ +$(document).ready(function () { + const URL = "http://localhost:3334"; + + const getStatus = async () => { + let data = await fetch(URL).then((res) => res.json()); + let version = await fetch(`${URL}/version`).then((res) => res.json()); + + if (data) { + let status = `

Status: ${data.status}

`; + let address = `

Wallet: ${data.address}

`; + $("#status-bar").append(status, address); + } + }; + + const statusBar = document.createElement("p"); + + $("#withdraw-btn").click(function () { + console.log("withdraw click"); + }); + + getStatus(); +}); diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..e69de29 From 02ba80721e93db5dbc2c843a6e2ffa535d648ede Mon Sep 17 00:00:00 2001 From: Nugget Date: Tue, 9 Apr 2024 21:43:43 +0700 Subject: [PATCH 03/16] embed static --- api/server.go | 9 ++++++++- {static => api/static}/index.html | 0 {static => api/static}/index.js | 0 {static => api/static}/style.css | 0 4 files changed, 8 insertions(+), 1 deletion(-) rename {static => api/static}/index.html (100%) rename {static => api/static}/index.js (100%) rename {static => api/static}/style.css (100%) diff --git a/api/server.go b/api/server.go index 778f5dd..bbdccdb 100644 --- a/api/server.go +++ b/api/server.go @@ -1,8 +1,10 @@ package api import ( + "embed" "errors" "fmt" + "io/fs" "net/http" "time" @@ -21,6 +23,9 @@ import ( var json = jsoniter.ConfigCompatibleWithStandardLibrary +//go:embed static +var assets embed.FS + type API struct { port int64 srv *http.Server @@ -51,7 +56,9 @@ func (a *API) Serve(f *file_system.FileSystem, p *proofs.Prover, wallet *wallet. r.Handle("/metrics", promhttp.Handler()) - r.PathPrefix("/static/").Handler(http.FileServer(http.Dir("./static/"))) + html, _ := fs.Sub(assets, "static") + fs := http.FileServer(http.FS(html)) + r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", fs)) a.srv = &http.Server{ Handler: r, diff --git a/static/index.html b/api/static/index.html similarity index 100% rename from static/index.html rename to api/static/index.html diff --git a/static/index.js b/api/static/index.js similarity index 100% rename from static/index.js rename to api/static/index.js diff --git a/static/style.css b/api/static/style.css similarity index 100% rename from static/style.css rename to api/static/style.css From a2c8c3bf2d6b52b03b7981d2e5710866544d8fda Mon Sep 17 00:00:00 2001 From: Nugget Date: Thu, 11 Apr 2024 17:11:04 +0700 Subject: [PATCH 04/16] withdraw api --- api/server.go | 4 ++- api/wallet.go | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 api/wallet.go diff --git a/api/server.go b/api/server.go index bbdccdb..7a84146 100644 --- a/api/server.go +++ b/api/server.go @@ -56,6 +56,8 @@ func (a *API) Serve(f *file_system.FileSystem, p *proofs.Prover, wallet *wallet. r.Handle("/metrics", promhttp.Handler()) + r.HandleFunc("/withdraw", WithdrawHandler(wallet)).Methods("POST") + html, _ := fs.Sub(assets, "static") fs := http.FileServer(http.FS(html)) r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", fs)) @@ -68,7 +70,7 @@ func (a *API) Serve(f *file_system.FileSystem, p *proofs.Prover, wallet *wallet. ReadTimeout: 15 * time.Second, } - log.Logger.Info().Msg(fmt.Sprintf("Sequoia API now listening on %s", a.srv.Addr)) + log.Logger.Info().Msg(fmt.Sprintf("Sequoia API now listening on %s...", a.srv.Addr)) err := a.srv.ListenAndServe() if err != nil { if !errors.Is(err, http.ErrServerClosed) { diff --git a/api/wallet.go b/api/wallet.go new file mode 100644 index 0000000..1e61b34 --- /dev/null +++ b/api/wallet.go @@ -0,0 +1,92 @@ +package api + +import ( + "fmt" + "net/http" + + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + walletTypes "github.com/desmos-labs/cosmos-go-wallet/types" + "github.com/desmos-labs/cosmos-go-wallet/wallet" +) + +type WithdrawRequest struct { + ToAddress string `json:"to_address"` + Amount string `json:"amount"` +} + +type WithdrawResponse struct { + Response string `json:"response"` +} + +func WithdrawHandler(wallet *wallet.Wallet) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, req *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + w.Header().Set("Access-Control-Allow-Methods", "POST") + w.Header().Set("Content-Type", "application/json") + + fmt.Printf("WITHDRAWING... \n") + fmt.Fprintf(w, "Wallet: %+v \n", wallet) + + var withdraw WithdrawRequest + + err := json.NewDecoder(req.Body).Decode(&withdraw) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + c, err := sdk.ParseCoinNormalized(withdraw.Amount) + if err != nil { + return + } + + m := bankTypes.MsgSend{ + FromAddress: wallet.AccAddress(), + ToAddress: withdraw.ToAddress, + Amount: sdk.NewCoins(c), + } + + fmt.Fprintf(w, "MsgSend: %+v \n", m) + + data := walletTypes.NewTransactionData( + &m, + ).WithGasAuto().WithFeeAuto() + + res, err := wallet.BroadcastTxCommit(data) + if err != nil { + return + } + + fmt.Fprintf(w, "RES: %+v \n", res) + + if res.Code == 0 { + fmt.Fprintf(w, "Withdraw successful!") + } else { + fmt.Fprintf(w, "Something went wrong, please try again.") + } + } +} + +func WithdrawHandlerTest() func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, req *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + w.Header().Set("Access-Control-Allow-Methods", "POST") + w.Header().Set("Content-Type", "application/json") + + fmt.Printf("WITHDRAWING... \n") + + var withdraw WithdrawRequest + + err := json.NewDecoder(req.Body).Decode(&withdraw) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + fmt.Fprintf(w, "Withdraw: %+v", withdraw) + } +} From 36a52f96a007b525efe4d5311aee9366cd841e37 Mon Sep 17 00:00:00 2001 From: Nugget Date: Thu, 11 Apr 2024 22:54:56 +0700 Subject: [PATCH 05/16] queue --- api/server.go | 2 +- api/wallet.go | 39 +++++++++++++++++++++++---------------- proofs/types.go | 4 ++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/api/server.go b/api/server.go index 7a84146..6176d56 100644 --- a/api/server.go +++ b/api/server.go @@ -56,7 +56,7 @@ func (a *API) Serve(f *file_system.FileSystem, p *proofs.Prover, wallet *wallet. r.Handle("/metrics", promhttp.Handler()) - r.HandleFunc("/withdraw", WithdrawHandler(wallet)).Methods("POST") + r.HandleFunc("/withdraw", WithdrawHandler(wallet, p)).Methods("POST") html, _ := fs.Sub(assets, "static") fs := http.FileServer(http.FS(html)) diff --git a/api/wallet.go b/api/wallet.go index 1e61b34..97474be 100644 --- a/api/wallet.go +++ b/api/wallet.go @@ -5,9 +5,10 @@ import ( "net/http" bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/rs/zerolog/log" + "github.com/JackalLabs/sequoia/proofs" sdk "github.com/cosmos/cosmos-sdk/types" - walletTypes "github.com/desmos-labs/cosmos-go-wallet/types" "github.com/desmos-labs/cosmos-go-wallet/wallet" ) @@ -20,7 +21,7 @@ type WithdrawResponse struct { Response string `json:"response"` } -func WithdrawHandler(wallet *wallet.Wallet) func(http.ResponseWriter, *http.Request) { +func WithdrawHandler(wallet *wallet.Wallet, prover *proofs.Prover) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, req *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") @@ -28,7 +29,6 @@ func WithdrawHandler(wallet *wallet.Wallet) func(http.ResponseWriter, *http.Requ w.Header().Set("Content-Type", "application/json") fmt.Printf("WITHDRAWING... \n") - fmt.Fprintf(w, "Wallet: %+v \n", wallet) var withdraw WithdrawRequest @@ -40,6 +40,7 @@ func WithdrawHandler(wallet *wallet.Wallet) func(http.ResponseWriter, *http.Requ c, err := sdk.ParseCoinNormalized(withdraw.Amount) if err != nil { + log.Error() return } @@ -51,22 +52,28 @@ func WithdrawHandler(wallet *wallet.Wallet) func(http.ResponseWriter, *http.Requ fmt.Fprintf(w, "MsgSend: %+v \n", m) - data := walletTypes.NewTransactionData( - &m, - ).WithGasAuto().WithFeeAuto() + // data := walletTypes.NewTransactionData( + // &m, + // ).WithGasAuto().WithFeeAuto() - res, err := wallet.BroadcastTxCommit(data) - if err != nil { - return - } + msg, wg := prover.GetQueue().Add(&m) - fmt.Fprintf(w, "RES: %+v \n", res) + fmt.Fprintf(w, "Add Queue: %+v %+v \n", msg, wg) - if res.Code == 0 { - fmt.Fprintf(w, "Withdraw successful!") - } else { - fmt.Fprintf(w, "Something went wrong, please try again.") - } + // res, err := wallet.BroadcastTxCommit(data) + // if err != nil { + // http.Error(w, err.Error(), http.StatusBadRequest) + // log.Error().Err(err) + // return + // } + + // fmt.Fprintf(w, "RES: %+v \n", res) + + // if res.Code == 0 { + // fmt.Fprintf(w, "Withdraw successful!") + // } else { + // fmt.Fprintf(w, "Something went wrong, please try again.") + // } } } diff --git a/proofs/types.go b/proofs/types.go index cc70073..1b07888 100644 --- a/proofs/types.go +++ b/proofs/types.go @@ -38,3 +38,7 @@ func (p *Prover) Dec() { func (p *Prover) Full() bool { return p.threads <= p.currentThreads } + +func (p *Prover) GetQueue() *queue.Queue { + return p.q +} From 633b2a751089141de2a46ef9a6788056e55c05c6 Mon Sep 17 00:00:00 2001 From: Nugget Date: Wed, 17 Apr 2024 15:08:29 +0700 Subject: [PATCH 06/16] fe --- api/static/index.html | 5 ++++- api/static/index.js | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/api/static/index.html b/api/static/index.html index 6af9f76..2c8c029 100644 --- a/api/static/index.html +++ b/api/static/index.html @@ -17,7 +17,10 @@

Provider Dashboard

Account

Withdraw to: - +
+ + +
diff --git a/api/static/index.js b/api/static/index.js index c3617f5..b418abe 100644 --- a/api/static/index.js +++ b/api/static/index.js @@ -12,10 +12,34 @@ $(document).ready(function () { } }; + const withdrawRequest = async () => { + let input = getFormData(); + console.log(input); + const data = new URLSearchParams(); + data.append = ("to_address", input.to_address); + data.append = ("amount", input.amount); + + fetch(`${URL}/withdraw/`, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: data, + }) + .then((res) => res.json()) + .then((data) => console.log(data)) + .catch((error) => console.error(error)); + }; + const statusBar = document.createElement("p"); + const getFormData = () => { + const form = document.querySelector("form"); + return (data = Object.fromEntries(new FormData(form).entries())); + }; $("#withdraw-btn").click(function () { - console.log("withdraw click"); + console.log("withdraw click..."); + withdrawRequest(); }); getStatus(); From 6af9e88af7149b0b03dacfaf1e3a881807dcad99 Mon Sep 17 00:00:00 2001 From: Nugget Date: Wed, 17 Apr 2024 15:46:19 +0700 Subject: [PATCH 07/16] init chart --- api/static/chart-stats.js | 29 +++++++++++++++++++++++++++++ api/static/index.html | 16 +++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 api/static/chart-stats.js diff --git a/api/static/chart-stats.js b/api/static/chart-stats.js new file mode 100644 index 0000000..e1db309 --- /dev/null +++ b/api/static/chart-stats.js @@ -0,0 +1,29 @@ +const ctx = document.querySelector("#myChart").getContext("2d"); +var myChart = new Chart(ctx, { + type: "line", + plugins: [ChartDatasourcePrometheusPlugin], + options: { + plugins: { + "datasource-prometheus": { + prometheus: { + endpoint: "https://prometheus.demo.do.prometheus.io", + baseURL: "/api/v1", // default value + }, + query: "sum by (job) (go_gc_duration_seconds)", + timeRange: { + type: "relative", + + // from 12 hours ago to now + start: -12 * 60 * 60 * 1000, + end: 0, + }, + }, + }, + }, +}); + +const doSomething = () => { + console.log("hello..."); +}; + +window.addEventListener("onload", doSomething(), false); diff --git a/api/static/index.html b/api/static/index.html index 2c8c029..8c20b23 100644 --- a/api/static/index.html +++ b/api/static/index.html @@ -8,6 +8,18 @@ + + + @@ -24,12 +36,14 @@

Account

-
+

Stats

+

Network

+ From 0b5386e941eff28ea9c47ff0aa0b7b1ec21661ae Mon Sep 17 00:00:00 2001 From: Nugget Date: Fri, 26 Apr 2024 16:24:06 +0700 Subject: [PATCH 08/16] added charts --- api/static/chart-stats.js | 35 +++++++++++++++++++++++++++------- api/static/index.html | 3 ++- api/static/prometheus-notes.md | 5 +++++ 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 api/static/prometheus-notes.md diff --git a/api/static/chart-stats.js b/api/static/chart-stats.js index e1db309..b4fe48f 100644 --- a/api/static/chart-stats.js +++ b/api/static/chart-stats.js @@ -1,20 +1,41 @@ -const ctx = document.querySelector("#myChart").getContext("2d"); -var myChart = new Chart(ctx, { +const ctx1 = document.querySelector("#myChart").getContext("2d"); +var myChart = new Chart(ctx1, { type: "line", plugins: [ChartDatasourcePrometheusPlugin], options: { plugins: { "datasource-prometheus": { prometheus: { - endpoint: "https://prometheus.demo.do.prometheus.io", - baseURL: "/api/v1", // default value + endpoint: "http://localhost:9092", }, - query: "sum by (job) (go_gc_duration_seconds)", + query: + "sequoia_current_proofs_processing or sequoia_file_count offset 10m", timeRange: { type: "relative", + // from 24 hours ago to now + start: -24 * 60 * 60 * 1000, + end: 0, + }, + }, + }, + }, +}); - // from 12 hours ago to now - start: -12 * 60 * 60 * 1000, +const ctx2 = document.querySelector("#networkChart").getContext("2d"); +var networkChart = new Chart(ctx2, { + type: "line", + plugins: [ChartDatasourcePrometheusPlugin], + options: { + plugins: { + "datasource-prometheus": { + prometheus: { + endpoint: "http://localhost:9092", + }, + query: "sequoia_block_height", + timeRange: { + type: "relative", + // from 2 hours ago to now + start: -2 * 60 * 60 * 1000, end: 0, }, }, diff --git a/api/static/index.html b/api/static/index.html index 8c20b23..220b56f 100644 --- a/api/static/index.html +++ b/api/static/index.html @@ -38,11 +38,12 @@

Account

Stats

+
-

Network

+
diff --git a/api/static/prometheus-notes.md b/api/static/prometheus-notes.md new file mode 100644 index 0000000..1ae3240 --- /dev/null +++ b/api/static/prometheus-notes.md @@ -0,0 +1,5 @@ +- Download Prometheus and Set up prometheus.yml file + +- Run command to start prometheus server + + `./prometheus --config.file="prometheus.yml" --web.isten-address ':9092'` \ No newline at end of file From 4872dd68877a328cbd364bdbc9dd840fa1ca9367 Mon Sep 17 00:00:00 2001 From: Nugget Date: Thu, 23 May 2024 16:39:17 +0700 Subject: [PATCH 09/16] add Dockerfile --- Dockerfile | 12 +++++++ api/static/prometheus-notes.md | 8 ++++- scripts/sequoia.sh | 15 ++++++++ scripts/test-sequoia.sh | 66 ++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100755 scripts/sequoia.sh create mode 100755 scripts/test-sequoia.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ff8b44d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.21 + +ADD . sequoia + +WORKDIR sequoia + +RUN make install + +RUN ./scripts/sequoia.sh + + +CMD ["testrun""] diff --git a/api/static/prometheus-notes.md b/api/static/prometheus-notes.md index 1ae3240..cfb22d0 100644 --- a/api/static/prometheus-notes.md +++ b/api/static/prometheus-notes.md @@ -2,4 +2,10 @@ - Run command to start prometheus server - `./prometheus --config.file="prometheus.yml" --web.isten-address ':9092'` \ No newline at end of file + `./prometheus --config.file="prometheus.yml" --web.listen-address ':9092'` + +- Download Grafana + +- Run cmd + + `./bin/grafana server` \ No newline at end of file diff --git a/scripts/sequoia.sh b/scripts/sequoia.sh new file mode 100755 index 0000000..b295e39 --- /dev/null +++ b/scripts/sequoia.sh @@ -0,0 +1,15 @@ +sequoia init + +# yq -i '.proof_interval=120' $PROV_HOME/config.yaml +# yq -i '.queue_interval=7' $PROV_HOME/config.yaml +# yq -i '.chain_config.rpc_addr="http://localhost:26657"' $PROV_HOME/config.yaml +# yq -i '.chain_config.grpc_addr="localhost:9090"' $PROV_HOME/config.yaml +# yq -i '.domain="http://localhost:3334"' $PROV_HOME/config.yaml +# yq -i '.data_directory="'$PROV_HOME'/data"' $PROV_HOME/config.yaml +# yq -i '.api_config.port=3334' $PROV_HOME/config.yaml +# +rm /root/.sequoia/provider_wallet.json + +echo "{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" > /root/.sequoia/provider_wallet.json + +sequoia start diff --git a/scripts/test-sequoia.sh b/scripts/test-sequoia.sh new file mode 100755 index 0000000..17a5eb5 --- /dev/null +++ b/scripts/test-sequoia.sh @@ -0,0 +1,66 @@ +export JKL_HOME="$HOME/canine-test" +export PROV_HOME="$HOME/canine-prov-test" + +rm -rf $JKL_HOME +rm -rf $PROV_HOME + +export CHAIN="canine-1" +export ALIAS="marston" +export MONIKER="jackal" + +canined init $MONIKER --home=$JKL_HOME --chain-id=$CHAIN +canined config chain-id $CHAIN --home=$JKL_HOME +canined config keyring-backend test --home=$JKL_HOME + +sed -i.bak -e 's/chain-id = ""/chain-id = "canine-1"/' $JKL_HOME/config/client.toml + +echo "video pluck level diagram maximum grant make there clog tray enrich book hawk confirm spot you book vendor ensure theory sure jewel sort basket" | canined keys add $ALIAS --keyring-backend=test --recover --home=$JKL_HOME +echo "flock stereo dignity lawsuit mouse page faith exact mountain clinic hazard parent arrest face couch asset jump feed benefit upper hair scrap loud spirit" | canined keys add charlie --keyring-backend=test --recover --home=$JKL_HOME +echo "brief enhance flee chest rabbit matter chaos clever lady enable luggage arrange hint quarter change float embark canoe chalk husband legal dignity music web" | canined keys add danny --keyring-backend=test --recover --home=$JKL_HOME + +canined add-genesis-account $(canined keys show -a $ALIAS --keyring-backend=test --home=$JKL_HOME) 500000000ujkl --home=$JKL_HOME +canined add-genesis-account $(canined keys show -a charlie --keyring-backend=test --home=$JKL_HOME) 500000000ujkl --home=$JKL_HOME +canined add-genesis-account $(canined keys show -a danny --keyring-backend=test --home=$JKL_HOME) 500000000ujkl --home=$JKL_HOME +canined add-genesis-account jkl13327d3ntsy849s622y4ft05ynwkfyqss3v4pzg 500000000000000ujkl --home=$JKL_HOME + +canined gentx $ALIAS 200000000ujkl \ +--chain-id=$CHAIN \ +--moniker="$MONIKER" \ +--commission-max-change-rate=0.01 \ +--commission-max-rate=0.20 \ +--commission-rate=0.05 \ +--fees=2500ujkl \ +--from=$ALIAS \ +--keyring-backend=test \ +--home=$JKL_HOME + +canined collect-gentxs --home=$JKL_HOME + +sed -i.bak -e "s/stake/ujkl/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/ujklr/staker/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/cosmos1arsaayyj5tash86mwqudmcs2fd5jt5zgp07gl8/jkl1arsaayyj5tash86mwqudmcs2fd5jt5zgc3sexc/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/\"proof_window\": \"50\"/\"proof_window\": \"400\"/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/\"check_window\": \"100\"/\"check_window\": \"100\"/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/\"chunk_size\": \"1024\"/\"chunk_size\": \"1024\"/" $JKL_HOME/config/genesis.json +sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ujkl\"/" $JKL_HOME/config/app.toml +sed -i.bak -e 's/enable = false/enable=true/' $JKL_HOME/config/app.toml +sed -i.bak -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/' $JKL_HOME/config/app.toml +sed -i.bak -e 's/cors_allowed_origins = \[\]/cors_allowed_origins = \["*"\]/' $JKL_HOME/config/config.toml +sed -i.bak -e 's/chain-id = ""/chain-id = "canine-1"/' $JKL_HOME/config/client.toml +screen -d -m -L -Logfile "chain.log" canined start --home=$JKL_HOME --log_level info +sleep 20 +canined tx storage buy-storage $(canined keys show charlie -a --home=$JKL_HOME) 30 1000000000000 ujkl --from charlie --gas-prices=0.02ujkl --home=$JKL_HOME -y + +sequoia init --home=$PROV_HOME + +yq -i '.proof_interval=120' $PROV_HOME/config.yaml +yq -i '.queue_interval=7' $PROV_HOME/config.yaml +yq -i '.chain_config.rpc_addr="http://localhost:26657"' $PROV_HOME/config.yaml +yq -i '.chain_config.grpc_addr="localhost:9090"' $PROV_HOME/config.yaml +yq -i '.domain="http://localhost:3334"' $PROV_HOME/config.yaml +yq -i '.data_directory="'$PROV_HOME'/data"' $PROV_HOME/config.yaml +yq -i '.api_config.port=3334' $PROV_HOME/config.yaml + +rm $PROV_HOME/provider_wallet.json +echo "{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" > $PROV_HOME/provider_wallet.json +sequoia start --home=$PROV_HOME From 52ce86b48bb4302105e5a22800496869c6805497 Mon Sep 17 00:00:00 2001 From: Nugget Date: Fri, 7 Jun 2024 16:16:02 +0700 Subject: [PATCH 10/16] docker-compose for grafana & prometheus --- Dockerfile | 3 +++ docker-compose.yaml | 25 +++++++++++++++++++++++++ grafana/datasource.yml | 9 +++++++++ prometheus/prometheus.yml | 28 ++++++++++++++++++++++++++++ scripts/sequoia.sh | 16 ++++++++-------- 5 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 docker-compose.yaml create mode 100644 grafana/datasource.yml create mode 100644 prometheus/prometheus.yml diff --git a/Dockerfile b/Dockerfile index ff8b44d..8915e38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM golang:1.21 +RUN apt update +RUN apt install yq -y + ADD . sequoia WORKDIR sequoia diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0fed863 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,25 @@ +services: + prometheus: + image: prom/prometheus + container_name: prometheus + command: + - "--config.file=/etc/prometheus/prometheus.yml" + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - ./prometheus:/etc/prometheus + - prom_data:/prometheus + grafana: + image: grafana/grafana + container_name: grafana + ports: + - 3000:3000 + restart: unless-stopped + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=admin + volumes: + - ./grafana:/etc/grafana/provisioning/datasources +volumes: + prom_data: diff --git a/grafana/datasource.yml b/grafana/datasource.yml new file mode 100644 index 0000000..d019293 --- /dev/null +++ b/grafana/datasource.yml @@ -0,0 +1,9 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + url: http://172.20.0.3:9090 + isDefault: true + access: proxy + editable: true diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..f5d510a --- /dev/null +++ b/prometheus/prometheus.yml @@ -0,0 +1,28 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + +# Alertmanager configuration +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + - job_name: "sequoia-prometheus" + static_configs: + - targets: ["localhost:3334"] + + - job_name: "prometheus-test" + static_configs: + - targets: ["localhost:8090"] diff --git a/scripts/sequoia.sh b/scripts/sequoia.sh index b295e39..291293e 100755 --- a/scripts/sequoia.sh +++ b/scripts/sequoia.sh @@ -1,13 +1,13 @@ sequoia init -# yq -i '.proof_interval=120' $PROV_HOME/config.yaml -# yq -i '.queue_interval=7' $PROV_HOME/config.yaml -# yq -i '.chain_config.rpc_addr="http://localhost:26657"' $PROV_HOME/config.yaml -# yq -i '.chain_config.grpc_addr="localhost:9090"' $PROV_HOME/config.yaml -# yq -i '.domain="http://localhost:3334"' $PROV_HOME/config.yaml -# yq -i '.data_directory="'$PROV_HOME'/data"' $PROV_HOME/config.yaml -# yq -i '.api_config.port=3334' $PROV_HOME/config.yaml -# +yq -i '.proof_interval=120' /root/.sequoia/config.yaml -y +yq -i '.queue_interval=7' /root/.sequoia/config.yaml -y +yq -i '.chain_config.rpc_addr="http://jackal-testnet-rpc.polkachu.com:443"' /root/.sequoia/config.yaml -y +yq -i '.chain_config.grpc_addr="jkl.grpc.t2.stavr.tech:5913"' /root/.sequoia/config.yaml -y +yq -i '.domain="http://localhost:3334"' /root/.sequoia/config.yaml -y +yq -i '.data_directory="/root/.sequoia/data"' /root/.sequoia/config.yaml -y +yq -i '.api_config.port=3334' /root/.sequoia/config.yaml -y + rm /root/.sequoia/provider_wallet.json echo "{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" > /root/.sequoia/provider_wallet.json From 76fae281df26ce8322cc48ba715b08f1de36976f Mon Sep 17 00:00:00 2001 From: Nugget Date: Wed, 12 Jun 2024 15:45:28 +0700 Subject: [PATCH 11/16] updated Dockerfile --- Dockerfile | 13 +++++++++++-- scripts/sequoia.sh | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8915e38..540171b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,18 @@ ADD . sequoia WORKDIR sequoia -RUN make install +# RUN make install -RUN ./scripts/sequoia.sh +COPY go.mod go.sum ./ +RUN go mod download +RUN go get + +COPY *.go ./ + +RUN CGO_ENABLED=0 GOOS=linux go build -o /sequoia + + +# RUN ./scripts/sequoia.sh CMD ["testrun""] diff --git a/scripts/sequoia.sh b/scripts/sequoia.sh index 291293e..0fed1e9 100755 --- a/scripts/sequoia.sh +++ b/scripts/sequoia.sh @@ -2,7 +2,7 @@ sequoia init yq -i '.proof_interval=120' /root/.sequoia/config.yaml -y yq -i '.queue_interval=7' /root/.sequoia/config.yaml -y -yq -i '.chain_config.rpc_addr="http://jackal-testnet-rpc.polkachu.com:443"' /root/.sequoia/config.yaml -y +yq -i '.chain_config.rpc_addr="https://jackal-t-rpc.noders.services:443"' /root/.sequoia/config.yaml -y yq -i '.chain_config.grpc_addr="jkl.grpc.t2.stavr.tech:5913"' /root/.sequoia/config.yaml -y yq -i '.domain="http://localhost:3334"' /root/.sequoia/config.yaml -y yq -i '.data_directory="/root/.sequoia/data"' /root/.sequoia/config.yaml -y From d668ca223f68265c24a055617f0f6daaf9bb8cdd Mon Sep 17 00:00:00 2001 From: Nugget Date: Fri, 14 Jun 2024 15:24:24 +0700 Subject: [PATCH 12/16] alright, docker image works now --- Dockerfile | 9 +-------- scripts/sequoia.sh | 2 ++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 540171b..18337ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,18 +7,11 @@ ADD . sequoia WORKDIR sequoia -# RUN make install - COPY go.mod go.sum ./ RUN go mod download -RUN go get COPY *.go ./ RUN CGO_ENABLED=0 GOOS=linux go build -o /sequoia - -# RUN ./scripts/sequoia.sh - - -CMD ["testrun""] +CMD ["sh", "scripts/sequoia.sh"] diff --git a/scripts/sequoia.sh b/scripts/sequoia.sh index 0fed1e9..cd0175c 100755 --- a/scripts/sequoia.sh +++ b/scripts/sequoia.sh @@ -1,3 +1,5 @@ +make install + sequoia init yq -i '.proof_interval=120' /root/.sequoia/config.yaml -y From b23a4b30be5d72f19921876bbf8801d5055a56de Mon Sep 17 00:00:00 2001 From: Nugget Date: Tue, 18 Jun 2024 16:24:35 +0700 Subject: [PATCH 13/16] add ENV var for seed phrase --- scripts/sequoia.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/sequoia.sh b/scripts/sequoia.sh index cd0175c..007b9f5 100755 --- a/scripts/sequoia.sh +++ b/scripts/sequoia.sh @@ -12,6 +12,8 @@ yq -i '.api_config.port=3334' /root/.sequoia/config.yaml -y rm /root/.sequoia/provider_wallet.json -echo "{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" > /root/.sequoia/provider_wallet.json +# echo "{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" > /root/.sequoia/provider_wallet.json + +echo $SEED_PHRASE > /root/.sequoia/provider_wallet.json sequoia start From 9444d25ca48c713d524884f56f7ba0db1c937cc9 Mon Sep 17 00:00:00 2001 From: Nugget Date: Tue, 18 Jun 2024 16:48:37 +0700 Subject: [PATCH 14/16] env for docker compose --- .env | 1 + Docker_notes.md | 9 +++++++++ docker-compose.yaml | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 .env create mode 100644 Docker_notes.md diff --git a/.env b/.env new file mode 100644 index 0000000..b462b7d --- /dev/null +++ b/.env @@ -0,0 +1 @@ +SEED_PHRASE="{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" diff --git a/Docker_notes.md b/Docker_notes.md new file mode 100644 index 0000000..be227b0 --- /dev/null +++ b/Docker_notes.md @@ -0,0 +1,9 @@ +Running sequoia docker image + +export SEED_PHRASE="{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" + +docker run --env SEED_PHRASE sequoia:latest + +Running docker compose +Replace with your seed phrase in .env +then run `docker compose up` diff --git a/docker-compose.yaml b/docker-compose.yaml index 0fed863..588f67f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -21,5 +21,12 @@ services: - GF_SECURITY_ADMIN_PASSWORD=admin volumes: - ./grafana:/etc/grafana/provisioning/datasources + sequoia: + image: jackalnugget/sequoia + container_name: sequoia + restart: unless-stopped + environment: + - SEED_PHRASE=${SEED_PHRASE} + volumes: prom_data: From 0cb3ed986569097fb9f5715d3db46d96a98970d7 Mon Sep 17 00:00:00 2001 From: Nugget Date: Tue, 25 Jun 2024 15:51:50 +0700 Subject: [PATCH 15/16] expose sequoia port --- Dockerfile | 2 ++ docker-compose.yaml | 2 ++ prometheus/prometheus.yml | 9 +++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 18337ec..10420c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,6 @@ COPY *.go ./ RUN CGO_ENABLED=0 GOOS=linux go build -o /sequoia +EXPOSE 3334 + CMD ["sh", "scripts/sequoia.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 588f67f..0828cdc 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -24,6 +24,8 @@ services: sequoia: image: jackalnugget/sequoia container_name: sequoia + ports: + - 3334:3334 restart: unless-stopped environment: - SEED_PHRASE=${SEED_PHRASE} diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index f5d510a..36a717c 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -21,8 +21,9 @@ rule_files: scrape_configs: - job_name: "sequoia-prometheus" static_configs: - - targets: ["localhost:3334"] + # - targets: ["localhost:3334"] + - targets: ["host.docker.internal:3334"] - - job_name: "prometheus-test" - static_configs: - - targets: ["localhost:8090"] + # - job_name: "prometheus-test" + # static_configs: + # - targets: ["localhost:8090"] From 5ea1c76f386c0b305d393721e6ec28f71367267d Mon Sep 17 00:00:00 2001 From: Nugget Date: Tue, 25 Jun 2024 15:52:04 +0700 Subject: [PATCH 16/16] added instruction and example dashboard --- Docker_notes.md | 34 ++- example_sequoia_dashboard.json | 471 +++++++++++++++++++++++++++++++++ 2 files changed, 499 insertions(+), 6 deletions(-) create mode 100644 example_sequoia_dashboard.json diff --git a/Docker_notes.md b/Docker_notes.md index be227b0..a36601b 100644 --- a/Docker_notes.md +++ b/Docker_notes.md @@ -1,9 +1,31 @@ -Running sequoia docker image +# Get started +Docker +- Replace with your seed phrase in .env +- then run `docker compose up` + +Setting up Grafana +- Go to http://localhost:3000 +- u:admin p:admin +- Connections > Add new connections +- Search 'Prometheus' > Select it +- Click 'Add new data source' (blue button) +- Connection | Prometheus server URL *: `http://prometheus:9090` +- Click 'Save & test' + +Setting up Dashboard +- Dashboards > New (dropdown) > Import +- Select `example_sequoia_dashboard.json` +- Select the Data Source you added earlier +- Click Import + + -export SEED_PHRASE="{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" -docker run --env SEED_PHRASE sequoia:latest -Running docker compose -Replace with your seed phrase in .env -then run `docker compose up` + + +## Running sequoia docker image (for testing docker img) + +export SEED_PHRASE="{\"seed_phrase\":\"forward service profit benefit punch catch fan chief jealous steel harvest column spell rude warm home melody hat broccoli pulse say garlic you firm\",\"derivation_path\":\"m/44'/118'/0'/0/0\"}" + +docker run -p 3334:3334 --env SEED_PHRASE sequoia:latest \ No newline at end of file diff --git a/example_sequoia_dashboard.json b/example_sequoia_dashboard.json new file mode 100644 index 0000000..1abbb2f --- /dev/null +++ b/example_sequoia_dashboard.json @@ -0,0 +1,471 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.4.2" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 5, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sequoia_file_count", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "File count", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 5, + "x": 5, + "y": 0 + }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sequoia_block_height", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Block height", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 9, + "x": 10, + "y": 0 + }, + "id": 4, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sequoia_current_proofs_processing", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Current Proof Processing", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 5, + "x": 19, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sequoia_balance", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "JKL Balance", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 10, + "x": 0, + "y": 8 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sequoia_queue_size", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Queue Size", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Sequoia Dashboard", + "uid": "bdlrlyk2mnd34c", + "version": 5, + "weekStart": "" +} \ No newline at end of file