You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/interacting/json-rpc-ns/admin.md
+29-19Lines changed: 29 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ import TabItem from "@theme/TabItem";
9
9
10
10
### admin_addPeer
11
11
12
-
Adds given node.
12
+
Adds the given node as a static peer. The connection is maintained for the lifetime of the process. Set `persistent` to also write the peer to static-nodes.json so it is restored on restart.
13
13
14
14
<Tabs>
15
15
<TabItemvalue="params"label="Parameters">
16
16
17
17
1.`enode`: _string_
18
18
19
-
2.`addToStaticNodes`: _boolean_
19
+
2.`persistent`: _boolean_
20
20
21
21
22
22
</TabItem>
@@ -30,14 +30,14 @@ curl localhost:8545 \
30
30
"jsonrpc": "2.0",
31
31
"id": 0,
32
32
"method": "admin_addPeer",
33
-
"params": [enode, addToStaticNodes]
33
+
"params": [enode, persistent]
34
34
}'
35
35
```
36
36
37
37
</TabItem>
38
38
<TabItemvalue="response"label="Response">
39
39
40
-
Added node
40
+
`true` if the peer is in the static set after the call.
41
41
42
42
```json
43
43
{
@@ -47,20 +47,22 @@ Added node
47
47
}
48
48
```
49
49
50
-
`result`: _string_
50
+
`result`: _boolean_
51
51
52
52
</TabItem>
53
53
</Tabs>
54
54
55
55
### admin_addTrustedPeer
56
56
57
-
Adds given node as a trusted peer, allowing the node to always connect even if slots are full.
57
+
Adds the given node to the trusted peer set so it can always connect even when slots are full. Set `persistent` to also write the peer to trusted-nodes.json so it is restored on restart.
58
58
59
59
<Tabs>
60
60
<TabItemvalue="params"label="Parameters">
61
61
62
62
1.`enode`: _string_
63
63
64
+
2.`persistent`: _boolean_
65
+
64
66
65
67
</TabItem>
66
68
<TabItemvalue="request"label="Request"default>
@@ -73,14 +75,14 @@ curl localhost:8545 \
73
75
"jsonrpc": "2.0",
74
76
"id": 0,
75
77
"method": "admin_addTrustedPeer",
76
-
"params": [enode]
78
+
"params": [enode, persistent]
77
79
}'
78
80
```
79
81
80
82
</TabItem>
81
83
<TabItemvalue="response"label="Response">
82
84
83
-
Boolean indicating success
85
+
`true` if the peer is in the trusted set after the call.
Removes the given node from the static peer set and disconnects any active session. Set `persistent` to also remove the peer from static-nodes.json so it is not restored on restart.
567
575
568
576
<Tabs>
569
577
<TabItemvalue="params"label="Parameters">
570
578
571
579
1.`enode`: _string_
572
580
573
-
2.`removeFromStaticNodes`: _boolean_
581
+
2.`persistent`: _boolean_
574
582
575
583
576
584
</TabItem>
@@ -584,14 +592,14 @@ curl localhost:8545 \
584
592
"jsonrpc": "2.0",
585
593
"id": 0,
586
594
"method": "admin_removePeer",
587
-
"params": [enode, removeFromStaticNodes]
595
+
"params": [enode, persistent]
588
596
}'
589
597
```
590
598
591
599
</TabItem>
592
600
<TabItemvalue="response"label="Response">
593
601
594
-
Removed node
602
+
`true` if the input enode was valid and the removal was attempted.
595
603
596
604
```json
597
605
{
@@ -601,20 +609,22 @@ Removed node
601
609
}
602
610
```
603
611
604
-
`result`: _string_
612
+
`result`: _boolean_
605
613
606
614
</TabItem>
607
615
</Tabs>
608
616
609
617
### admin_removeTrustedPeer
610
618
611
-
Removes the given node from the trusted peers list.
619
+
Removes the given node from the trusted peer set. Set `persistent` to also remove the peer from trusted-nodes.json so it is not re-trusted on restart.
612
620
613
621
<Tabs>
614
622
<TabItemvalue="params"label="Parameters">
615
623
616
624
1.`enode`: _string_
617
625
626
+
2.`persistent`: _boolean_
627
+
618
628
619
629
</TabItem>
620
630
<TabItemvalue="request"label="Request"default>
@@ -627,14 +637,14 @@ curl localhost:8545 \
627
637
"jsonrpc": "2.0",
628
638
"id": 0,
629
639
"method": "admin_removeTrustedPeer",
630
-
"params": [enode]
640
+
"params": [enode, persistent]
631
641
}'
632
642
```
633
643
634
644
</TabItem>
635
645
<TabItemvalue="response"label="Response">
636
646
637
-
Boolean indicating success
647
+
`true` if the input enode was valid and the removal was attempted.
0 commit comments