Skip to content

feature(net): integrate with libp2p v0.1.2 #5017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ef7c388
feat(net): optimize network log
jwrct Jan 31, 2023
1218d3a
Merge pull request #4950 from chengtx01/hotfix/relay_service
jwrct Jan 31, 2023
856c519
Merge pull request #4951 from wubin01/relay_node
jwrct Jan 31, 2023
d513fd2
support libp2p v0.2
317787106 Feb 13, 2023
e236398
remove ping in KeepAliveService because it exist in libp2p
317787106 Feb 13, 2023
38f6eb0
use libp2p test-v0.2.0; don't add fastForwardNode to activeNodes if a…
317787106 Feb 14, 2023
ced6fce
update PeerConnection
317787106 Feb 15, 2023
1a9ab59
merge release_v4.7.1
317787106 Feb 15, 2023
4413df5
support to read ipv6 address from config file
317787106 Feb 15, 2023
c2b6b80
add some log
317787106 Feb 15, 2023
e3995bf
add some log
317787106 Feb 15, 2023
e3e347e
Merge branch 'release_v4.7.1' into feature/libp2p_v2.0
317787106 Feb 16, 2023
e71b33b
feat(net): remove redundant logic after libp2p upgrade
xxo1shine Feb 22, 2023
cd4ff2c
fix(net): use libp2p test-v0.2.1
317787106 Feb 22, 2023
9f7fd29
Merge branch 'feature/libp2p_v2.0' of https://github.com/tronprotocol…
317787106 Feb 22, 2023
7814317
merge release_v4.7.1
317787106 Feb 23, 2023
6d0fa0e
feat(net): make the node detect function configurable
xxo1shine Feb 24, 2023
17bf1a4
update libp2p version to test-v0.2.2
317787106 Feb 24, 2023
2038efa
merge release_v4.7.1
317787106 Feb 28, 2023
833eb0c
update libp2p from test-v0.2.2 to test-v0.2.3
317787106 Mar 1, 2023
8c72efc
fix(net): add paramater node.dns.staticNodes
317787106 Mar 2, 2023
7b00325
style(net): fix checkstyle warning
317787106 Mar 2, 2023
2016860
feat(net): recover handshake check logic
xxo1shine Mar 6, 2023
5f66f93
fix(net): update libp2p from test-v0.2.4 to test-v0.2.5
317787106 Mar 6, 2023
0f82f22
fix(net): update libp2p from test-v0.2.5 to test-v0.2.6
317787106 Mar 6, 2023
f39f279
update libp2p from test-v0.2.6 to test-v0.2.7
317787106 Mar 6, 2023
7b4c8f3
update libp2p from test-v0.2.7 to test-v0.2.8
317787106 Mar 6, 2023
a21d46d
add two parametres in dns section of config.conf
317787106 Mar 7, 2023
24f6c28
update libp2p from test-v0.2.10 to test-v0.2.11
317787106 Mar 7, 2023
bd8e07e
fix(net): don't filter address in static nodes
317787106 Mar 8, 2023
c104e6a
update libp2p from test-v0.2.11 to test-v0.2.12
317787106 Mar 9, 2023
4bb4f24
fix(db): add a config item: node.enableIpv6
317787106 Mar 9, 2023
6f27050
remove local ipv6 from active nodes
317787106 Mar 10, 2023
b909e3b
update libp2p from test-v0.2.13 to test-v0.2.14
317787106 Mar 13, 2023
53b6d6b
fix(net): set ip to null if node doesn't has ipv4 stack
317787106 Mar 13, 2023
cebdb36
fix(net): use [ipv6]:port instead of ipv6:port
317787106 Mar 14, 2023
72fde48
fix(net): update libp2p from test-v0.2.15 to test-v0.2.16
317787106 Mar 14, 2023
46ea866
fix(net):update libp2p from test-v0.2.16 to test-v0.2.17
317787106 Mar 14, 2023
437ebb1
fix(net): check seed ip's format in class Args
317787106 Mar 14, 2023
dac20fc
fix(net): add some test case
317787106 Mar 16, 2023
83b9741
Merge branch 'release_v4.7.2' into feature/libp2p_v2.0
317787106 Mar 17, 2023
710b345
Merge branch 'release_v4.7.2' into feature/libp2p_v2.0
317787106 Mar 20, 2023
9c98abf
fix(net): merge 4.7.2 and update libp2p
317787106 Mar 20, 2023
dfbad70
fix(net): merge release_v4.7.2
317787106 Mar 23, 2023
da20e79
Merge branch 'release_v4.7.2' into feature/libp2p_v2.0
317787106 Mar 28, 2023
06b814e
fix(net):don't start program if some dns patameter is empty
317787106 Mar 29, 2023
7f8fbfe
merge release_v4.7.2
317787106 Mar 29, 2023
cf3dfd2
fix(net):revert log level of net to info
317787106 Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,3 @@ gradle.buildFinished {
}
}
}

1 change: 1 addition & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dependencies {
compile 'org.aspectj:aspectjrt:1.8.13'
compile 'org.aspectj:aspectjweaver:1.8.13'
compile 'org.aspectj:aspectjtools:1.8.13'
compile group: 'com.github.tronprotocol', name: 'libp2p', version: 'test-v0.2.19'
compile project(":protocol")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.tron.core.config.args.Overlay;
import org.tron.core.config.args.SeedNode;
import org.tron.core.config.args.Storage;
import org.tron.p2p.dns.update.PublishConfig;

public class CommonParameter {

Expand Down Expand Up @@ -188,6 +189,16 @@ public class CommonParameter {
@Getter
@Setter
public String p2pNodeId;
@Getter
@Setter
public boolean nodeEnableIpv6 = false;
@Getter
@Setter
public List<String> dnsTreeUrls;
@Getter
@Setter
public PublishConfig dnsPublishConfig;

//If you are running a solidity node for java tron, this flag is set to true
@Getter
@Setter
Expand Down Expand Up @@ -322,6 +333,9 @@ public class CommonParameter {
public boolean isOpenFullTcpDisconnect;
@Getter
@Setter
public boolean nodeDetectEnable;
@Getter
@Setter
public int allowMultiSign;
@Getter
@Setter
Expand Down
18 changes: 18 additions & 0 deletions common/src/main/java/org/tron/core/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ public class Constant {

public static final String NODE_P2P_PING_INTERVAL = "node.p2p.pingInterval";
public static final String NODE_P2P_VERSION = "node.p2p.version";
public static final String NODE_ENABLE_IPV6 = "node.enableIpv6";
public static final String NODE_DNS_TREE_URLS = "node.dns.treeUrls";
public static final String NODE_DNS_PUBLISH = "node.dns.publish";
public static final String NODE_DNS_DOMAIN = "node.dns.dnsDomain";
public static final String NODE_DNS_CHANGE_THRESHOLD = "node.dns.changeThreshold";
public static final String NODE_DNS_MAX_MERGE_SIZE = "node.dns.maxMergeSize";
public static final String NODE_DNS_PRIVATE = "node.dns.dnsPrivate";
public static final String NODE_DNS_KNOWN_URLS = "node.dns.knownUrls";
public static final String NODE_DNS_STATIC_NODES = "node.dns.staticNodes";
public static final String NODE_DNS_SERVER_TYPE = "node.dns.serverType";
public static final String NODE_DNS_ACCESS_KEY_ID = "node.dns.accessKeyId";
public static final String NODE_DNS_ACCESS_KEY_SECRET = "node.dns.accessKeySecret";
public static final String NODE_DNS_ALIYUN_ENDPOINT = "node.dns.aliyunDnsEndpoint";
public static final String NODE_DNS_AWS_REGION = "node.dns.awsRegion";
public static final String NODE_DNS_AWS_HOST_ZONE_ID = "node.dns.awsHostZoneId";

public static final String NODE_RPC_PORT = "node.rpc.port";
public static final String NODE_RPC_SOLIDITY_PORT = "node.rpc.solidityPort";
public static final String NODE_RPC_PBFT_PORT = "node.rpc.PBFTPort";
Expand Down Expand Up @@ -175,6 +191,8 @@ public class Constant {

public static final String NODE_IS_OPEN_FULL_TCP_DISCONNECT = "node.isOpenFullTcpDisconnect";

public static final String NODE_DETECT_ENABLE = "node.nodeDetectEnable";

public static final String NODE_MAX_TRANSACTION_PENDING_SIZE = "node.maxTransactionPendingSize";

public static final String NODE_PENDING_TRANSACTION_TIMEOUT = "node.pendingTransactionTimeout";
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/java/org/tron/core/config/args/SeedNode.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.tron.core.config.args;

import java.net.InetSocketAddress;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
Expand All @@ -8,5 +9,5 @@ public class SeedNode {

@Getter
@Setter
private List<String> ipList;
private List<InetSocketAddress> addressList;
}
2 changes: 0 additions & 2 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ dependencies {

compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'

compile group: 'io.github.tronprotocol', name: 'libp2p', version: '0.1.4'

compile group: 'com.typesafe', name: 'config', version: '1.3.2'

compile "com.cedarsoftware:java-util:1.8.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public Message(UdpMessageTypeEnum type, byte[] data) {

public static Node getNode(Endpoint endpoint) {
Node node = new Node(endpoint.getNodeId().toByteArray(),
ByteArray.toStr(endpoint.getAddress().toByteArray()), endpoint.getPort());
ByteArray.toStr(endpoint.getAddress().toByteArray()),
ByteArray.toStr(endpoint.getAddressIpv6().toByteArray()), endpoint.getPort());
return node;
}

Expand Down
3 changes: 2 additions & 1 deletion framework/src/main/java/org/tron/core/Wallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,8 @@ public NodeList listNodes() {
nodeListBuilder.addNodes(Node.newBuilder().setAddress(
Address.newBuilder()
.setHost(ByteString
.copyFrom(ByteArray.fromString(node.getHost())))
.copyFrom(ByteArray.fromString(
node.getPreferInetSocketAddress().getAddress().getHostAddress())))
.setPort(node.getPort())));
});
}
Expand Down
Loading