From 599b4968a7f2978a32d7fd14939b61ad02e571e2 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Thu, 26 Oct 2023 18:04:12 +0200 Subject: [PATCH] Move NetworkId to network.identity module --- bonded_roles/build.gradle | 1 + .../bonded_role/AuthorizedBondedRole.java | 2 +- .../bonded_roles/oracle/AuthorizedOracleNode.java | 2 +- .../registration/BondedRoleRegistrationRequest.java | 2 +- .../registration/BondedRoleRegistrationService.java | 2 +- bonded_roles/src/main/proto/bonded_roles.proto | 8 ++++---- chat/build.gradle | 1 + .../open_trades/BisqEasyOpenTradeMessage.java | 2 +- .../bisq/chat/priv/PrivateChatChannelService.java | 2 +- .../main/java/bisq/chat/priv/PrivateChatMessage.java | 2 +- .../chat/two_party/TwoPartyPrivateChatMessage.java | 2 +- chat/src/main/proto/chat.proto | 6 +++--- contract/build.gradle | 2 ++ contract/src/main/java/bisq/contract/Party.java | 2 +- .../bisq/contract/bisq_easy/BisqEasyContract.java | 2 +- .../bisq/contract/multisig/MultisigContract.java | 2 +- .../src/main/java/bisq/contract/poc/PocContract.java | 2 +- .../bisq/contract/submarine/SubmarineContract.java | 2 +- contract/src/main/proto/contract.proto | 4 ++-- desktop/build.gradle | 2 ++ .../main/content/bisq_easy/BisqEasyServiceUtil.java | 2 +- .../TradeWizardSelectOfferController.java | 2 +- .../content/components/ChatMessagesListView.java | 2 +- .../network/transport/TransportTypeModel.java | 2 +- identity/build.gradle | 2 ++ identity/src/main/java/bisq/identity/Identity.java | 2 +- identity/src/main/proto/identity.proto | 4 ++-- network/network-identity/build.gradle | 11 +++++++++++ .../main/java/bisq/network/identity}/NetworkId.java | 9 +++++---- .../src/main/proto/network_identity.proto | 12 ++++++++++++ network/network/build.gradle | 1 + .../src/main/java/bisq/network/NetworkService.java | 2 +- .../bisq/network/p2p/ServiceNodesByTransport.java | 2 +- .../network/p2p/ServiceNodesByTransportStore.java | 2 +- .../confidential/ack/AckRequestingMessage.java | 3 ++- .../bisq/network/p2p/vo/NetworkIdWithKeyPair.java | 1 + network/network/src/main/proto/network.proto | 9 ++------- network/settings.gradle | 1 + offer/build.gradle | 1 + offer/src/main/java/bisq/offer/Offer.java | 2 +- .../java/bisq/offer/bisq_easy/BisqEasyOffer.java | 2 +- .../main/java/bisq/offer/multisig/MultisigOffer.java | 2 +- offer/src/main/java/bisq/offer/poc/PocOffer.java | 2 +- .../java/bisq/offer/poc/PocOpenOfferService.java | 2 +- .../java/bisq/offer/submarine/SubmarineOffer.java | 2 +- offer/src/main/proto/offer.proto | 4 ++-- oracle_node/build.gradle | 1 + .../java/bisq/oracle_node/OracleNodeService.java | 2 +- seed_node_app/build.gradle | 1 + support/build.gradle | 1 + .../bisq/support/mediation/MediationService.java | 2 +- trade/build.gradle | 1 + trade/src/main/java/bisq/trade/TradeParty.java | 2 +- .../java/bisq/trade/bisq_easy/BisqEasyTrade.java | 2 +- .../bisq/trade/bisq_easy/BisqEasyTradeParty.java | 2 +- .../bisq/trade/bisq_easy/BisqEasyTradeService.java | 2 +- .../messages/BisqEasyAccountDataMessage.java | 2 +- .../protocol/messages/BisqEasyBtcAddressMessage.java | 2 +- .../messages/BisqEasyConfirmBtcSentMessage.java | 2 +- .../messages/BisqEasyConfirmFiatReceiptMessage.java | 2 +- .../messages/BisqEasyConfirmFiatSentMessage.java | 2 +- .../protocol/messages/BisqEasyTakeOfferRequest.java | 2 +- .../protocol/messages/BisqEasyTakeOfferResponse.java | 2 +- .../protocol/messages/BisqEasyTradeMessage.java | 2 +- .../main/java/bisq/trade/multisig/MultisigTrade.java | 2 +- .../java/bisq/trade/multisig/MultisigTradeParty.java | 2 +- .../bisq/trade/multisig/MultisigTradeService.java | 2 +- .../multisig/messages/MultisigTradeMessage.java | 2 +- .../trade/protocol/events/TradeMessageHandler.java | 2 +- .../bisq/trade/protocol/messages/TradeMessage.java | 2 +- .../java/bisq/trade/submarine/SubmarineTrade.java | 2 +- .../bisq/trade/submarine/SubmarineTradeParty.java | 2 +- .../bisq/trade/submarine/SubmarineTradeService.java | 2 +- .../submarine/messages/SubmarineTradeMessage.java | 2 +- trade/src/main/proto/trade.proto | 8 ++++---- user/build.gradle | 1 + .../java/bisq/user/banned/BannedUserService.java | 2 +- .../src/main/java/bisq/user/profile/UserProfile.java | 2 +- user/src/main/proto/user.proto | 4 ++-- 79 files changed, 121 insertions(+), 84 deletions(-) create mode 100644 network/network-identity/build.gradle rename network/{network/src/main/java/bisq/network/p2p/vo => network-identity/src/main/java/bisq/network/identity}/NetworkId.java (90%) create mode 100644 network/network-identity/src/main/proto/network_identity.proto diff --git a/bonded_roles/build.gradle b/bonded_roles/build.gradle index aaa904a542..8541df4336 100644 --- a/bonded_roles/build.gradle +++ b/bonded_roles/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation project(':identity') implementation 'network:common' + implementation 'network:network-identity' implementation 'network:network' implementation libs.google.gson diff --git a/bonded_roles/src/main/java/bisq/bonded_roles/bonded_role/AuthorizedBondedRole.java b/bonded_roles/src/main/java/bisq/bonded_roles/bonded_role/AuthorizedBondedRole.java index 1868110dd3..7cee99c80c 100644 --- a/bonded_roles/src/main/java/bisq/bonded_roles/bonded_role/AuthorizedBondedRole.java +++ b/bonded_roles/src/main/java/bisq/bonded_roles/bonded_role/AuthorizedBondedRole.java @@ -28,7 +28,7 @@ import bisq.network.p2p.services.data.storage.DistributedData; import bisq.network.p2p.services.data.storage.MetaData; import bisq.network.p2p.services.data.storage.auth.authorized.AuthorizedDistributedData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import com.google.protobuf.InvalidProtocolBufferException; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bonded_roles/src/main/java/bisq/bonded_roles/oracle/AuthorizedOracleNode.java b/bonded_roles/src/main/java/bisq/bonded_roles/oracle/AuthorizedOracleNode.java index e8ae36b31c..467e9408e3 100644 --- a/bonded_roles/src/main/java/bisq/bonded_roles/oracle/AuthorizedOracleNode.java +++ b/bonded_roles/src/main/java/bisq/bonded_roles/oracle/AuthorizedOracleNode.java @@ -25,7 +25,7 @@ import bisq.network.p2p.services.data.storage.DistributedData; import bisq.network.p2p.services.data.storage.MetaData; import bisq.network.p2p.services.data.storage.auth.authorized.AuthorizedDistributedData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import com.google.protobuf.InvalidProtocolBufferException; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationRequest.java b/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationRequest.java index c676377735..740798855f 100644 --- a/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationRequest.java +++ b/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationRequest.java @@ -25,7 +25,7 @@ import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.services.data.storage.MetaData; import bisq.network.p2p.services.data.storage.mailbox.MailboxMessage; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.network.protobuf.ExternalNetworkMessage; import com.google.protobuf.Any; import com.google.protobuf.InvalidProtocolBufferException; diff --git a/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationService.java b/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationService.java index 1150f0d677..6130970c97 100644 --- a/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationService.java +++ b/bonded_roles/src/main/java/bisq/bonded_roles/registration/BondedRoleRegistrationService.java @@ -25,7 +25,7 @@ import bisq.common.observable.collection.ObservableSet; import bisq.network.NetworkService; import bisq.network.common.AddressByTransportTypeMap; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.network.p2p.vo.NetworkIdWithKeyPair; import bisq.security.DigestUtil; import lombok.extern.slf4j.Slf4j; diff --git a/bonded_roles/src/main/proto/bonded_roles.proto b/bonded_roles/src/main/proto/bonded_roles.proto index 8c92b71b63..c69e0e3816 100644 --- a/bonded_roles/src/main/proto/bonded_roles.proto +++ b/bonded_roles/src/main/proto/bonded_roles.proto @@ -3,8 +3,8 @@ package bonded_roles; option java_package = "bisq.bonded_roles.protobuf"; option java_multiple_files = true; import "common.proto"; -import "network.proto"; import "network_common.proto"; +import "network_identity.proto"; enum BondedRoleType { BONDEDROLETYPE_UNSPECIFIED = 0; @@ -19,7 +19,7 @@ enum BondedRoleType { BONDEDROLETYPE_MARKET_PRICE_NODE = 13; } message AuthorizedOracleNode { - network.NetworkId networkId = 1; + network.identity.NetworkId networkId = 1; string bondUserName = 2; string signatureBase64 = 3; string publicKeyHash = 4; @@ -33,7 +33,7 @@ message BondedRoleRegistrationRequest { string bondUserName = 4; string signatureBase64 = 5; .network.common.AddressByTransportTypeMap addressByTransportTypeMap = 6; - network.NetworkId networkId = 7; + network.identity.NetworkId networkId = 7; bool isCancellationRequest = 8; } @@ -44,7 +44,7 @@ message AuthorizedBondedRole { string bondUserName = 4; string signatureBase64 = 5; .network.common.AddressByTransportTypeMap addressByTransportTypeMap = 6; - network.NetworkId networkId = 7; + network.identity.NetworkId networkId = 7; optional AuthorizedOracleNode authorizedOracleNode = 8; bool staticPublicKeysProvided = 9; } diff --git a/chat/build.gradle b/chat/build.gradle index d802078730..6d6349d1cb 100644 --- a/chat/build.gradle +++ b/chat/build.gradle @@ -19,6 +19,7 @@ dependencies { implementation project(':presentation') implementation 'network:network' + implementation 'network:network-identity' implementation libs.chimp.jsocks implementation libs.google.gson diff --git a/chat/src/main/java/bisq/chat/bisqeasy/open_trades/BisqEasyOpenTradeMessage.java b/chat/src/main/java/bisq/chat/bisqeasy/open_trades/BisqEasyOpenTradeMessage.java index cf3577b78e..88ca92d5d1 100644 --- a/chat/src/main/java/bisq/chat/bisqeasy/open_trades/BisqEasyOpenTradeMessage.java +++ b/chat/src/main/java/bisq/chat/bisqeasy/open_trades/BisqEasyOpenTradeMessage.java @@ -24,7 +24,7 @@ import bisq.chat.priv.PrivateChatMessage; import bisq.common.util.StringUtils; import bisq.network.p2p.services.data.storage.MetaData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.network.protobuf.ExternalNetworkMessage; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.user.profile.UserProfile; diff --git a/chat/src/main/java/bisq/chat/priv/PrivateChatChannelService.java b/chat/src/main/java/bisq/chat/priv/PrivateChatChannelService.java index e848276aab..edee686de1 100644 --- a/chat/src/main/java/bisq/chat/priv/PrivateChatChannelService.java +++ b/chat/src/main/java/bisq/chat/priv/PrivateChatChannelService.java @@ -21,8 +21,8 @@ import bisq.common.util.StringUtils; import bisq.i18n.Res; import bisq.network.NetworkService; +import bisq.network.identity.NetworkId; import bisq.network.p2p.services.confidential.MessageListener; -import bisq.network.p2p.vo.NetworkId; import bisq.network.p2p.vo.NetworkIdWithKeyPair; import bisq.persistence.PersistableStore; import bisq.security.pow.ProofOfWorkService; diff --git a/chat/src/main/java/bisq/chat/priv/PrivateChatMessage.java b/chat/src/main/java/bisq/chat/priv/PrivateChatMessage.java index 82c21cbcef..2b86aa4212 100644 --- a/chat/src/main/java/bisq/chat/priv/PrivateChatMessage.java +++ b/chat/src/main/java/bisq/chat/priv/PrivateChatMessage.java @@ -24,7 +24,7 @@ import bisq.common.validation.NetworkDataValidation; import bisq.network.p2p.services.confidential.ack.AckRequestingMessage; import bisq.network.p2p.services.data.storage.mailbox.MailboxMessage; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.user.profile.UserProfile; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/chat/src/main/java/bisq/chat/two_party/TwoPartyPrivateChatMessage.java b/chat/src/main/java/bisq/chat/two_party/TwoPartyPrivateChatMessage.java index a8d4de211b..3e1caa8264 100644 --- a/chat/src/main/java/bisq/chat/two_party/TwoPartyPrivateChatMessage.java +++ b/chat/src/main/java/bisq/chat/two_party/TwoPartyPrivateChatMessage.java @@ -22,7 +22,7 @@ import bisq.chat.Citation; import bisq.chat.priv.PrivateChatMessage; import bisq.network.p2p.services.data.storage.MetaData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.network.protobuf.ExternalNetworkMessage; import bisq.user.profile.UserProfile; import com.google.protobuf.Any; diff --git a/chat/src/main/proto/chat.proto b/chat/src/main/proto/chat.proto index e4eab8a615..8efb992e1a 100644 --- a/chat/src/main/proto/chat.proto +++ b/chat/src/main/proto/chat.proto @@ -21,7 +21,7 @@ package chat; option java_package = "bisq.chat.protobuf"; option java_multiple_files = true; import "common.proto"; -import "network.proto"; +import "network_identity.proto"; import "security.proto"; import "offer.proto"; import "user.proto"; @@ -91,7 +91,7 @@ message ChatChannel { message TwoPartyPrivateChatMessage { string receiverUserProfileId = 1; user.UserProfile sender = 2; - network.NetworkId receiverNetworkId = 3; + network.identity.NetworkId receiverNetworkId = 3; } message TwoPartyPrivateChatChannel { user.UserIdentity myUserIdentity = 1; @@ -119,7 +119,7 @@ message CommonPublicChatChannelStore { message BisqEasyOpenTradeMessage { string tradeId = 1; string receiverUserProfileId = 2; - network.NetworkId receiverNetworkId = 3; + network.identity.NetworkId receiverNetworkId = 3; user.UserProfile sender = 4; optional user.UserProfile mediator = 5; optional offer.Offer bisqEasyOffer = 6; diff --git a/contract/build.gradle b/contract/build.gradle index bba13b1dd4..9db8ed32e2 100644 --- a/contract/build.gradle +++ b/contract/build.gradle @@ -12,5 +12,7 @@ dependencies { implementation project(':offer') implementation 'network:network' + implementation 'network:network-identity' + implementation libs.google.guava } diff --git a/contract/src/main/java/bisq/contract/Party.java b/contract/src/main/java/bisq/contract/Party.java index df7bf718a6..d67a480a04 100644 --- a/contract/src/main/java/bisq/contract/Party.java +++ b/contract/src/main/java/bisq/contract/Party.java @@ -18,7 +18,7 @@ package bisq.contract; import bisq.common.proto.Proto; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/contract/src/main/java/bisq/contract/bisq_easy/BisqEasyContract.java b/contract/src/main/java/bisq/contract/bisq_easy/BisqEasyContract.java index 4e263ff5ce..71ea2a1d0a 100644 --- a/contract/src/main/java/bisq/contract/bisq_easy/BisqEasyContract.java +++ b/contract/src/main/java/bisq/contract/bisq_easy/BisqEasyContract.java @@ -21,7 +21,7 @@ import bisq.contract.Party; import bisq.contract.Role; import bisq.contract.TwoPartyContract; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.offer.payment_method.BitcoinPaymentMethodSpec; import bisq.offer.payment_method.FiatPaymentMethodSpec; diff --git a/contract/src/main/java/bisq/contract/multisig/MultisigContract.java b/contract/src/main/java/bisq/contract/multisig/MultisigContract.java index 045549a80f..1b707f77de 100644 --- a/contract/src/main/java/bisq/contract/multisig/MultisigContract.java +++ b/contract/src/main/java/bisq/contract/multisig/MultisigContract.java @@ -21,7 +21,7 @@ import bisq.contract.Party; import bisq.contract.Role; import bisq.contract.TwoPartyContract; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.multisig.MultisigOffer; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/contract/src/main/java/bisq/contract/poc/PocContract.java b/contract/src/main/java/bisq/contract/poc/PocContract.java index d0faf7b15a..7a4e84c102 100644 --- a/contract/src/main/java/bisq/contract/poc/PocContract.java +++ b/contract/src/main/java/bisq/contract/poc/PocContract.java @@ -20,7 +20,7 @@ import bisq.account.protocol_type.TradeProtocolType; import bisq.common.monetary.Monetary; import bisq.common.proto.Proto; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.poc.PocOffer; import com.google.protobuf.Message; import lombok.EqualsAndHashCode; diff --git a/contract/src/main/java/bisq/contract/submarine/SubmarineContract.java b/contract/src/main/java/bisq/contract/submarine/SubmarineContract.java index 833dfa930d..bc14b5cd77 100644 --- a/contract/src/main/java/bisq/contract/submarine/SubmarineContract.java +++ b/contract/src/main/java/bisq/contract/submarine/SubmarineContract.java @@ -21,7 +21,7 @@ import bisq.contract.Party; import bisq.contract.Role; import bisq.contract.TwoPartyContract; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.submarine.SubmarineOffer; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/contract/src/main/proto/contract.proto b/contract/src/main/proto/contract.proto index 2dfc5eef60..e7fb44f7c6 100644 --- a/contract/src/main/proto/contract.proto +++ b/contract/src/main/proto/contract.proto @@ -21,7 +21,7 @@ package contract; option java_package = "bisq.contract.protobuf"; option java_multiple_files = true; -import "network.proto"; +import "network_identity.proto"; import "account.proto"; import "offer.proto"; import "user.proto"; @@ -35,7 +35,7 @@ enum Role { message Party { Role role = 1; - network.NetworkId networkId = 2; + network.identity.NetworkId networkId = 2; } message Contract { offer.Offer offer = 1; diff --git a/desktop/build.gradle b/desktop/build.gradle index 0e46cffed6..bd1de36dad 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -28,6 +28,8 @@ dependencies { implementation("network:common") implementation("network:network") + implementation("network:network-identity") + implementation("wallets:electrum") implementation("wallets:bitcoind") diff --git a/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/BisqEasyServiceUtil.java b/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/BisqEasyServiceUtil.java index 39bd6c106e..42a8989926 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/BisqEasyServiceUtil.java +++ b/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/BisqEasyServiceUtil.java @@ -19,7 +19,7 @@ import bisq.chat.bisqeasy.open_trades.BisqEasyOpenTradeChannel; import bisq.desktop.ServiceProvider; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.trade.Trade; import bisq.trade.bisq_easy.BisqEasyTrade; diff --git a/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/trade_wizard/select_offer/TradeWizardSelectOfferController.java b/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/trade_wizard/select_offer/TradeWizardSelectOfferController.java index 5a9420c103..209de84c02 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/trade_wizard/select_offer/TradeWizardSelectOfferController.java +++ b/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/trade_wizard/select_offer/TradeWizardSelectOfferController.java @@ -29,7 +29,7 @@ import bisq.desktop.common.view.Controller; import bisq.desktop.common.view.NavigationTarget; import bisq.i18n.Res; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.Direction; import bisq.offer.amount.OfferAmountFormatter; import bisq.offer.amount.OfferAmountUtil; diff --git a/desktop/src/main/java/bisq/desktop/main/content/components/ChatMessagesListView.java b/desktop/src/main/java/bisq/desktop/main/content/components/ChatMessagesListView.java index dd8757217c..1a68a96c5e 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/components/ChatMessagesListView.java +++ b/desktop/src/main/java/bisq/desktop/main/content/components/ChatMessagesListView.java @@ -53,7 +53,7 @@ import bisq.i18n.Res; import bisq.network.NetworkService; import bisq.network.p2p.services.confidential.ack.MessageDeliveryStatus; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.presentation.formatters.DateFormatter; import bisq.settings.SettingsService; diff --git a/desktop/src/main/java/bisq/desktop/main/content/settings/network/transport/TransportTypeModel.java b/desktop/src/main/java/bisq/desktop/main/content/settings/network/transport/TransportTypeModel.java index 944b63bdb5..7a7614d3f6 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/settings/network/transport/TransportTypeModel.java +++ b/desktop/src/main/java/bisq/desktop/main/content/settings/network/transport/TransportTypeModel.java @@ -31,7 +31,7 @@ import bisq.network.p2p.node.Node; import bisq.network.p2p.node.NodesById; import bisq.network.common.TransportType; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; diff --git a/identity/build.gradle b/identity/build.gradle index e83589c838..0e8d290b21 100644 --- a/identity/build.gradle +++ b/identity/build.gradle @@ -8,6 +8,8 @@ dependencies { implementation project(':security') implementation 'network:network' + implementation 'network:network-identity' + implementation libs.google.guava implementation libs.typesafe.config } diff --git a/identity/src/main/java/bisq/identity/Identity.java b/identity/src/main/java/bisq/identity/Identity.java index bd1eecc3f6..8a0bba915f 100644 --- a/identity/src/main/java/bisq/identity/Identity.java +++ b/identity/src/main/java/bisq/identity/Identity.java @@ -18,7 +18,7 @@ package bisq.identity; import bisq.common.proto.Proto; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.network.p2p.vo.NetworkIdWithKeyPair; import bisq.security.KeyPairProtoUtil; import bisq.security.PubKey; diff --git a/identity/src/main/proto/identity.proto b/identity/src/main/proto/identity.proto index 9ffda07576..82228323d6 100644 --- a/identity/src/main/proto/identity.proto +++ b/identity/src/main/proto/identity.proto @@ -20,12 +20,12 @@ syntax = "proto3"; package identity; option java_package = "bisq.identity.protobuf"; option java_multiple_files = true; -import "network.proto"; +import "network_identity.proto"; import "security.proto"; message Identity { string domainId = 1; - network.NetworkId networkId = 2; + network.identity.NetworkId networkId = 2; security.KeyPair keyPair = 3; } diff --git a/network/network-identity/build.gradle b/network/network-identity/build.gradle new file mode 100644 index 0000000000..8f3706f961 --- /dev/null +++ b/network/network-identity/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'bisq.java-library' + id 'bisq.protobuf' +} + +dependencies { + implementation project(":common") + implementation 'bisq:security' + + implementation libs.google.guava +} diff --git a/network/network/src/main/java/bisq/network/p2p/vo/NetworkId.java b/network/network-identity/src/main/java/bisq/network/identity/NetworkId.java similarity index 90% rename from network/network/src/main/java/bisq/network/p2p/vo/NetworkId.java rename to network/network-identity/src/main/java/bisq/network/identity/NetworkId.java index 3684791784..5139cc1230 100644 --- a/network/network/src/main/java/bisq/network/p2p/vo/NetworkId.java +++ b/network/network-identity/src/main/java/bisq/network/identity/NetworkId.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.network.p2p.vo; +package bisq.network.identity; import bisq.common.proto.Proto; import bisq.common.validation.NetworkDataValidation; @@ -45,15 +45,15 @@ public NetworkId(AddressByTransportTypeMap addressByTransportTypeMap, PubKey pub NetworkDataValidation.validateId(nodeId); } - public bisq.network.protobuf.NetworkId toProto() { - return bisq.network.protobuf.NetworkId.newBuilder() + public bisq.network.identity.protobuf.NetworkId toProto() { + return bisq.network.identity.protobuf.NetworkId.newBuilder() .setAddressByNetworkTypeMap(addressByTransportTypeMap.toProto()) .setPubKey(pubKey.toProto()) .setNodeId(nodeId) .build(); } - public static NetworkId fromProto(bisq.network.protobuf.NetworkId proto) { + public static NetworkId fromProto(bisq.network.identity.protobuf.NetworkId proto) { return new NetworkId(AddressByTransportTypeMap.fromProto(proto.getAddressByNetworkTypeMap()), PubKey.fromProto(proto.getPubKey()), proto.getNodeId()); @@ -72,3 +72,4 @@ public String toString() { ")"; } } + diff --git a/network/network-identity/src/main/proto/network_identity.proto b/network/network-identity/src/main/proto/network_identity.proto new file mode 100644 index 0000000000..daee84d4b1 --- /dev/null +++ b/network/network-identity/src/main/proto/network_identity.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package network.identity; +option java_package = "bisq.network.identity.protobuf"; +option java_multiple_files = true; +import "network_common.proto"; +import "security.proto"; + +message NetworkId { + .network.common.AddressByTransportTypeMap addressByNetworkTypeMap = 1; + security.PubKey pubKey = 2; + string nodeId = 3; +} \ No newline at end of file diff --git a/network/network/build.gradle b/network/network/build.gradle index 64cf079c75..06a0086b6e 100644 --- a/network/network/build.gradle +++ b/network/network/build.gradle @@ -9,6 +9,7 @@ dependencies { implementation 'bisq:persistence' implementation project(':common') + implementation project(':network-identity') implementation project(':i2p') implementation 'tor:tor' diff --git a/network/network/src/main/java/bisq/network/NetworkService.java b/network/network/src/main/java/bisq/network/NetworkService.java index 5868ff4068..32b83a741a 100644 --- a/network/network/src/main/java/bisq/network/NetworkService.java +++ b/network/network/src/main/java/bisq/network/NetworkService.java @@ -25,6 +25,7 @@ import bisq.common.util.CompletableFutureUtils; import bisq.network.http.BaseHttpClient; import bisq.network.http.HttpClientRepository; +import bisq.network.identity.NetworkId; import bisq.network.p2p.ServiceNode; import bisq.network.p2p.ServiceNodesByTransport; import bisq.network.p2p.message.EnvelopePayloadMessage; @@ -48,7 +49,6 @@ import bisq.network.p2p.services.monitor.MonitorService; import bisq.network.common.Address; import bisq.network.common.AddressByTransportTypeMap; -import bisq.network.p2p.vo.NetworkId; import bisq.network.p2p.vo.NetworkIdWithKeyPair; import bisq.persistence.Persistence; import bisq.persistence.PersistenceClient; diff --git a/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransport.java b/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransport.java index db615bedb6..fc5d56986e 100644 --- a/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransport.java +++ b/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransport.java @@ -23,6 +23,7 @@ import bisq.common.util.CompletableFutureUtils; import bisq.network.NetworkService; import bisq.network.common.TransportConfig; +import bisq.network.identity.NetworkId; import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.node.Connection; import bisq.network.p2p.node.Node; @@ -38,7 +39,6 @@ import bisq.network.p2p.services.peergroup.PeerGroupManager; import bisq.network.common.Address; import bisq.network.common.AddressByTransportTypeMap; -import bisq.network.p2p.vo.NetworkId; import bisq.persistence.Persistence; import bisq.persistence.PersistenceClient; import bisq.persistence.PersistenceService; diff --git a/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransportStore.java b/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransportStore.java index cdf49c624b..080c9777d3 100644 --- a/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransportStore.java +++ b/network/network/src/main/java/bisq/network/p2p/ServiceNodesByTransportStore.java @@ -19,7 +19,7 @@ import bisq.common.proto.ProtoResolver; import bisq.common.proto.UnresolvableProtobufMessageException; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.persistence.PersistableStore; import com.google.protobuf.InvalidProtocolBufferException; import lombok.Getter; diff --git a/network/network/src/main/java/bisq/network/p2p/services/confidential/ack/AckRequestingMessage.java b/network/network/src/main/java/bisq/network/p2p/services/confidential/ack/AckRequestingMessage.java index 3ad6579d10..78f8d13119 100644 --- a/network/network/src/main/java/bisq/network/p2p/services/confidential/ack/AckRequestingMessage.java +++ b/network/network/src/main/java/bisq/network/p2p/services/confidential/ack/AckRequestingMessage.java @@ -1,6 +1,7 @@ package bisq.network.p2p.services.confidential.ack; -import bisq.network.p2p.vo.NetworkId; + +import bisq.network.identity.NetworkId; /** * Interface marking a message which expects an AckMessage to be sent back as confidential message to the message sender. diff --git a/network/network/src/main/java/bisq/network/p2p/vo/NetworkIdWithKeyPair.java b/network/network/src/main/java/bisq/network/p2p/vo/NetworkIdWithKeyPair.java index 44b80aaed8..87b4e80b4d 100644 --- a/network/network/src/main/java/bisq/network/p2p/vo/NetworkIdWithKeyPair.java +++ b/network/network/src/main/java/bisq/network/p2p/vo/NetworkIdWithKeyPair.java @@ -17,6 +17,7 @@ package bisq.network.p2p.vo; +import bisq.network.identity.NetworkId; import bisq.security.PubKey; import lombok.Getter; import lombok.ToString; diff --git a/network/network/src/main/proto/network.proto b/network/network/src/main/proto/network.proto index 87aceb4d3b..93b2fa36e4 100644 --- a/network/network/src/main/proto/network.proto +++ b/network/network/src/main/proto/network.proto @@ -4,6 +4,7 @@ option java_package = "bisq.network.protobuf"; option java_multiple_files = true; import "common.proto"; import "network_common.proto"; +import "network_identity.proto"; import "security.proto"; import "google/protobuf/any.proto"; @@ -11,12 +12,6 @@ import "google/protobuf/any.proto"; // Data //////////////////////////////////////////////////////////////////// -message NetworkId { - network.common.AddressByTransportTypeMap addressByNetworkTypeMap = 1; - security.PubKey pubKey = 2; - string nodeId = 3; -} - message Capability { network.common.Address address = 1; repeated string supportedTransportTypes = 2; @@ -298,7 +293,7 @@ message NetworkServiceStore { } message ServiceNodesByTransportStore { - map networkIdByNodeId = 1; + map networkIdByNodeId = 1; } message MessageDeliveryStatusStore { diff --git a/network/settings.gradle b/network/settings.gradle index 88d5caa982..c2197740e9 100644 --- a/network/settings.gradle +++ b/network/settings.gradle @@ -19,6 +19,7 @@ includeBuild('tor') include 'common' include 'i2p' include 'network' +include 'network-identity' include 'socks5-socket-channel' rootProject.name = 'network' diff --git a/offer/build.gradle b/offer/build.gradle index 46ece82958..22ac37c7a0 100644 --- a/offer/build.gradle +++ b/offer/build.gradle @@ -13,6 +13,7 @@ dependencies { implementation project(':bonded_roles') implementation("network:network") + implementation("network:network-identity") implementation libs.google.gson implementation libs.google.guava diff --git a/offer/src/main/java/bisq/offer/Offer.java b/offer/src/main/java/bisq/offer/Offer.java index 5f19c34be8..2bfb29ee55 100644 --- a/offer/src/main/java/bisq/offer/Offer.java +++ b/offer/src/main/java/bisq/offer/Offer.java @@ -22,7 +22,7 @@ import bisq.common.proto.Proto; import bisq.common.proto.UnresolvableProtobufMessageException; import bisq.common.validation.NetworkDataValidation; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.amount.spec.AmountSpec; import bisq.offer.amount.spec.RangeAmountSpec; import bisq.offer.bisq_easy.BisqEasyOffer; diff --git a/offer/src/main/java/bisq/offer/bisq_easy/BisqEasyOffer.java b/offer/src/main/java/bisq/offer/bisq_easy/BisqEasyOffer.java index 6a9985f9b3..7ae259b418 100644 --- a/offer/src/main/java/bisq/offer/bisq_easy/BisqEasyOffer.java +++ b/offer/src/main/java/bisq/offer/bisq_easy/BisqEasyOffer.java @@ -6,7 +6,7 @@ import bisq.common.currency.Market; import bisq.common.util.StringUtils; import bisq.common.validation.NetworkDataValidation; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.Direction; import bisq.offer.Offer; import bisq.offer.amount.spec.AmountSpec; diff --git a/offer/src/main/java/bisq/offer/multisig/MultisigOffer.java b/offer/src/main/java/bisq/offer/multisig/MultisigOffer.java index 8a08da8798..a6b14636b0 100644 --- a/offer/src/main/java/bisq/offer/multisig/MultisigOffer.java +++ b/offer/src/main/java/bisq/offer/multisig/MultisigOffer.java @@ -5,7 +5,7 @@ import bisq.account.protocol_type.TradeProtocolType; import bisq.common.currency.Market; import bisq.common.util.StringUtils; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.Direction; import bisq.offer.Offer; import bisq.offer.amount.spec.AmountSpec; diff --git a/offer/src/main/java/bisq/offer/poc/PocOffer.java b/offer/src/main/java/bisq/offer/poc/PocOffer.java index 12dcbec8f6..e3fe81fb55 100644 --- a/offer/src/main/java/bisq/offer/poc/PocOffer.java +++ b/offer/src/main/java/bisq/offer/poc/PocOffer.java @@ -25,7 +25,7 @@ import bisq.common.monetary.PriceQuote; import bisq.network.p2p.services.data.storage.DistributedData; import bisq.network.p2p.services.data.storage.MetaData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.Direction; import bisq.offer.options.OfferOption; import bisq.offer.payment_method.BitcoinPaymentMethodSpec; diff --git a/offer/src/main/java/bisq/offer/poc/PocOpenOfferService.java b/offer/src/main/java/bisq/offer/poc/PocOpenOfferService.java index 0dbeeb68cb..2e1f773221 100644 --- a/offer/src/main/java/bisq/offer/poc/PocOpenOfferService.java +++ b/offer/src/main/java/bisq/offer/poc/PocOpenOfferService.java @@ -32,7 +32,7 @@ import bisq.common.util.StringUtils; import bisq.identity.IdentityService; import bisq.network.NetworkService; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.Direction; import bisq.offer.options.OfferOption; import bisq.offer.payment_method.BitcoinPaymentMethodSpec; diff --git a/offer/src/main/java/bisq/offer/submarine/SubmarineOffer.java b/offer/src/main/java/bisq/offer/submarine/SubmarineOffer.java index 5920620f96..49367daf90 100644 --- a/offer/src/main/java/bisq/offer/submarine/SubmarineOffer.java +++ b/offer/src/main/java/bisq/offer/submarine/SubmarineOffer.java @@ -5,7 +5,7 @@ import bisq.account.protocol_type.TradeProtocolType; import bisq.common.currency.Market; import bisq.common.util.StringUtils; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.Direction; import bisq.offer.Offer; import bisq.offer.amount.spec.AmountSpec; diff --git a/offer/src/main/proto/offer.proto b/offer/src/main/proto/offer.proto index c51d3cdf88..89a665a8f8 100644 --- a/offer/src/main/proto/offer.proto +++ b/offer/src/main/proto/offer.proto @@ -3,7 +3,7 @@ package offer; option java_package = "bisq.offer.protobuf"; option java_multiple_files = true; import "common.proto"; -import "network.proto"; +import "network_identity.proto"; import "security.proto"; import "account.proto"; @@ -119,7 +119,7 @@ message OfferOption { message Offer { string id = 1; sint64 date = 2; - network.NetworkId makerNetworkId = 3; + network.identity.NetworkId makerNetworkId = 3; common.Market market = 4; Direction direction = 5; AmountSpec amountSpec = 6; diff --git a/oracle_node/build.gradle b/oracle_node/build.gradle index 15cac9a590..045f73f9ed 100644 --- a/oracle_node/build.gradle +++ b/oracle_node/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation 'network:common' implementation 'network:network' + implementation 'network:network-identity' implementation libs.google.gson implementation libs.google.guava diff --git a/oracle_node/src/main/java/bisq/oracle_node/OracleNodeService.java b/oracle_node/src/main/java/bisq/oracle_node/OracleNodeService.java index 473d643bf1..b49d880f9e 100644 --- a/oracle_node/src/main/java/bisq/oracle_node/OracleNodeService.java +++ b/oracle_node/src/main/java/bisq/oracle_node/OracleNodeService.java @@ -29,8 +29,8 @@ import bisq.common.util.StringUtils; import bisq.identity.IdentityService; import bisq.network.NetworkService; +import bisq.network.identity.NetworkId; import bisq.network.p2p.node.Node; -import bisq.network.p2p.vo.NetworkId; import bisq.oracle_node.bisq1_bridge.Bisq1BridgeService; import bisq.oracle_node.timestamp.TimestampService; import bisq.persistence.PersistenceService; diff --git a/seed_node_app/build.gradle b/seed_node_app/build.gradle index 00d2714865..618e7a338c 100644 --- a/seed_node_app/build.gradle +++ b/seed_node_app/build.gradle @@ -24,6 +24,7 @@ dependencies { implementation 'network:common' implementation 'network:network' + implementation 'network:network-identity' implementation libs.typesafe.config implementation libs.google.gson diff --git a/support/build.gradle b/support/build.gradle index e7f82f90e7..aee7a4092d 100644 --- a/support/build.gradle +++ b/support/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation project(':bonded_roles') implementation 'network:network' + implementation 'network:network-identity' implementation libs.google.gson implementation libs.google.guava diff --git a/support/src/main/java/bisq/support/mediation/MediationService.java b/support/src/main/java/bisq/support/mediation/MediationService.java index 1ff3055cf6..43f150af6a 100644 --- a/support/src/main/java/bisq/support/mediation/MediationService.java +++ b/support/src/main/java/bisq/support/mediation/MediationService.java @@ -27,9 +27,9 @@ import bisq.common.application.Service; import bisq.i18n.Res; import bisq.network.NetworkService; +import bisq.network.identity.NetworkId; import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.services.confidential.MessageListener; -import bisq.network.p2p.vo.NetworkId; import bisq.network.p2p.vo.NetworkIdWithKeyPair; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.security.DigestUtil; diff --git a/trade/build.gradle b/trade/build.gradle index 1d752fcad1..2bb73e48b6 100644 --- a/trade/build.gradle +++ b/trade/build.gradle @@ -19,6 +19,7 @@ dependencies { implementation project(':bonded_roles') implementation("network:network") + implementation("network:network-identity") implementation libs.google.guava implementation libs.typesafe.config diff --git a/trade/src/main/java/bisq/trade/TradeParty.java b/trade/src/main/java/bisq/trade/TradeParty.java index bb3e87c56b..1c44dd4670 100644 --- a/trade/src/main/java/bisq/trade/TradeParty.java +++ b/trade/src/main/java/bisq/trade/TradeParty.java @@ -21,7 +21,7 @@ import bisq.common.proto.Proto; import bisq.common.proto.UnresolvableProtobufMessageException; import bisq.contract.ContractSignatureData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.bisq_easy.BisqEasyTradeParty; import bisq.trade.multisig.MultisigTradeParty; import bisq.trade.submarine.SubmarineTradeParty; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTrade.java b/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTrade.java index 3b9dea1968..f41df1936c 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTrade.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTrade.java @@ -22,7 +22,7 @@ import bisq.common.util.ProtobufUtils; import bisq.contract.bisq_easy.BisqEasyContract; import bisq.identity.Identity; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.trade.Trade; import bisq.trade.TradeParty; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeParty.java b/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeParty.java index 9d282b8c87..3462f2dc38 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeParty.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeParty.java @@ -18,7 +18,7 @@ package bisq.trade.bisq_easy; import bisq.contract.ContractSignatureData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.TradeParty; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeService.java b/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeService.java index 05715268f5..38871017a5 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeService.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/BisqEasyTradeService.java @@ -24,7 +24,7 @@ import bisq.identity.Identity; import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.services.confidential.MessageListener; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.bisq_easy.BisqEasyOffer; import bisq.offer.payment_method.BitcoinPaymentMethodSpec; import bisq.offer.payment_method.FiatPaymentMethodSpec; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyAccountDataMessage.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyAccountDataMessage.java index 6e40d7ddc3..1d47d42087 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyAccountDataMessage.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyAccountDataMessage.java @@ -18,7 +18,7 @@ package bisq.trade.bisq_easy.protocol.messages; import bisq.common.validation.NetworkDataValidation; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyBtcAddressMessage.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyBtcAddressMessage.java index 78d77d0f7a..b4adf0e569 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyBtcAddressMessage.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyBtcAddressMessage.java @@ -18,7 +18,7 @@ package bisq.trade.bisq_easy.protocol.messages; import bisq.common.validation.NetworkDataValidation; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmBtcSentMessage.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmBtcSentMessage.java index 3ae018ef5b..b585fbc074 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmBtcSentMessage.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmBtcSentMessage.java @@ -18,7 +18,7 @@ package bisq.trade.bisq_easy.protocol.messages; import bisq.common.validation.NetworkDataValidation; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatReceiptMessage.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatReceiptMessage.java index 6c60108c94..f9835fa1f5 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatReceiptMessage.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatReceiptMessage.java @@ -17,7 +17,7 @@ package bisq.trade.bisq_easy.protocol.messages; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatSentMessage.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatSentMessage.java index 9e1038efbd..7d4f8ddec8 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatSentMessage.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyConfirmFiatSentMessage.java @@ -17,7 +17,7 @@ package bisq.trade.bisq_easy.protocol.messages; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferRequest.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferRequest.java index eb87230f86..bdfc232d28 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferRequest.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferRequest.java @@ -19,7 +19,7 @@ import bisq.contract.ContractSignatureData; import bisq.contract.bisq_easy.BisqEasyContract; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferResponse.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferResponse.java index ea84a41c76..4d0ddc7f4a 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferResponse.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTakeOfferResponse.java @@ -18,7 +18,7 @@ package bisq.trade.bisq_easy.protocol.messages; import bisq.contract.ContractSignatureData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTradeMessage.java b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTradeMessage.java index b1f36a4931..3b6e512361 100644 --- a/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTradeMessage.java +++ b/trade/src/main/java/bisq/trade/bisq_easy/protocol/messages/BisqEasyTradeMessage.java @@ -19,7 +19,7 @@ import bisq.common.proto.UnresolvableProtobufMessageException; import bisq.network.p2p.services.data.storage.MetaData; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.protocol.messages.TradeMessage; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/trade/src/main/java/bisq/trade/multisig/MultisigTrade.java b/trade/src/main/java/bisq/trade/multisig/MultisigTrade.java index 3d998d2398..9aebe9173e 100644 --- a/trade/src/main/java/bisq/trade/multisig/MultisigTrade.java +++ b/trade/src/main/java/bisq/trade/multisig/MultisigTrade.java @@ -22,7 +22,7 @@ import bisq.common.util.ProtobufUtils; import bisq.contract.multisig.MultisigContract; import bisq.identity.Identity; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.multisig.MultisigOffer; import bisq.trade.Trade; import bisq.trade.TradeParty; diff --git a/trade/src/main/java/bisq/trade/multisig/MultisigTradeParty.java b/trade/src/main/java/bisq/trade/multisig/MultisigTradeParty.java index ee992e65cf..5e7fbe8ad8 100644 --- a/trade/src/main/java/bisq/trade/multisig/MultisigTradeParty.java +++ b/trade/src/main/java/bisq/trade/multisig/MultisigTradeParty.java @@ -17,7 +17,7 @@ package bisq.trade.multisig; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.TradeParty; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/trade/src/main/java/bisq/trade/multisig/MultisigTradeService.java b/trade/src/main/java/bisq/trade/multisig/MultisigTradeService.java index d3f2a0c52c..2608178d73 100644 --- a/trade/src/main/java/bisq/trade/multisig/MultisigTradeService.java +++ b/trade/src/main/java/bisq/trade/multisig/MultisigTradeService.java @@ -22,7 +22,7 @@ import bisq.identity.Identity; import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.services.confidential.MessageListener; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.multisig.MultisigOffer; import bisq.persistence.Persistence; import bisq.persistence.PersistenceClient; diff --git a/trade/src/main/java/bisq/trade/multisig/messages/MultisigTradeMessage.java b/trade/src/main/java/bisq/trade/multisig/messages/MultisigTradeMessage.java index b9315ea368..6f75409723 100644 --- a/trade/src/main/java/bisq/trade/multisig/messages/MultisigTradeMessage.java +++ b/trade/src/main/java/bisq/trade/multisig/messages/MultisigTradeMessage.java @@ -18,7 +18,7 @@ package bisq.trade.multisig.messages; import bisq.common.proto.UnresolvableProtobufMessageException; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.protocol.messages.TradeMessage; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/trade/src/main/java/bisq/trade/protocol/events/TradeMessageHandler.java b/trade/src/main/java/bisq/trade/protocol/events/TradeMessageHandler.java index 3401c9e628..c32ac666e2 100644 --- a/trade/src/main/java/bisq/trade/protocol/events/TradeMessageHandler.java +++ b/trade/src/main/java/bisq/trade/protocol/events/TradeMessageHandler.java @@ -17,7 +17,7 @@ package bisq.trade.protocol.events; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.ServiceProvider; import bisq.trade.Trade; import bisq.trade.bisq_easy.protocol.messages.BisqEasyTradeMessage; diff --git a/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java b/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java index 85c3909a17..f8ca237b66 100644 --- a/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java +++ b/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java @@ -24,7 +24,7 @@ import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.services.confidential.ack.AckRequestingMessage; import bisq.network.p2p.services.data.storage.mailbox.MailboxMessage; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.network.protobuf.ExternalNetworkMessage; import bisq.trade.bisq_easy.protocol.messages.BisqEasyTradeMessage; import bisq.trade.submarine.messages.SubmarineTradeMessage; diff --git a/trade/src/main/java/bisq/trade/submarine/SubmarineTrade.java b/trade/src/main/java/bisq/trade/submarine/SubmarineTrade.java index caae05de3f..bccf7631c5 100644 --- a/trade/src/main/java/bisq/trade/submarine/SubmarineTrade.java +++ b/trade/src/main/java/bisq/trade/submarine/SubmarineTrade.java @@ -22,7 +22,7 @@ import bisq.common.util.ProtobufUtils; import bisq.contract.submarine.SubmarineContract; import bisq.identity.Identity; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.submarine.SubmarineOffer; import bisq.trade.Trade; import bisq.trade.TradeParty; diff --git a/trade/src/main/java/bisq/trade/submarine/SubmarineTradeParty.java b/trade/src/main/java/bisq/trade/submarine/SubmarineTradeParty.java index 389a9849ef..2f88683143 100644 --- a/trade/src/main/java/bisq/trade/submarine/SubmarineTradeParty.java +++ b/trade/src/main/java/bisq/trade/submarine/SubmarineTradeParty.java @@ -17,7 +17,7 @@ package bisq.trade.submarine; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.TradeParty; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/trade/src/main/java/bisq/trade/submarine/SubmarineTradeService.java b/trade/src/main/java/bisq/trade/submarine/SubmarineTradeService.java index b19194479f..a3839ac520 100644 --- a/trade/src/main/java/bisq/trade/submarine/SubmarineTradeService.java +++ b/trade/src/main/java/bisq/trade/submarine/SubmarineTradeService.java @@ -22,7 +22,7 @@ import bisq.identity.Identity; import bisq.network.p2p.message.EnvelopePayloadMessage; import bisq.network.p2p.services.confidential.MessageListener; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.offer.submarine.SubmarineOffer; import bisq.persistence.Persistence; import bisq.persistence.PersistenceClient; diff --git a/trade/src/main/java/bisq/trade/submarine/messages/SubmarineTradeMessage.java b/trade/src/main/java/bisq/trade/submarine/messages/SubmarineTradeMessage.java index 02fc3884b8..2f7d8e4d94 100644 --- a/trade/src/main/java/bisq/trade/submarine/messages/SubmarineTradeMessage.java +++ b/trade/src/main/java/bisq/trade/submarine/messages/SubmarineTradeMessage.java @@ -18,7 +18,7 @@ package bisq.trade.submarine.messages; import bisq.common.proto.UnresolvableProtobufMessageException; -import bisq.network.p2p.vo.NetworkId; +import bisq.network.identity.NetworkId; import bisq.trade.protocol.messages.TradeMessage; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/trade/src/main/proto/trade.proto b/trade/src/main/proto/trade.proto index 336120caeb..42164d966a 100644 --- a/trade/src/main/proto/trade.proto +++ b/trade/src/main/proto/trade.proto @@ -22,12 +22,12 @@ option java_package = "bisq.trade.protobuf"; option java_multiple_files = true; import "offer.proto"; -import "network.proto"; +import "network_identity.proto"; import "contract.proto"; import "identity.proto"; message TradeParty { - network.NetworkId networkId = 1; + network.identity.NetworkId networkId = 1; optional contract.ContractSignatureData contractSignatureData = 2; oneof message { BisqEasyTradeParty bisqEasyTradeParty = 20; @@ -62,8 +62,8 @@ message Trade { message TradeMessage { string id = 1; string tradeId = 2; - network.NetworkId sender = 3; - network.NetworkId receiver = 4; + network.identity.NetworkId sender = 3; + network.identity.NetworkId receiver = 4; oneof message { BisqEasyTradeMessage bisqEasyTradeMessage = 20; SubmarineTradeMessage submarineTradeMessage = 21; diff --git a/user/build.gradle b/user/build.gradle index dec4614f0e..8d7b693d59 100644 --- a/user/build.gradle +++ b/user/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation project(':bonded_roles') implementation 'network:network' + implementation 'network:network-identity' implementation libs.google.gson implementation libs.google.guava diff --git a/user/src/main/java/bisq/user/banned/BannedUserService.java b/user/src/main/java/bisq/user/banned/BannedUserService.java index f837c3cc43..4db134806a 100644 --- a/user/src/main/java/bisq/user/banned/BannedUserService.java +++ b/user/src/main/java/bisq/user/banned/BannedUserService.java @@ -20,9 +20,9 @@ import bisq.common.application.Service; import bisq.common.observable.collection.ObservableSet; import bisq.network.NetworkService; +import bisq.network.identity.NetworkId; import bisq.network.p2p.services.data.DataService; import bisq.network.p2p.services.data.storage.auth.authorized.AuthorizedData; -import bisq.network.p2p.vo.NetworkId; import bisq.persistence.Persistence; import bisq.persistence.PersistenceClient; import bisq.persistence.PersistenceService; diff --git a/user/src/main/java/bisq/user/profile/UserProfile.java b/user/src/main/java/bisq/user/profile/UserProfile.java index b14880b6b2..e1f48afa31 100644 --- a/user/src/main/java/bisq/user/profile/UserProfile.java +++ b/user/src/main/java/bisq/user/profile/UserProfile.java @@ -23,9 +23,9 @@ import bisq.common.proto.UnresolvableProtobufMessageException; import bisq.common.validation.NetworkDataValidation; import bisq.i18n.Res; +import bisq.network.identity.NetworkId; import bisq.network.p2p.services.data.storage.DistributedData; import bisq.network.p2p.services.data.storage.MetaData; -import bisq.network.p2p.vo.NetworkId; import bisq.security.DigestUtil; import bisq.security.pow.ProofOfWork; import bisq.user.NymIdGenerator; diff --git a/user/src/main/proto/user.proto b/user/src/main/proto/user.proto index df2caa1e39..3425183700 100644 --- a/user/src/main/proto/user.proto +++ b/user/src/main/proto/user.proto @@ -20,13 +20,13 @@ syntax = "proto3"; package user; option java_package = "bisq.user.protobuf"; option java_multiple_files = true; -import "network.proto"; +import "network_identity.proto"; import "security.proto"; import "identity.proto"; message UserProfile { string nickName = 1; - network.NetworkId networkId = 2; + network.identity.NetworkId networkId = 2; security.ProofOfWork proofOfWork = 3; string terms = 4; string statement = 5;