Commit Graph

810 Commits

Author SHA1 Message Date
catbref
3c139f3e53 Minor fix-up to allow go-live:
Re-add (for now) Ed25519 HSQLDB conversion.
Catch DataException in BlockChain.isGenesisBlockValid and return false.
Remove duplicate bug-fix for LeaveGroupTransactions DB table.

Interim, near-final blockchain.json
2020-06-26 15:06:04 +01:00
catbref
2c14a12464 Check for unknown Qortal-only AT function codes & add safety to AT running in general 2020-06-25 14:22:28 +01:00
catbref
faa6405d5f Reference fixes for MESSAGE transactions & tests to cover 2020-06-24 17:15:17 +01:00
catbref
e2e4555009 Added /websockets/admin/status and improved GET version.
NodeStatus contructor now fills in fields, which themselves are now 'final'.
NodeStatus also includes numberOfConnections and height as per systray.

AdminResource.status() unified with websocket version.
2020-06-24 11:54:06 +01:00
catbref
448e984995 Fix some minor group-related bugs
Incorrect column names when saving a group ban.

Missing column in LeaveGroupTransactions.

More stringent validity checks in group-kick, group-ban and remove-group-admin.

Added loads more tests to cover group actions.
2020-06-24 11:24:19 +01:00
catbref
ec1954bae1 Notify Chat websocket listeners if group membership changes
Also unified newTransactionExecutor and newBlockExecutor into
callbackExecutor.
2020-06-24 11:22:26 +01:00
catbref
66276a6f65 Merge branch 'ssl' into launch 2020-06-23 14:29:45 +01:00
catbref
c00ab2f87c Add support for HTTPS for API
Requires entries 'sslKeystorePathname' and 'sslKeystorePassword'
in settings.json.

With SSL enabled, API will auto-detect HTTP or HTTPs on the same port.

Included tools/build-keystore.sh to help build keystore from
Let's Encrypt certificates.
2020-06-23 14:27:40 +01:00
catbref
99f3ab9921 /chat/active/{address} now produces entries for groups where {address} is a member, even if there are no messages 2020-06-22 14:16:57 +01:00
catbref
75b15c6639 Improve /chat/active/{address} output to include latest message's sender address, and registered name if applicable 2020-06-19 13:38:38 +01:00
catbref
e5e60a5032 Fix badly named API calls refering to block signers as block minters!
Renamed GET /blocks/minters to /blocks/signers
Renamed GET /blocks/minter/{address} to /blocks/signer/{address}

Changed corresponding repository methods and data classes.
2020-06-16 16:58:34 +01:00
catbref
b9d2bbb78b New /websockets/blocks & some controller/block tidying
Controller.onBlockMinted() now .onNewBlock(BlockData)
which saves having to fetch from repository.
Controller.onNewBlock also takes care of updating Controller's
cached chain tip, requesting SysTray refresh, broadcasting
new tip info to peers and notifying websockets.

BlockMinter and Controller.actuallySynchronize updated
to use unified .onNewBlock.

BlocksWebsocket also returns blocks on demand, given either
integer block height or base58 block signature.

Added support to return ApiError via websockets.
2020-06-15 14:07:09 +01:00
catbref
3d79408574 API GET /blocks/signature/{signature} now returns BLOCK_UNKNOWN instead of null
Also removed unnecessary catch-and-throw of ApiExceptions
2020-06-15 13:18:33 +01:00
catbref
67b184acc9 Chat websockets!
ws://hostname:port/websockets/chat/active/{address}
ws://hostname:port/websockets/chat/messages?txGroupId=XXX
ws://hostname:port/websockets/chat/messages?involving=AAA&involving=BBB
2020-06-12 15:10:55 +01:00
catbref
11040ae60a Added ws://hostname:apiport/websockets/chat/active/{address}
Unified Transaction.importAsUnconfirmed() and Controller.onNetworkTransactionMessage()
to both call Controller.onNewTransaction().

Modified Controller.onNewTransaction() to only send transaction signature to
other peers, instead of full transaction. Peers can request full transaction if they
don't have it.

Controller.onNewTransaction() also calls ChatNotifier, which in turn
notifies websocket handlers about new CHAT transactions.

Added jetty websocket dependency to pom.xml
2020-06-12 10:24:22 +01:00
catbref
a338202ded Fix incorrect PoW buffer usage length in verify & adjust difficulties
CHAT: 8 or 14
MESSAGE: 14
PUBLICIZE: 15
Handshake: 8

Added test to cover verify bug
2020-06-10 10:09:06 +01:00
catbref
e0398490ae Override reference checking for PUBLICIZE transaction type 2020-06-08 09:16:10 +01:00
catbref
847093edac Fix incorrect PoW buffer length usage 2020-06-08 09:01:55 +01:00
catbref
758a42db36 Fix incorrect txType in PUBLICIZE layout 2020-06-05 12:04:59 +01:00
catbref
c2b253df55 Remove extraneous import to cure warning 2020-06-04 18:10:49 +01:00
catbref
cc3adc6720 Correct API models from using "Bitcoin refund/redeem address" to pubkeyhash 2020-06-04 15:51:44 +01:00
catbref
d77acd9eb9 Delete "old" peer from in-memory known peer cache too 2020-06-04 10:57:49 +01:00
catbref
5ad2bc1940 Merge branch 'MESSAGE-PoW' into launch 2020-06-04 10:22:20 +01:00
catbref
ea4c51026b Merge branch 'block-rewards' into launch 2020-06-04 10:22:14 +01:00
catbref
d0b4a1f12f Added PoW to MESSAGE (for zero fee). DB and tx layout changes. 2020-06-04 10:20:02 +01:00
catbref
50b912e229 Improved tools/publish-auto-update.pl 2020-06-03 11:49:49 +01:00
catbref
5ffddd0169 Changes to block reward distribution
Any reward leftover from ditributing to legacy QORA holders is reallocated to either:
founders if any online
or
account-level-based reward candidates, if no founders online

We should get pretty close to 100% block reward distribution, barring rounding artifacts.

More documentation and tests.

Removed BlockChain's founderShare as it is calculated in Block on a per-block basis instead.
2020-06-02 10:42:45 +01:00
catbref
b5512dfa91 Rework block rewards to be faster and only reward *online* founders.
Now we sum generic block reward + transaction fees before performing
distribution only once.

Added Map to collate account-balance changes during block reward
distribution so the final changes can be applied in one batch,
reducing DB load.

Some other optimizations like a faster ExpandedAccount.getShareBin().

Passes test EXCEPT RewardTests.testLegacyQoraReward(), pending decision
on how to reallocate 'unspent' block reward.
2020-06-01 16:50:28 +01:00
catbref
2493d5f7a8 Fix wrong test blockchain config being used for legacy qora holder testing 2020-06-01 16:44:56 +01:00
catbref
bef1828404 Add support for multiple P2SH funding transactions rather than requiring only one 2020-05-29 19:10:20 +01:00
catbref
0ae232b8ba Fix return result from ElectrumX.broadcastTransaction 2020-05-29 19:09:45 +01:00
catbref
cdf0795881 Add extra test case to MemoryPoW 2020-05-28 14:15:42 +01:00
catbref
31e85226f4 WASM version of MemoryPoW! 2020-05-28 14:09:53 +01:00
catbref
8df3c68df9 Update auto-update tools to work with testnet and on non-master branch (e.g. a testnet branch) 2020-05-27 11:49:59 +01:00
catbref
ca0deb2bf6 Allow tools/build-auto-update.sh to work on non-master branch (with warning) 2020-05-27 11:08:56 +01:00
catbref
6eea7c2aa1 Disallow registering/updating to a name that looks like an address 2020-05-27 10:56:03 +01:00
catbref
9aabf93523 Merge branch 'PUBLICIZE-txn' into launch 2020-05-27 10:46:27 +01:00
catbref
322e2cdc41 API call /crosschain/p2sh/redeem returns BTC_BALANCE_ISSUE in preference to INVALID_ADDRESS when P2SH balance is too low/zero 2020-05-27 10:44:37 +01:00
catbref
df395c77db Fix up BTCACCT.findP2shSecret given reduced data available since switch to ElectrumX 2020-05-27 10:43:14 +01:00
catbref
274002c473 Fix BTC.getMedianBlockTime() and update tests 2020-05-27 09:29:11 +01:00
catbref
3d4fc38fcb Replaced bitcoinj networking with ElectrumX.
No more bitcoinj peer-group stalls, or slow startups,
or downloading tons of block headers, or checkpoint files.

Now we use ElectrumX protocol to query info from random servers.

Also:
BTC.hash160 callers now use Crypto.hash160 instead.
Added BitTwiddling.fromLEBytes() returns int.

Unit tests seem OK, but needs complete testnet ACCT walkthrough.
2020-05-26 17:47:37 +01:00
catbref
d50f16b8a9 PUBLICIZE transaction for on-chain record of public key 2020-05-25 15:20:21 +01:00
catbref
59de22883b Use CHAT, not MESSAGE, MAX_DATA_SIZE in ChatTransactionTransformer 2020-05-25 08:30:06 +01:00
catbref
db73afaf88 Remove Block.orphan() forced repository debugging 2020-05-25 07:27:42 +01:00
catbref
3afbd7aa51 Recheck for duplicate connection after handshaking to cover race condition with simultaneous bi-directional connections 2020-05-25 07:24:19 +01:00
catbref
0c32afa07f New network handshaking. NOT backwards compatible!
Old Qora v1 message types removed.
Message type values changed.

Network handshaking reworked to fix multiple-connections issue.
Instead of using some random peerID, we now use proper keypairs and a challenge-response handshake to prevent doppelgangers/ID-theft.
This results in simpler handshaking code as we don't have to perform some arcane doppelganger resolution.

Handshaking still uses proof-of-work for challenge-response, but switched to newer MemoryPoW.

API call GET /peers no longer has 'buildTimestamp' field, but does now have 'nodeId' field.

Network no longer has a whole raft of getXXXpeers() due to simplified handshaking.
Quite a few method calls changed to simply Network.getHandshakedPeers(), which is also faster.
2020-05-22 17:16:45 +01:00
catbref
bd543a526b Update uses of old Public/PrivateKeyAccount static methods to Crypto 2020-05-22 17:13:55 +01:00
catbref
b262044a52 Move some crypto methods from Public/PrivateKeyAccount to Crypto for reuse by new network handshaking 2020-05-22 17:06:48 +01:00
catbref
200a97184c Include transaction reference in chat messages returned by API call GET /chat/messages 2020-05-22 08:00:43 +01:00
catbref
0164bca2d7 Exclude io.druid.java-util from build, removing tons of libsigar 2020-05-21 17:05:17 +01:00