-
Notifications
You must be signed in to change notification settings - Fork 197
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
Conversation
iulianpascalau
commented
Mar 10, 2022
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.