27 lines
726 B
Go
27 lines
726 B
Go
package api
|
|
|
|
import (
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func (h *Handler) RegisterRoutes(r *mux.Router) {
|
|
// Rotas de blocos
|
|
r.HandleFunc("/blocks", h.ListBlocks).Methods("GET")
|
|
r.HandleFunc("/blocks/{height}", h.GetBlockByHeight).Methods("GET")
|
|
|
|
// Rotas de staking
|
|
r.HandleFunc("/stake", h.Stake).Methods("POST")
|
|
r.HandleFunc("/unstake", h.Unstake).Methods("POST")
|
|
r.HandleFunc("/stake-info", h.GetStakeInfo).Methods("GET")
|
|
|
|
// Rotas de transações
|
|
r.HandleFunc("/tx", h.SubmitTransaction).Methods("POST")
|
|
r.HandleFunc("/tx/{hash}", h.GetTransaction).Methods("GET")
|
|
|
|
// Rotas de consenso
|
|
r.HandleFunc("/consensus", h.HandleConsensus).Methods("POST")
|
|
|
|
// Health check
|
|
r.HandleFunc("/ping", h.Ping).Methods("GET")
|
|
}
|