Commit cfec11b1 authored by szh's avatar szh

up

parent ddd99b81
This diff is collapsed.
...@@ -22,6 +22,13 @@ import ( ...@@ -22,6 +22,13 @@ import (
"chain33-pai/pkg/util" "chain33-pai/pkg/util"
) )
// @Summary 重置节点钱包
// @Description 重置节点钱包 无参
// @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/resetwallet [post]
func ResetWallet(c *gin.Context) { func ResetWallet(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
util.AddValue(&app.JobID,1) util.AddValue(&app.JobID,1)
...@@ -29,9 +36,12 @@ func ResetWallet(c *gin.Context) { ...@@ -29,9 +36,12 @@ func ResetWallet(c *gin.Context) {
appG.Response(http.StatusOK, e.SUCCESS, app.JobID) appG.Response(http.StatusOK, e.SUCCESS, app.JobID)
} }
//钱包更新,只替换执行文件和配置文件 // @Summary 节点手动更新
//具体更新逻辑不再代码实现 // @Description 节点手动更新 无参
//oss下载包打包要保持执行权限 // @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/updatenode [post]
func UpdateNodeNew(c *gin.Context) { func UpdateNodeNew(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
app.BityuanFlag.Lock.Lock() app.BityuanFlag.Lock.Lock()
...@@ -152,7 +162,12 @@ func UpdateNodeNew(c *gin.Context) { ...@@ -152,7 +162,12 @@ func UpdateNodeNew(c *gin.Context) {
appG.Response(http.StatusOK, e.SUCCESS, "update job ok") appG.Response(http.StatusOK, e.SUCCESS, "update job ok")
} }
//重置节点只需要删除datadir 然后重启节点 // @Summary 重置节点
// @Description 重置节点 慎用(同步时间长 1周以上)
// @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/reset [post]
func ResetNode(c *gin.Context) { func ResetNode(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
util.AddValue(&app.JobID,1) util.AddValue(&app.JobID,1)
...@@ -168,7 +183,12 @@ func UpdateDetail(c *gin.Context) { ...@@ -168,7 +183,12 @@ func UpdateDetail(c *gin.Context) {
}) })
} }
//get current version and latest version // @Summary 获取当前版本和最新版本
// @Description 获取当前版本和最新版本
// @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/version [post]
func Version(c *gin.Context) { func Version(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
setting.FreshVersion() setting.FreshVersion()
...@@ -187,6 +207,12 @@ func Version(c *gin.Context) { ...@@ -187,6 +207,12 @@ func Version(c *gin.Context) {
}) })
} }
// @Summary 获取节点运行状态
// @Description 获取节点运行状态
// @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/nodeinfo [post]
func NodeInfo(c *gin.Context) { func NodeInfo(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
var client chain33.PaiClient var client chain33.PaiClient
...@@ -198,6 +224,12 @@ func NodeInfo(c *gin.Context) { ...@@ -198,6 +224,12 @@ func NodeInfo(c *gin.Context) {
appG.Response(http.StatusOK, e.SUCCESS, "node is running") appG.Response(http.StatusOK, e.SUCCESS, "node is running")
} }
// @Summary 重启节点
// @Description 重启节点
// @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/restartnode [post]
func RestartNode(c *gin.Context) { func RestartNode(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
util.AddValue(&app.JobID,1) util.AddValue(&app.JobID,1)
...@@ -205,6 +237,12 @@ func RestartNode(c *gin.Context) { ...@@ -205,6 +237,12 @@ func RestartNode(c *gin.Context) {
appG.Response(http.StatusOK, e.SUCCESS, app.JobID) appG.Response(http.StatusOK, e.SUCCESS, app.JobID)
} }
// @Summary 关闭节点
// @Description 关闭节点
// @Accept json
// @Success 200 {object} app.Response
// @Failure 500 {object} app.Response
// @Router /pai/closenode [post]
func CloseNode(c *gin.Context) { func CloseNode(c *gin.Context) {
appG := app.Gin{C: c} appG := app.Gin{C: c}
util.AddValue(&app.JobID,1) util.AddValue(&app.JobID,1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment