Skip to content
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

Send data on connected peer #3896

Merged
merged 4 commits into from
Mar 14, 2022
Merged

Conversation

iulianpascalau
Copy link
Contributor

  • added the possibility to send to a newly connected peer some extra data

install-proto.sh Outdated
@@ -42,7 +42,7 @@ cd "${GOPATH}"/src/github.com/ElrondNetwork
if [ ! -d "protobuf" ]
then
echo "Cloning ElrondNetwork/protobuf..."
git clone https://github.com/ElrondNetwork/protobuf.git
git clone https://github.com/ElrondNetwork/protobuf/protobuf.git
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


netMes.mutCurrentBytesProvider.Lock()
netMes.currentBytesProvider = currentBytesProvider
netMes.mutCurrentBytesProvider.Unlock()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after setting the new currentBytesProvider let's notify all already connected peers. In this way, all other peers will be notified what is the new shard for the connected peer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -493,6 +500,22 @@ func (netMes *networkMessenger) createConnectionMonitor(p2pConfig config.P2PConf
return nil
}

// PeerConnected can be called whenever a new peer is connected to this host
func (netMes *networkMessenger) PeerConnected(pid core.PeerID) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should think of a way to somehow close the network messenger after the bootstrapping is done.
Why? Because we should correctly setup the network messenger with the "final" processing components able to be notified and notify as well the new peers that will interact with. Will think of a solution to this.

@bogdan-rosianu bogdan-rosianu self-requested a review March 11, 2022 07:43
p2p/libp2p/disabled/peerDenialEvaluator.go Outdated Show resolved Hide resolved
p2p/libp2p/netMessenger.go Outdated Show resolved Hide resolved
p2p/libp2p/netMessenger.go Outdated Show resolved Hide resolved
@sstanculeanu sstanculeanu self-requested a review March 11, 2022 09:40
sstanculeanu
sstanculeanu previously approved these changes Mar 11, 2022
Copy link
Contributor

@sstanculeanu sstanculeanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bogdan's points only.

sstanculeanu
sstanculeanu previously approved these changes Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants