Tabnine Logo
NodeInfo.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.icodici.universa.node2.NodeInfo
constructor

Best Java code snippets using com.icodici.universa.node2.NodeInfo.<init> (Showing top 20 results out of 315)

origin: UniversaBlockchain/universa

  public static NodeInfo initFrom(ResultSet rs) throws SQLException, EncryptionError {
    return new NodeInfo(new PublicKey(rs.getBytes("public_key")), rs.getInt("node_number"), rs.getString("node_name"), rs.getString("host"),rs.getString("public_host"),
        rs.getInt("udp_server_port"), rs.getInt("http_client_port"), rs.getInt("http_server_port"));

  }
}
origin: UniversaBlockchain/universa

return new NodeInfo(
    key,
    b.getIntOrThrow("node_number"),
origin: UniversaBlockchain/universa

@Test
public void twoAdapters() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
origin: UniversaBlockchain/universa

@Test
public void sendTrippleAndReceive() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
  NodeInfo node3 = new NodeInfo(TestKeys.publicKey(2),12, "test_node_12", "localhost", 16204, 16205, 16303);
origin: UniversaBlockchain/universa

@Test
public void concurrencySend() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
origin: UniversaBlockchain/universa

NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo n = new NodeInfo(TestKeys.publicKey(keyIndex),2 + i, "test_node_2" + i, "localhost", 16203 + i, 16204+i, 16302+i);
origin: UniversaBlockchain/universa

new NodeInfo(
    getNodeKey(i).getPublicKey(),
    i,
origin: UniversaBlockchain/universa

NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),1, "test_node_1", "localhost", 16201, 16202, 16301);
  NodeInfo n = new NodeInfo(TestKeys.publicKey(keyIndex),2 + i, "test_node_r_" + i, "localhost", 16203 + i, 16204+i, 16302+i);
origin: UniversaBlockchain/universa

NodeInfo myInfo = new NodeInfo(getNodePublicKey(0), 1, "node1", "localhost",
    7101, 7102, 7104);
NetConfig nc = new NetConfig(asList(myInfo));
origin: UniversaBlockchain/universa

@Test
public void sendAndReceive() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
  NodeInfo node3 = new NodeInfo(TestKeys.publicKey(2),12, "test_node_12", "localhost", 16204, 16205, 16303);
origin: UniversaBlockchain/universa

NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
origin: UniversaBlockchain/universa

NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
origin: UniversaBlockchain/universa

@Test
public void sendTrippleMultiTimesAndReceive() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
  NodeInfo node3 = new NodeInfo(TestKeys.publicKey(2),12, "test_node_12", "localhost", 16204, 16205, 16303);
origin: UniversaBlockchain/universa

NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
origin: UniversaBlockchain/universa

public void sendBigData() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
origin: UniversaBlockchain/universa

@Test
public void packUnpack() throws Exception {
  NodeInfo ni = new NodeInfo(TestKeys.publicKey(0),1, "test1", "localhost", 17101, 17102, 17104);
  HashId id1 = HashId.createRandom();
  ZonedDateTime now = ZonedDateTime.now().truncatedTo(ChronoUnit.SECONDS);
  ZonedDateTime expiresAt = now.plusDays(30);
  ItemResult ir1 = new ItemResult(ItemState.PENDING, false, now, expiresAt);
  ItemResult ir2 = new ItemResult(ItemState.REVOKED, true, now, expiresAt);
  ItemNotification n1 = new ItemNotification(ni, id1, ir1, true);
  ItemNotification n2 = new ItemNotification(ni, id1, ir1, false);
  ItemNotification n3 = new ItemNotification(ni, id1, ir1, true);
  byte[] packed = Notification.pack(asList(n1, n2, n3));
  List<Notification> l = Notification.unpack(ni, packed);
  assertEquals(3, l.size());
  ItemNotification n = (ItemNotification) l.get(0);
  assertEquals(n, n1);
  n = (ItemNotification) l.get(1);
  assertEquals(n, n2);
  n = (ItemNotification) l.get(2);
  assertEquals(n, n3);
}
origin: UniversaBlockchain/universa

int offset = 7100 + 10 * i;
NodeInfo info =
    new NodeInfo(
        getNodeKey(i).getPublicKey(),
        i,
origin: UniversaBlockchain/universa

private void loadNodeConfig() throws IOException, SQLException {
  Yaml yaml = new Yaml();
  configRoot = (String) options.valueOf("config");
  nodeKey = null;
  Binder settings = Binder.of(yaml.load(new FileInputStream(configRoot + "/config/config.yaml")));
  log("node settings: " + settings);
  String nodeKeyFileName = configRoot + "/tmp/" + settings.getStringOrThrow("node_name") + ".private.unikey";
  log(nodeKeyFileName);
  nodeKey = new PrivateKey(Do.read(nodeKeyFileName));
  myInfo = new NodeInfo(nodeKey.getPublicKey(),
             settings.getIntOrThrow("node_number"),
             settings.getStringOrThrow("node_name"),
             (String) settings.getListOrThrow("ip").get(0),
             settings.getStringOrThrow("public_host"),
             settings.getIntOrThrow("udp_server_port"),
             settings.getIntOrThrow("http_client_port"),
             settings.getIntOrThrow("http_server_port")
  );
  config.setIsFreeRegistrationsAllowedFromYaml(settings.getBoolean("allow_free_registrations", false));
  config.setPermanetMode(settings.getBoolean("permanet_mode", false));
  ledger = new PostgresLedger(settings.getStringOrThrow("database"));
  log("ledger constructed");
  log("key loaded: " + nodeKey.info());
  log("node local URL: " + myInfo.publicUrlString());
  log("node info: " + myInfo.toBinder());
}
origin: UniversaBlockchain/universa

int offset = 7100 + 10 * i;
NodeInfo info =
    new NodeInfo(
        getNodeKey(i).getPublicKey(),
        i,
origin: UniversaBlockchain/universa

@Test
public void sendBadNetConfig() throws Exception {
  NodeInfo node1 = new NodeInfo(TestKeys.publicKey(0),10, "test_node_10", "localhost", 16201, 16202, 16301);
  NodeInfo node2 = new NodeInfo(TestKeys.publicKey(1),11, "test_node_11", "localhost", 16203, 16204, 16302);
  NodeInfo node3 = new NodeInfo(TestKeys.publicKey(2),12, "test_node_12", "localhost", 16204, 16205, 16303);
com.icodici.universa.node2NodeInfo<init>

Popular methods of NodeInfo

  • publicUrlString
  • getName
    String node name is now a secondary identificator
  • getNodeAddress
  • getNumber
    Integer node it is now the preferred way to identify nodes
  • getPublicKey
  • internalUrlString
  • equals
  • getClientAddress
  • getPublicHost
  • getServerAddress
  • hashCode
  • initFrom
  • hashCode,
  • initFrom,
  • loadYaml,
  • toBinder

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Option (scala)
  • Top Vim plugins
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