Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Remove Peer json RPC added #1129

Merged
merged 17 commits into from
Mar 20, 2019
Merged

Remove Peer json RPC added #1129

merged 17 commits into from
Mar 20, 2019

Conversation

rain-on
Copy link
Contributor

@rain-on rain-on commented Mar 19, 2019

RemovePeer Json RPC has been added, it is responsible disconnecting from the specified peer and removing it from the maintained list of peers.

tmohay added 8 commits March 15, 2019 15:43
The staticnodes.json file resides in the pantheon data directory,
is parsed at startup to determine which peers can be connected
to (aside from bootnodes), and is updated whenever addPeer/removePeer
RPC is invoked.

This file is not updated when finding neighbour peers (ONLY on RPC
call).
@rain-on rain-on requested review from ajsutton, jframe and CjHare March 19, 2019 04:17
@@ -66,7 +67,11 @@ public int size() {
}

public boolean isAlreadyConnected(final BytesValue nodeId) {
return connections.containsKey(nodeId);
return getConnectionForPeer(nodeId).isPresent();
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this need to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kinda preferred re-using the same interface as was now exposed ... but have changed it back.

import org.junit.Test;
import org.junit.rules.TemporaryFolder;

public class StaticeNodesParserTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

class name is misnamed. perhaps will be fixed by merge/rebase from master?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

file now removed.

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public abstract class AdminPeerModification implements JsonRpcMethod {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Something makes me think that AdminModifyPeer would be more consistent. (Noun-verb-noun instead of Noun-Noun-verb?)

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.

@rain-on rain-on merged commit 25b3a49 into PegaSysEng:master Mar 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants