address PR comments

This commit is contained in:
sukantoraymond
2023-04-12 19:23:41 -04:00
parent 7a9019c09f
commit 8e8a78d6f2
2 changed files with 40 additions and 6 deletions
+16 -1
View File
@@ -436,7 +436,6 @@ avalanche-network-runner control add-node \
```
To pause a node (in this case, node named `node99`):
Resume by calling `restart-node`
```bash
# e.g., ${HOME}/go/src/github.com/ava-labs/avalanchego/build/avalanchego
AVALANCHEGO_EXEC_PATH="avalanchego"
@@ -452,6 +451,22 @@ avalanche-network-runner control pause-node \
--node-name node99
```
To resume a paused node (in this case, node named `node99`):
```bash
# e.g., ${HOME}/go/src/github.com/ava-labs/avalanchego/build/avalanchego
AVALANCHEGO_EXEC_PATH="avalanchego"
curl -X POST -k http://localhost:8081/v1/control/resumenode -d '{"name":"node99","logLevel":"INFO"}'
# or
avalanche-network-runner control resume-node \
--request-timeout=3m \
--log-level debug \
--endpoint="0.0.0.0:8080" \
--node-name node99
```
You can also provide additional flags that specify the node's config:
```sh
+24 -5
View File
@@ -55,6 +55,7 @@ var (
newNodeName2 = "test-add-node2"
newNode2NodeID = ""
pausedNodeURI = ""
pausedNodeName = "node1"
customNodeConfigs = map[string]string{
"node1": `{"api-admin-enabled":true}`,
"node2": `{"api-admin-enabled":true}`,
@@ -505,7 +506,9 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
cancel()
gomega.Ω(err).Should(gomega.BeNil())
// get paused node URI for pause node test later
pausedNodeURI = resp.ClusterInfo.NodeInfos["node1"].Uri
_, ok := resp.ClusterInfo.NodeInfos[pausedNodeName]
gomega.Ω(ok).Should(gomega.Equal(true))
pausedNodeURI = resp.ClusterInfo.NodeInfos[pausedNodeName].Uri
})
ginkgo.It("can poll status", func() {
@@ -678,7 +681,7 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
ginkgo.By("calling PauseNode", func() {
ux.Print(log, logging.Green.Wrap("calling 'pause-node'"))
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
resp, err := cli.PauseNode(ctx, "node1")
resp, err := cli.PauseNode(ctx, pausedNodeName)
cancel()
gomega.Ω(err).Should(gomega.BeNil())
ux.Print(log, logging.Green.Wrap("successfully paused, node-names: %s"), resp.ClusterInfo.NodeNames)
@@ -689,12 +692,20 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
cancel()
gomega.Ω(err).Should(gomega.HaveOccurred())
})
ginkgo.By("calling restart API", func() {
ginkgo.By("API Call using paused node URI will fail", func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
cancel()
platformCli := platformvm.NewClient(pausedNodeURI)
_, err := platformCli.GetCurrentValidators(ctx, ids.Empty, nil)
gomega.Ω(err).Should(gomega.HaveOccurred())
})
ginkgo.By("calling resumeNode API", func() {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
resp, err := cli.RestartNode(ctx, "node1", client.WithExecPath(execPath1))
resp, err := cli.ResumeNode(ctx, pausedNodeName)
cancel()
gomega.Ω(err).Should(gomega.BeNil())
ux.Print(log, logging.Green.Wrap("successfully restarted, node-names: %s"), resp.ClusterInfo.NodeNames)
ux.Print(log, logging.Green.Wrap("successfully resumed %s, cluster node-names: %s"), "node1", resp.ClusterInfo.NodeNames)
})
ginkgo.By("can wait for health", func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
@@ -702,6 +713,14 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
cancel()
gomega.Ω(err).Should(gomega.BeNil())
})
ginkgo.By("API Call using resumed node URI", func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
cancel()
platformCli := platformvm.NewClient(pausedNodeURI)
_, err := platformCli.GetCurrentValidators(ctx, ids.Empty, nil)
gomega.Ω(err).Should(gomega.BeNil())
})
})
ginkgo.It("can add primary validator with BLS Keys", func() {