Proxy private keys are now SHA256(shared secret only) instead of SHA256(shared secret + public keys).

HTML/JS in src/test/resources/proxy-key-example.html updated accordingly.

Add handshake status to output of API call GET /peers

Add/correct @ApiErrors annotations on some API calls.

Add API call POST /admin/orphan (target height as body)
to force blockchain orphaning for when node is wildly out of sync.
Added support for above to BlockChain class.

BlockGenerator now requires a minimum number of peers
before it will generate any new blocks.
See "minBlockchainPeers" in settings.

Controller now requires a minimum number of peers
before it will consider synchronizing.
See "minBlockchainPeers" in settings.

Old "minPeers" entry in settings.json no longer valid!

Networking now allows both an outbound and inbound connection
to a peer although will use the outbound connection in preference.

Networking checks peer ID of inbound connections to detect,
and resolve, peer ID clashes/theft.
This commit is contained in:
catbref
2019-05-24 12:39:24 +01:00
parent 40d6190265
commit 8f7c954f5a
19 changed files with 428 additions and 53 deletions

View File

@@ -0,0 +1,17 @@
package org.qora.test;
import org.junit.Test;
import org.qora.gui.SplashFrame;
public class GuiTests {
@Test
public void testSplashFrame() throws InterruptedException {
SplashFrame splashFrame = SplashFrame.getInstance();
Thread.sleep(2000L);
splashFrame.dispose();
}
}

View File

@@ -25,18 +25,8 @@
var sharedSecret = nacl.crypto_scalarmult(mintingX25519Prk, recipientAccountX25519Puk);
console.log("shared secret (for debugging): " + Base58.encode(sharedSecret));
// Data to be hashed: shared secret (32 bytes) + minting public key (32 bytes) + recipient public key (32 bytes)
// or, in general terms: shared secret (32 bytes) + public key from private key (32 bytes) + other party's public key (32 bytes)
var proxyHashData = new Uint8Array(sharedSecret.length + mintingAccountPuk.length + recipientAccountPuk.length);
// copy shared secret into array, starting at index 0
proxyHashData.set(sharedSecret);
// copy minting account public key into array, starting at index 32
proxyHashData.set(mintingAccountPuk, sharedSecret.length);
// copy recipient account public key into array, starting at index 64 (32 + 32)
proxyHashData.set(recipientAccountPuk, sharedSecret.length + mintingAccountPuk.length);
// Proxy PRIVATE key is SHA256 of data above
var proxyPrivateKey = nacl.crypto_hash_sha256(proxyHashData)
// Proxy PRIVATE key is SHA256 of shared secret
var proxyPrivateKey = nacl.crypto_hash_sha256(sharedSecret)
console.log("proxy private key: " + Base58.encode(proxyPrivateKey));
var proxyKeyPair = nacl.crypto_sign_seed_keypair(proxyPrivateKey);