/ types / p2p.yaml
p2p.yaml
 1  NetworkIdentity:
 2    type: object
 3    properties:
 4      peer_id:
 5        $ref: "./p2p.yaml#/PeerId"
 6      enr:
 7        $ref: "./p2p.yaml#/ENR"
 8      p2p_addresses:
 9        type: array
10        items:
11          allOf:
12            - $ref: "./p2p.yaml#/Multiaddr"
13            - description: "Node's addresses on which eth2 rpc requests are served. [Read more](https://docs.libp2p.io/reference/glossary/#multiaddr)"
14      discovery_addresses:
15        type: array
16        items:
17          allOf:
18            - $ref: "./p2p.yaml#/Multiaddr"
19            - description: "Node's addresses on which is listening for discv5 requests. [Read more](https://docs.libp2p.io/reference/glossary/#multiaddr)"
20            - example: "/ip4/7.7.7.7/udp/30303/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
21      metadata:
22        $ref: "./p2p.yaml#/MetaData"
23  
24  MetaData:
25    type: object
26    description: "Based on eth2 [Metadata object](https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#metadata)"
27    properties:
28      seq_number:
29        allOf:
30          - description: "Uint64 starting at 0 used to version the node's metadata. If any other field in the local MetaData changes, the node MUST increment seq_number by 1."
31          - $ref: "./primitive.yaml#/Uint64"
32      attnets:
33        allOf:
34          - description: "Bitvector representing the node's persistent attestation subnet subscriptions."
35          - $ref: "./primitive.yaml#/Hex"
36          - example: "0x0000000000000000"
37      syncnets:
38        allOf:
39          - description: "Bitvector representing the node's sync committee subnet subscriptions. This metadata is not present in phase0, but will be present in Altair."
40          - $ref: "./primitive.yaml#/Hex"
41          - example: "0x0f"
42          - required: false
43  
44  Peer:
45    type: object
46    properties:
47      peer_id:
48        $ref: "./p2p.yaml#/PeerId"
49      enr:
50        allOf:
51          - $ref: "./p2p.yaml#/ENR"
52          - nullable: true
53      last_seen_p2p_address:
54        allOf:
55          - $ref: "./p2p.yaml#/Multiaddr"
56          - description: Multiaddrs used in last peer connection.
57      state:
58        $ref: "./p2p.yaml#/PeerConnectionState"
59      direction:
60        $ref: "./p2p.yaml#/PeerConnectionDirection"
61  
62  PeerConnectionState:
63    type: string
64    enum: ["disconnected", "connecting", "connected", "disconnecting"]
65  
66  PeerConnectionDirection:
67    type: string
68    enum: ["inbound", "outbound"]
69  
70  PeerId:
71    type: string
72    description: "Cryptographic hash of a peer’s public key. [Read more](https://docs.libp2p.io/concepts/peer-id/)"
73    example: "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
74  
75  ENR:
76    type: string
77    description: "Ethereum node record. [Read more](https://eips.ethereum.org/EIPS/eip-778)"
78    example: "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8"
79  
80  Multiaddr:
81    type: string
82    description: "[Read more](https://docs.libp2p.io/reference/glossary/#multiaddr)"
83    example: "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"