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/cad/017_peerops/README.md
+47-11
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@
4
4
5
5
Operating a peer is an important responsibility in the Convex Network.
6
6
7
-
Anyone can run a peer, and they are responsible for maintaining the Consensus of the Network.
7
+
Anyone can run a peer, and they are responsible for maintaining the Consensus of the Network. They must place a minimum stake of 1000 Convex Coins.
8
8
9
-
Most users of the Convex Network do not need to run a peer - they connect to peers via clients software that submits transactions and queries information on their behalf.
9
+
Most users of the Convex Network do not need to run a peer - they connect to peers via client software that submits transactions and queries information on their behalf. The peer API is open to client requests by default: Peer operators who wish to restrict this may need to set up additional configuration or infrastructure.
10
10
11
11
This document primarily contains recommendations for peer operators
12
12
@@ -15,32 +15,54 @@ This document primarily contains recommendations for peer operators
15
15
Running a Peer requires:
16
16
17
17
- An Internet-connected Server
18
-
- At least 100 MBits/sec continuous bandwidth
18
+
- At least 100 MBits/sec continuous network bi-directional bandwidth
19
19
- A modern processor with at least 8 dedicated Cores
20
-
- At least 8 GB RAM (32 Gb Recommended)
21
-
- At least 2 TB fast Storage (NVMe Recommended)
20
+
- At least 8 GB RAM (32 GB Recommended)
21
+
- At least 1 TB fast Storage (NVMe Recommended)
22
22
- A secure modern operating system (Linux recommended) with good support for memory mapped files
23
23
- Java 21 or above
24
24
25
25
The network should be configured with:
26
-
- a publicly accessible IP address (IPv4 or IPv6)
26
+
- a publicly accessible IP address (IPv4 or IPv6). Dual stack networking support is required in the OS.
27
27
- firewall access to the server via TCP on a chosen port (the Convex protocol default `18888` is recommended)
28
-
- a trusted DNS entry (e.g. `peer.mycompany.com`)
28
+
- a trusted DNS entry (e.g. `peer.mycompany.com`) is recommended
29
+
- HTTPS certificates recommended for the HTTPS REST API
29
30
30
31
The DNS entry is optional, but it will help significantly with discoverability / user access to your peer.
31
32
32
33
## Configuration
33
34
35
+
### Accounts
36
+
37
+
In order to operate a peer you will need a Peer Controller account. This can be any account on the Convex network, e.g. `#1678` with at least 1000 Convex Coins.
38
+
34
39
### Peer Config
35
40
36
41
Peers can be configured at launch in various ways.
37
42
38
-
Peers SHOULD configure the number of concurrent outgoing Peer connections according to their available bandwidth. 20 recommended for Peers with fast connections.
43
+
#### Outgoing connections
44
+
45
+
Peers MAY configure the number of concurrent outgoing Peer connections according to their available bandwidth. 20 (the default) recommended for Peers with sufficient outgoing bandwidth. There are trade-offs here:
46
+
- With more outgoing connections, your transactions will reach consensus faster
47
+
- You must weight this up against bandwidth costs
48
+
- If the number is too low your published blocks may get lost if the destinations do not relay them.
49
+
50
+
TODO: describe mechanism to set connection count controls
39
51
40
52
41
53
42
54
## Startup
43
55
56
+
## Syncing
57
+
58
+
Your peer will need to synchronize with teh network by connecting to at least one existing peer.
59
+
60
+
The following peers are available at time of writing for synchronisation:
61
+
```
62
+
peer.convex.live:18888
63
+
```
64
+
65
+
TODO: CLI commend top start peer with target host
44
66
45
67
## Shutdown
46
68
@@ -56,7 +78,9 @@ It may occur that a peer becomes temporarily disconnected from the peer network.
56
78
57
79
Peers are designed to automatically recover from temporary network failure and re-establish connections when possible. Peers with normal configuration SHOULD periodically re-attempt to connect with other peers randomly until connection with the Network is re-established.
58
80
59
-
Peer Operators SHOULD provide for an alternative way to connect to the main network, if only for the purposes of withrawing the Peer's Stake (Peers are at risk of penalisation if they remain disconnected for too long).
81
+
Peer Operators SHOULD provide for an alternative way to connect to the main network, if only for the purposes of withdrawing the Peer's Stake. For example, a peer operator may monitor the connectivity of their peer and use Convex Desktop to de-stake the peer if it loses connections.
82
+
83
+
TODO: describe best way to monitor this. Perhaps API peer health endpoint?
60
84
61
85
### Security Breach
62
86
@@ -68,22 +92,34 @@ Peer Operators SHOULD attempt to withdraw their Stake immediately, possibly thro
68
92
69
93
Peers are required to post a Peer Stake to participate in consensus.
70
94
95
+
### Setting a stake
96
+
97
+
### Withdrawing stake
98
+
99
+
### Stake penalties
100
+
101
+
In Protonet, there is no slashing of stake (i.e. peers are not formally penalised for incorrect behaviour).
102
+
103
+
In the future peers may be automatically penalised for provably incorrect behaviour.
104
+
71
105
## Key Management
72
106
73
107
## Connection Management
74
108
75
109
A Convex Peer is designed to automatically manage P2P connections to the Network during normal operations. In most cases, assuming good network connectivity, a Peer should require no manual intervention to control connections to other Peers.
76
110
111
+
112
+
77
113
### Incoming Connections
78
114
79
-
Peers treat incoming connections as regular Clients, i.e. they afford no particular special priviledges to incoming connections from other Peers. The purpose of this is to ensure that Bad Peers have no particular ability to influence a Peer that they connect to.
115
+
Peers treat incoming connections as regular Clients, i.e. they afford no particular special privileges to incoming connections from other Peers. The purpose of this is to ensure that Bad Peers have no particular ability to influence a Peer that they connect to.
80
116
81
117
### Outgoing connections
82
118
83
119
A Peer maintains a managed list of outgoing connections (i.e. connections to which they broadcast their Beliefs).
84
120
85
121
Outgoing connections follow the following rules:
86
-
-**Validated hosts**: Peers MUST only connect to Peers accesible on the network via the host address specified for the destination Peer in the current consensus, **or** if they are explicitly instructed to connect to a specific host address by the Peer Operator (e.g. when joining the Network). This minimises the chance of connecting to Bad Peers.
122
+
-**Validated hosts**: Peers MUST only connect to Peers accessible on the network via the host address specified for the destination Peer in the current consensus, **or** if they are explicitly instructed to connect to a specific host address by the Peer Operator (e.g. when joining the Network). This minimises the chance of connecting to Bad Peers.
87
123
-**Random elimination**: Peers SHOULD eliminate connections at random for low-staked Peers. This allows the Peer network to stay dynamic, and give an opportunity for new Peers to be connected to
88
124
-**Stake-weighted selection** Peers MUST connect to other Peers preferentially according to stake, so that Bad Peers do not have a significant chance of isolating a Peer
89
125
-**Target connection count**: Peers should attempt to maintain a number of outgoing connections to Peers as configured by the Peer Operator. This allows Peer Operators to control their bandwidth usage.
0 commit comments