Tabnine Logo
Client.size
Code IndexAdd Tabnine to your IDE (free)

How to use
size
method
in
com.icodici.universa.node2.network.Client

Best Java code snippets using com.icodici.universa.node2.network.Client.size (Showing top 7 results out of 315)

origin: UniversaBlockchain/universa

public int size() {
  return client.size();
}
origin: UniversaBlockchain/universa

public void setNodes(List<NodeRecord> nodes) {
  this.nodes = nodes;
  clients = new ArrayList<>(size());
  clients.addAll(Collections.nCopies(nodes.size(),null));
}
origin: UniversaBlockchain/universa

/**
 * Create new client protocol session. It loads network configuration and creates client protocol session with random node. Allows delayed start of http client
 * @param someNodeUrl url on some node in network
 * @param clientPrivateKey client private key
 * @param session set to null or to the reconstructed instance
 * @param delayedStart indicates if start of http client should be delayed
 * @throws IOException
 */
public Client(String someNodeUrl, PrivateKey clientPrivateKey, BasicHttpClientSession session, boolean delayedStart) throws IOException {
  this.clientPrivateKey = clientPrivateKey;
  loadNetworkFrom(someNodeUrl);
  clients = new ArrayList<>(size());
  for (int i = 0; i < size(); i++) {
    clients.add(null);
  }
  NodeRecord r = Do.sample(nodes);
  httpClient = new BasicHttpClient(r.url);
  this.nodePublicKey = r.key;
  if(!delayedStart)
    httpClient.start(clientPrivateKey, r.key, session);
}
origin: UniversaBlockchain/universa

public ClientNetwork(String nodeUrl, PrivateKey privateKey, BasicHttpClientSession session) throws IOException {
  client = new Client(nodeUrl, privateKey, session);
  if (client == null)
    throw new IOException("failed to connect to to the universa network");
  reporter.verbose("Read Universa network configuration: " + client.size() + " nodes");
  reporter.message("Network version: " + client.getVersion());
}
origin: UniversaBlockchain/universa

AtomicInteger okNodes = new AtomicInteger(0);
final List<Client.NodeRecord> nodes = client.getNodes();
for (int nn = 0; nn < client.size(); nn++) {
  final int nodeNumber = nn;
  futures.add(
es.shutdown();
int n = okNodes.get();
if (n >= client.size() * 0.12)
  reporter.message("Universa network is active, " + n + " node(s) are reachable");
else
origin: UniversaBlockchain/universa

public ClientNetwork(String nodeUrl, BasicHttpClientSession session, boolean delayedStart) throws IOException {
  client = new Client(nodeUrl, CLIMain.getPrivateKey(), session, delayedStart);
  if (client == null)
    throw new IOException("failed to connect to to the universa network");
  reporter.verbose("Read Universa network configuration: " + client.size() + " nodes");
  reporter.message("Network version: " + client.getVersion());
}
origin: UniversaBlockchain/universa

public ClientNetwork(BasicHttpClientSession session, boolean delayedStart) throws IOException {
  for (int i = 1; i < 10; i++) {
    try {
      client = new Client("http://node-" +
          Do.randomIntInRange(1, 10) +
          "-com.universa.io:8080", CLIMain.getPrivateKey(), session, delayedStart);
      break;
    } catch (IOException e) {
      reporter.warning("failed to read network from node " + i);
    }
  }
  if (client == null)
    throw new IOException("failed to connect to to the universa network");
  reporter.verbose("Read Universa network configuration: " + client.size() + " nodes");
  reporter.message("Network version: " + client.getVersion());
}
com.icodici.universa.node2.networkClientsize

Javadoc

Get nodes count in network.

Popular methods of Client

  • getState
  • <init>
    Create new client protocol session. It loads network configuration and creates client protocol sessi
  • getClient
  • getNodes
    Get list of nodes in
  • ping
  • register
    Register contract on the network without payment. May require special client key / network configura
  • command
    Execude custom command on the node
  • getNodeNumber
    Get number of node cliet connection is established with
  • getVersion
    Get network version
  • registerParcelWithState
    Register contract on the network with parcel (includes payment) and wait for some of the final ItemS
  • getParcelProcessingState
    Get processing state of given parcel
  • getSession
    Get session of http client connected to node with given number
  • getParcelProcessingState,
  • getSession,
  • getStats,
  • queryContract,
  • resyncItem,
  • setVerboseLevel,
  • followerGetRate,
  • getBody,
  • getContract

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BoxLayout (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now