I need to update the socketAddress + transportLayer (udp or tcp) on the localNodeRecord through the DiscoverySystem separately:
- socket + udp port
- socket + tcp port
I initialize the LocalNodeRecord using:
public NodeRecordBuilder address(String ipAddress, int udpPort, int tcpPort)
So the NodeRecord created will have a EnrField "ip6" or "ip" as a Bytes and a EnrField "udp6" or "udp" as a Integer and eventually a EnrField
"tcp6" or "tcp" as a Integer:
- Here if I just want to set only the udp port or tcp port I can't. So I should use:
public NodeRecordBuilder customField(String fieldName, Bytes value)
And the value will be a Bytes whereas if I go with the above option the port will be a Integer.
Let say that I initialize the localNodeRecord using the builder and the address method and then I need to change the socketAddress and its corresponding transport protocol I would have to use this method:
public void updateCustomFieldValue(String fieldName, Bytes value) that does not accept Integer just Bytes so I would add the Port that was originally an Integer and now would have to be a Bytes.
The localNodeRecord is updated but then if a toString is called on the NodeRecord it will end up failing here:
org.ethereum.beacon.discovery.schema.IdentitySchemaV4Interpreter:
private static Optional<InetSocketAddress> addressFromFields(NodeRecord nodeRecord, String ipField, String portField) on line 123 as it is
expecting a Integer for a Port and now it has a Bytes.
I need to update the socketAddress + transportLayer (udp or tcp) on the localNodeRecord through the DiscoverySystem separately:
I initialize the LocalNodeRecord using:
public NodeRecordBuilder address(String ipAddress, int udpPort, int tcpPort)So the NodeRecord created will have a EnrField "ip6" or "ip" as a Bytes and a EnrField "udp6" or "udp" as a Integer and eventually a EnrField
"tcp6" or "tcp" as a Integer:
public NodeRecordBuilder customField(String fieldName, Bytes value)And the value will be a Bytes whereas if I go with the above option the port will be a Integer.
Let say that I initialize the localNodeRecord using the builder and the address method and then I need to change the socketAddress and its corresponding transport protocol I would have to use this method:
public void updateCustomFieldValue(String fieldName, Bytes value)that does not accept Integer just Bytes so I would add the Port that was originally an Integer and now would have to be a Bytes.The localNodeRecord is updated but then if a toString is called on the NodeRecord it will end up failing here:
org.ethereum.beacon.discovery.schema.IdentitySchemaV4Interpreter:
private static Optional<InetSocketAddress> addressFromFields(NodeRecord nodeRecord, String ipField, String portField)on line 123 as it isexpecting a Integer for a Port and now it has a Bytes.