Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
811 commits
Select commit Hold shift + click to select a range
8c325f3
original design
Aug 11, 2021
673f23b
Improvement to commit f71516f
Aug 12, 2021
b4f980b
Restrict lists API endpoints to local/apiKey requests only.
Aug 12, 2021
1b39db6
Added missing ATStatesHeightIndex to the reshape code.
Aug 27, 2021
e7e4cb7
Started work on pruning mode (top-only-sync)
Aug 22, 2021
bc1af12
Prune all blocks up until the blockPruneLimit
Aug 22, 2021
209a9fa
Rework of Blockchain.validate() to account for pruning mode.
Aug 22, 2021
c8466a2
Updated AT states pruner as it previously relied on blocks being pres…
Aug 22, 2021
22efacc
Fixed NPE introduced in earlier commit.
Aug 22, 2021
f5910ab
Break out of the AT pruning inner loops if we're stopping the app.
Aug 22, 2021
5127f94
Added bulk pruning phase on node startup the first time that pruning …
Aug 23, 2021
ca1379d
Unified the code to build the LatestATStates table, as it's now used …
Aug 25, 2021
ff841c2
Updated tests to use the renamed method.
Aug 25, 2021
cd9d9b3
Prune ATStatesData as well as the ATStates when switching to pruning …
Aug 25, 2021
9056cb7
Increased atStatesPruneBatchSize from 10 to 25.
Aug 25, 2021
2479f2d
Moved trimming and pruning classes into a single package (org.qortal.…
Aug 25, 2021
9973fe4
Synchronized LatestATStates, to make rebuildLatestAtStates() thread s…
Aug 28, 2021
25c17d3
atStatesMaxLifetime reduced from 14 days to 24 hours
Sep 3, 2021
0298898
Reduced online account signatures min and max lifetimes
Sep 3, 2021
703cdfe
Added block archive mode
Sep 4, 2021
278201e
Workaround for block 535658 problem
Sep 5, 2021
6b74ef7
Increased log level of invalid transaction message.
Sep 5, 2021
25b787f
Add files via upload
Sep 5, 2021
673ee4a
Update Block.java
Sep 5, 2021
6d1f7b3
Merge pull request #58 from QuickMythril/536140-fix
Sep 5, 2021
172a629
Added comments
Sep 5, 2021
b800fb5
Treat a REGISTER_NAME transaction as an UPDATE_NAME if the creator ma…
Sep 9, 2021
a6bbc81
Revert "Merge pull request #58 from QuickMythril/536140-fix"
Sep 9, 2021
63c9bc5
Revert "Workaround for block 535658 problem"
Sep 9, 2021
e90c3a7
Updated default "data" field text in the API documentation, to match …
Sep 9, 2021
0657ca2
atStatesMaxLifetime increased to 5 days
Sep 9, 2021
14acc4f
Removed maxDuplicatedBlocksWhenArchiving setting as it's no longer ne…
Sep 12, 2021
2a36b83
Removed BLOCK_LIMIT_REACHED result from the block archive writer.
Sep 12, 2021
6a55b05
Fixed some bugs found in unit testing.
Sep 12, 2021
1d8351f
Added importFromArchive() feature
Sep 12, 2021
14f6fd1
Added unit tests for trimming, pruning, and archiving.
Sep 12, 2021
ce60ab8
Updated naming unit tests
Sep 12, 2021
ba06225
Merge branch 'master' into block-archive
Sep 12, 2021
d600a54
Modified name update tests to check the reduced name.
Sep 14, 2021
cc65a7c
Fixed bug which prevented the "reduced name" from being updated in UP…
Sep 14, 2021
33ac1fe
Revert "Treat a REGISTER_NAME transaction as an UPDATE_NAME if the cr…
Sep 16, 2021
06a2c38
Updated and added some naming tests.
Sep 17, 2021
54e5a65
Allow an alternative block to be minted if the chain stalls due to an…
Sep 18, 2021
44a90b4
Keep track of invalid block signatures and avoid peers that return them
Sep 18, 2021
705e7d1
Test name.register() and name.unregister()
Sep 18, 2021
8a7446f
Added "apiKeyDisabled" setting to bypass API key / loopback checking …
Sep 19, 2021
47a34c2
Validate blocks in syncToPeerChain() before orphaning
Sep 19, 2021
a4f5124
Delete signatures from the invalidBlockSignatures array if we haven't…
Sep 19, 2021
3b156bc
Added database integrity check for registered names
Sep 19, 2021
39d5ce1
Removed unused import.
Sep 19, 2021
449761b
Rework of "Names" integrity check
Sep 22, 2021
5869174
Combined the three invalid name registration block patches into a sin…
Sep 23, 2021
e6bde3e
Minimum order size set to 0.01 LTC, to avoid dust errors.
Sep 23, 2021
573f467
Reduced online account signatures min and max lifetimes
Sep 3, 2021
9eab500
atStatesMaxLifetime reduced from 14 days to 5 days
Sep 23, 2021
957944f
Revert "original design"
Sep 23, 2021
78e2ae4
Allow trade bots in the REFUNDING state to be deleted, if the user ch…
Sep 23, 2021
3400e36
Started work on pruning mode (top-only-sync)
Aug 22, 2021
1b4c75a
Prune all blocks up until the blockPruneLimit
Aug 22, 2021
925e10b
Rework of Blockchain.validate() to account for pruning mode.
Aug 22, 2021
01d6621
Updated AT states pruner as it previously relied on blocks being pres…
Aug 22, 2021
44607ba
Fixed NPE introduced in earlier commit.
Aug 22, 2021
1a722c1
Break out of the AT pruning inner loops if we're stopping the app.
Aug 22, 2021
f056ecc
Added bulk pruning phase on node startup the first time that pruning …
Aug 23, 2021
734fa51
Unified the code to build the LatestATStates table, as it's now used …
Aug 25, 2021
6763205
Updated tests to use the renamed method.
Aug 25, 2021
64e8a05
Prune ATStatesData as well as the ATStates when switching to pruning …
Aug 25, 2021
89283ed
Increased atStatesPruneBatchSize from 10 to 25.
Aug 25, 2021
dc030a4
Moved trimming and pruning classes into a single package (org.qortal.…
Aug 25, 2021
87595fd
Synchronized LatestATStates, to make rebuildLatestAtStates() thread s…
Aug 28, 2021
70c6048
Added block archive mode
Sep 4, 2021
5656de7
Removed maxDuplicatedBlocksWhenArchiving setting as it's no longer ne…
Sep 12, 2021
37e03bf
Removed BLOCK_LIMIT_REACHED result from the block archive writer.
Sep 12, 2021
fea7b62
Fixed some bugs found in unit testing.
Sep 12, 2021
9813dde
Added importFromArchive() feature
Sep 12, 2021
74ea2a8
Added unit tests for trimming, pruning, and archiving.
Sep 12, 2021
4856223
Fixed error in rebase.
Sep 24, 2021
6ee7e9d
Merge branch 'block-archive' of github.com:Qortal/qortal into block-a…
Sep 24, 2021
1f79d88
Fixed errors found in unit tests.
Sep 24, 2021
4c171df
Disable archiving and pruning if the AtStatesHeightIndex is missing, …
Sep 24, 2021
841b6c4
Fixed another issue causing ATStatesHeightIndex to go missing after p…
Sep 24, 2021
19bf8af
Fixed bug in pruning phase on node startup
Sep 24, 2021
656896d
Fixed issue causing base block prune/trim heights to not be updated o…
Sep 24, 2021
28ff563
Bump version to 1.7.0
Sep 26, 2021
3222743
Updated AdvancedInstaller project for v1.7.0
Sep 27, 2021
114833c
Fixed NPE when attempting to lookup a block signature that doesn't ex…
Sep 27, 2021
8926d2a
Rework of import/export process.
Sep 28, 2021
e2a62f8
Modified repository backup and recovery to allow a custom filename to…
Sep 28, 2021
de8e96c
Added Blockchain.validateAllBlocks() to check every block back to gen…
Sep 28, 2021
0a4479f
Initial implementation of automatic bootstrapping
Sep 28, 2021
ce5bc80
Increased threshold of BlockArchiveWriter.isArchiverUpToDate() from 9…
Sep 28, 2021
0d17f02
Pass a repository instance into the bulk archiving and pruning methods.
Sep 28, 2021
347d799
Reduce log spam.
Sep 28, 2021
7375357
Added bootstrap tests
Oct 1, 2021
5b23117
Fixed small issues with block archive tests.
Oct 1, 2021
446f924
Added bulk pruning test, which highlighted some bugs in both bulk and…
Oct 1, 2021
49749a0
Added more precise checking of database states to the bulk pruning te…
Oct 1, 2021
53cd967
Added defrag (repository maintenance) tests.
Oct 1, 2021
1ba542e
Simplified minting code in block archive tests.
Oct 1, 2021
ca02cd7
Fixed issue in block archiver, which caused it to hold a transaction …
Oct 2, 2021
ca7f42c
Reduced unnecessary database queries in the block archiver.
Oct 2, 2021
c4d7335
Fixed more issues that could cause transactions to be held open.
Oct 2, 2021
adeb654
Rework of repository maintenance and backups
Oct 2, 2021
47b1b6d
Retry the entire bootstrap import process on failure, rather than jus…
Oct 2, 2021
51bb776
Select a random host when importing a bootstrap, and started adding s…
Oct 2, 2021
d25a77b
Ignore bootstraps and other 7z archives in git.
Oct 2, 2021
ea92ccb
"pruningEnabled" setting renamed to "topOnly"
Oct 2, 2021
1f8fbfa
Missed a few topOnly references from the last commit.
Oct 2, 2021
1b3f37e
Delete the "archive" folder when in top-only mode
Oct 2, 2021
8eddaa3
Small refactor to update wording.
Oct 2, 2021
63a35c9
Fixed bug in path returned to POST /bootstrap/create API.
Oct 2, 2021
8aaf720
Force archiveEnabled to false if we're in top only mode.
Oct 2, 2021
9591c4e
Added support for creating top-only bootstraps
Oct 2, 2021
a6d3891
Fixed bugs when importing bootstrap.
Oct 3, 2021
35718f6
Fixed issue with bootstrap retries.
Oct 3, 2021
7e5dd62
Show bootstrap statuses on splash frame.
Oct 3, 2021
b00c1c1
Update splash frame statuses when reshaping, pruning, or building the…
Oct 3, 2021
f09fb5a
Run the bulk block archiver any time that it isn't reported to be up …
Oct 3, 2021
fc8e38e
Show version number in the "Starting Qortal Core" status.
Oct 3, 2021
494cd0e
Added white background to splash frame - I think it looks nicer this …
Oct 3, 2021
f67a046
SplashFrame styling improvements
Oct 3, 2021
5b02842
Checkpoint immediately after starting/upgrading the repository
Oct 3, 2021
dc876d9
Force a bootstrap if the block archive isn't intact on launch
Oct 3, 2021
52b322b
Take a backup of local data before overwriting with a bootstrap.
Oct 3, 2021
59c8e4e
Fixed bug in earlier commit
Oct 3, 2021
75ed5db
Test multiple files when bulk archiving.
Oct 3, 2021
ac49221
Show warning status on startup if the database is missing the AtState…
Oct 3, 2021
4f89283
Show maximum time estimations in archiving and pruning statuses
Oct 3, 2021
3bb3528
Merge branch 'master' into bootstrap
Oct 3, 2021
b6d3e82
Update status when performing repository maintenance
Oct 3, 2021
4f48751
Fixed issue caused when trying to update the splash frame status in a…
Oct 3, 2021
210368b
Bump version to 2.0.0-beta.0
Oct 3, 2021
cdf47d4
Reduce log spam.
Oct 3, 2021
41c2ed7
Fixed out of memory errors when copying AT states.
Oct 3, 2021
889f6fc
Add a "testnet-" prefix in filenames when creating or importing boots…
Oct 3, 2021
5397e6c
Bump version to 2.0.0-beta.1
Oct 3, 2021
850d879
Use a "tmp" folder in the Qortal directory rather than a system gener…
Oct 4, 2021
de3ebf6
Fixed issue with format specifier
Oct 4, 2021
0135f25
Delete existing repository before extracting bootstrap
Oct 4, 2021
71f802e
Exponentially backoff when bootstrapping fails, to reduce bandwidth
Oct 4, 2021
289dae0
Fixed issue causing the local repository data backup to be overwritte…
Oct 4, 2021
65dca36
Show progress status when downloading a bootstrap
Oct 4, 2021
ddf966d
Show progress status when extracting files
Oct 4, 2021
27903f2
Add tmp folder to gitignore
Oct 4, 2021
e07238d
Fixed variable name
Oct 4, 2021
0d64090
Added another bootstrap host
Oct 5, 2021
b7e9af1
Added scheduled repository maintenance feature. Currently disabled by…
Oct 6, 2021
c5b2c0b
Create SysTray_de.properties
tobiaswild Oct 6, 2021
000f9ed
Update ApiError_de.properties
tobiaswild Oct 6, 2021
cd359de
Scheduled maintenance now enabled by default, but uses a min and a ma…
Oct 6, 2021
9bcd0bb
Reduce log spam
Oct 6, 2021
2f6a8f7
Invert the colours in the splash screen
Oct 6, 2021
8d6dffb
Added test for bootstrap random host selection.
Oct 6, 2021
81bf79e
Bump version to 2.0.0-beta.2
Oct 6, 2021
c822933
Show full exception stack trace when a bootstrap import fails
Oct 6, 2021
179bd8e
Moved repository reopen to the finally {} block, so that we're never …
Oct 6, 2021
7105872
Improved exception message
Oct 6, 2021
4dff91a
Initial bootstrap import retry interval reduced from 5 minutes to 1 m…
Oct 6, 2021
0450264
Create a cleaner base directory path, without the "/./"
Oct 6, 2021
5a55ef6
Bump version to 2.0.0-beta.3
Oct 6, 2021
c256dae
Ensure that the temp directory is always in the parent directory of t…
Oct 7, 2021
ab7d24b
Updated status wording
Oct 7, 2021
bfaf4c5
Make sure to check the archive when serving block summaries and signa…
Oct 7, 2021
dff9ec0
Don't attempt to cache blocks from the archive, as they will never be…
Oct 7, 2021
f6effbb
Removed unnecessary repository parameter from PruneManager.isBlockPru…
Oct 7, 2021
33b715e
Merge branch 'networking' into v2.0-beta
Oct 7, 2021
abab2d1
Fixed issue preventing blocks from being served from the archive.
Oct 8, 2021
d00fce8
Treat the genesis block as unpruned, as we leave this in the HSQLDB r…
Oct 8, 2021
dedc8d8
Handle case when attempting to load a block from the archive by refer…
Oct 8, 2021
1b17c26
Show "full node" or "top-only" in the "Downloading bootstrap" message.
Oct 8, 2021
47ce884
Delete all known peers when creating a bootstrap
Oct 8, 2021
a1e4047
Rework of bootstrap finalization process.
Oct 8, 2021
f53e2ff
Add initial peers on node startup if we don't have any in the reposit…
Oct 8, 2021
17e65e4
Bump version to 2.0.0-beta.4
Oct 8, 2021
a3dcaca
Now showing errors directly in the POST /bootstrap/create API response.
Oct 9, 2021
f6c1a7e
Disregard exceptions in the bootstrap creation cleanup process becaus…
Oct 9, 2021
63cabbe
Log the full exception details and stack trace when creating bootstraps.
Oct 9, 2021
b265dc3
Don't log the complete stack trace for exceptions generated by bootst…
Oct 9, 2021
0040108
Simplified cleanup process. Individual deletions aren't needed as the…
Oct 9, 2021
3fb7df1
Delete temp directories at the beginning of the bootstrap process too…
Oct 9, 2021
9f488b7
Sleep for 5s before cleaning up temp path, in case this improves reli…
Oct 9, 2021
ba27225
Bump version to 2.0.0-beta.5
Oct 9, 2021
f34bdf0
Fixed issue causing minting accounts to be lost in some cases when au…
Oct 9, 2021
a78af8f
Added SHA-256 file digest utility methods.
Oct 9, 2021
eb991c6
Fixed issue causing bootstrap validation to be ignored before creation.
Oct 9, 2021
a7f212c
Create a .sha256 file to accompany each bootstrap
Oct 9, 2021
e7bf4f4
Added missing repository.saveChanges() when reimporting data after cr…
Oct 9, 2021
b7d8a83
Log "Downloading bootstrap..." as well as showing it in the splash sc…
Oct 9, 2021
b103c5b
Bump version to 2.0.0-beta.6
Oct 9, 2021
7ab1738
Fix for NPE when serialized block bytes are unavailable.
Oct 10, 2021
73eaa93
Added missing space in log entry.
Oct 11, 2021
290a19b
Log the URL when downloading a bootstrap, to help with problem solving.
Oct 12, 2021
af8608f
Show full stack trace when bootstrapping fails for any reason.
Oct 12, 2021
581fe17
Added message to check the internet connection if the download cannot…
Oct 12, 2021
651372c
Bump version to 2.0.0-beta.7
Oct 12, 2021
e2134d7
Bump version to 2.0.0
Oct 13, 2021
bbb7108
Updated AdvancedInstaller project for v2.0.0
Oct 13, 2021
1fbd5f7
Fix for issue causing tradeTimestamp to report as 0 for trades in arc…
Oct 17, 2021
55c50a4
add API option to return inverse price (#61)
Oct 22, 2021
18c6f0c
Merge pull request #60 from Tocoolmh58/master
Oct 22, 2021
49dd63a
updated BTC electrum servers
Oct 23, 2021
69e557e
Delete .sha256 file which was left lying around after running the boo…
Oct 25, 2021
3e0574e
Added another missing block archive lookup relating to trade timestamps.
Oct 25, 2021
c1d5b2d
Added DogecoinACCTv2 and DogecoinACCTv2TradeBot
Aug 2, 2021
557807e
Initial attempt at adding "sleep until message" functionality to DOGE…
Aug 2, 2021
7c16952
Added LitecoinACCTv2 and LitecoinACCTv2TradeBot
Oct 26, 2021
36d0292
Added "sleep until message" functionality to LTC ACCTv2.
Oct 26, 2021
974df03
Added another bootstrap host
Oct 26, 2021
314b6fc
Include the initial peers when creating bootstraps
Oct 27, 2021
394ced9
"Lists" feature is now generic.
Oct 31, 2021
319d96f
Add CWD bootstrap node
Nov 3, 2021
3b914d4
Improved trade bot backups so that the current order being bought is …
Nov 3, 2021
9502444
Prevent any kind of trading unless the blockchain is fully synced
Nov 5, 2021
d018f11
Log the initial height of the block archiver on startup
Nov 21, 2021
cce95e0
Default min level for block submissions increased to 3
Nov 23, 2021
59a57d3
Increased frequency of automatic repository maintenance attempts
Nov 23, 2021
098d7ba
Bump version to 2.1.0-prerelease.0
Nov 23, 2021
0dcd2e6
Fixed bug in GET ​/crosschain​/price​/{blockchain} inverse price API …
Nov 24, 2021
199833b
Fixed issue with GET /crosschain/trades API endpoint where the minimu…
Nov 24, 2021
6930bf0
Bump version to 2.1.0
Nov 24, 2021
d9de27e
Updated AdvancedInstaller project for v2.1.0
Nov 24, 2021
13f3aca
Added GET /addresses/online/levels API endpoint to return the number …
Dec 4, 2021
dc52fd1
Only return OFFERING trades in GET /crosschain/tradeoffers
Dec 6, 2021
5b0b939
Fixed bugs in the GET /crosschain/trades API endpoint caused by the i…
Dec 6, 2021
284c9fc
Fixed bugs in the GET /crosschain/price API endpoint caused by the in…
Dec 7, 2021
968bfb9
Fixed bugs in the GET /crosschain/tradeoffers API endpoint caused by …
Dec 7, 2021
9e0630e
Added LitecoinACCTv3 and DogecoinACCTv3 - at the moment identical to …
Dec 8, 2021
f52bafc
Removed second "SLEEP_UNTIL_MESSAGE" function code call in LitecoinAC…
Dec 8, 2021
e6106c0
Added ACCTv3 tests, based on the same criteria as ACCTv1. Refunds are…
Dec 8, 2021
8b6e74d
Added ACCTv3 trade bots. Identical to v1 and v2.
Dec 8, 2021
e7527f5
Added LitecoinACCTv3 and DogecoinACCTv3 to SupportedBlockchain
Dec 8, 2021
6267258
Switch over to ACCTv3 for new listings
Dec 8, 2021
a27d8ac
Connect ACCTv3 trade bots to the ACCTv3 smart contracts
Dec 8, 2021
e82b5a4
Added 7 qortalnodes.live nodes to the default list.
Dec 8, 2021
be9a735
Added one more node
Dec 8, 2021
6e6b2cc
Bump version to 2.1.1
Dec 8, 2021
ed2f243
Updated AdvancedInstaller project for v2.1.1
Dec 8, 2021
391d317
Fixed small issue in GET /crosschain/trades and GET /crosschain/trade…
Dec 8, 2021
6a9904f
Bump log4j-api version to 2.15.0
Dec 10, 2021
a215714
Set log4j2.formatMsgNoLookups to true
Dec 11, 2021
33088df
Revert "Bump log4j-api version to 2.15.0"
Dec 11, 2021
3b96747
Bump version to 2.1.2
Dec 11, 2021
e7fd803
Updated AdvancedInstaller project for v2.1.2
Dec 11, 2021
3a7da9f
Don't return online accounts signatures from GET /blocks/byheight/{he…
Dec 15, 2021
391c3fe
Added same functionality to GET /blocks/signature/{signature}
Dec 15, 2021
0ccee43
Added French translations
Dec 18, 2021
0238b78
Update ApiError_fr.properties
protoniuman Dec 19, 2021
e281e19
Add files via upload
protoniuman Dec 19, 2021
9601bdd
Update SysTray_fr.properties
protoniuman Dec 19, 2021
9263d74
Update TransactionValidity_fr.properties
protoniuman Dec 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions .github/workflows/pr-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR testing

on:
pull_request:
branches: [ master ]

jobs:
mavenTesting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up the Java JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Run all tests
run: |
mvn -B clean test -DskipTests=false --file pom.xml
if [ -f "target/site/jacoco/index.html" ]; then echo "Total coverage: $(cat target/site/jacoco/index.html | grep -o 'Total[^%]*%' | grep -o '[0-9]*%')"; fi

- name: Log coverage percentage
run: |
if [ ! -f "target/site/jacoco/index.html" ]; then echo "No coverage information available"; fi
if [ -f "target/site/jacoco/index.html" ]; then echo "Total coverage: $(cat target/site/jacoco/index.html | grep -o 'Total[^%]*%' | grep -o '[0-9]*%')"; fi
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/db*
/lists/
/bin/
/target/
/qortal-backup/
/log.txt.*
/arbitrary*
/Qortal-BTC*
Expand All @@ -14,5 +16,15 @@
/settings.json
/testnet*
/settings*.json
/testchain.json
/run-testnet.sh
/testchain*.json
/run-testnet*.sh
/.idea
/qortal.iml
.DS_Store
/src/main/resources/resources
/*.jar
/run.pid
/run.log
/WindowsInstaller/Install Files/qortal.jar
/*.7z
/tmp
29 changes: 26 additions & 3 deletions AutoUpdates.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Auto Updates

## TL;DR: how-to

* Prepare new release version (see way below for details)
* Assuming you are in git 'master' branch, at HEAD
* Shutdown local node if running
* Build auto-update download: `tools/build-auto-update.sh` - uploads auto-update file into new git branch
* Restart local node
* Publish auto-update transaction using *private key* for **non-admin** member of "dev" group:
`tools/publish-auto-update.sh non-admin-dev-member-private-key-in-base58`
* Wait for auto-update `ARBITRARY` transaction to be confirmed into a block
* Have "dev" group admins 'approve' auto-update using `tools/approve-auto-update.sh`
This tool will prompt for *private key* of **admin** of "dev" group
* A minimum number of admins are required for approval, and a minimum number of blocks must pass also.
* Nodes will start to download, and apply, the update over the next 20 minutes or so (see CHECK_INTERVAL in AutoUpdate.java)

## Theory
* Using a specific git commit (e.g. abcdef123) we produce a determinstic JAR with consistent hash.
* To avoid issues with over-eager anti-virus / firewalls we obfuscate JAR using very simplistic XOR-based method.
Expand All @@ -25,8 +40,8 @@ The same method is used to obfuscate and de-obfuscate:

## Typical download locations
The git SHA1 commit hash is used to replace `%s` in various download locations, e.g.:
* https://github.com/QORT/qortal/raw/%s/qortal.update
* https://raw.githubusercontent.com@151.101.16.133/QORT/qortal/%s/qortal.update
* https://github.com/Qortal/qortal/raw/%s/qortal.update
* https://raw.githubusercontent.com@151.101.16.133/Qortal/qortal/%s/qortal.update

These locations are part of the org.qortal.settings.Settings class and can be overriden in settings.json like:
```
Expand All @@ -45,4 +60,12 @@ $ java -cp qortal.jar org.qortal.XorUpdate
usage: XorUpdate <input-file> <output-file>
$ java -cp qortal.jar org.qortal.XorUpdate qortal.jar qortal.update
$
```
```

## Preparing new release version

* Shutdown local node
* Modify `pom.xml` and increase version inside `<version>` tag
* Commit new `pom.xml` and push to github, e.g. `git commit -m 'Bumped to v1.4.2' -- pom.xml; git push`
* Tag this new commit with same version: `git tag v1.4.2`
* Push tag up to github: `git push origin v1.4.2`
12 changes: 9 additions & 3 deletions DATABASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ You can examine your node's database using [HSQLDB's "sqltool"](http://www.hsqld
It's a good idea to install "rlwrap" (ReadLine wrapper) too as sqltool doesn't support command history/editing.

Typical command line for sqltool would be:
`rlwrap java -cp ${HSQLDB_JAR}:${SQLTOOL_JAR} org.hsqldb.cmdline.SqlTool --rcFile=${SQLTOOL_RC} qora`
`rlwrap java -cp ${HSQLDB_JAR}:${SQLTOOL_JAR} org.hsqldb.cmdline.SqlTool --rcFile=${SQLTOOL_RC} qortal`

`${HSQLDB_JAR}` should be set with pathname where Maven downloaded hsqldb,
typically `${HOME}/.m2/repository/org/hsqldb/hsqldb/2.5.0/hsqldb-2.5.0.jar`
typically `${HOME}/.m2/repository/org/hsqldb/hsqldb/2.5.1/hsqldb-2.5.1.jar`

`${SQLTOOL_JAR}` should be set with pathname where Maven downloaded sqltool,
typically `${HOME}/.m2/repository/org/hsqldb/sqltool/2.5.0/sqltool-2.5.0.jar`
Expand All @@ -25,10 +25,16 @@ Above `url` component `file:db/blockchain` assumes you will call `sqltool` from

Another idea is to assign a shell alias in your `.bashrc` like:
```
export HSQLDB_JAR=${HOME}/.m2/repository/org/hsqldb/hsqldb/2.5.0/hsqldb-2.5.0.jar
export HSQLDB_JAR=${HOME}/.m2/repository/org/hsqldb/hsqldb/2.5.1/hsqldb-2.5.1.jar
export SQLTOOL_JAR=${HOME}/.m2/repository/org/hsqldb/sqltool/2.5.0/sqltool-2.5.0.jar
alias sqltool='rlwrap java -cp ${HSQLDB_JAR}:${SQLTOOL_JAR} org.hsqldb.cmdline.SqlTool --rcFile=${SQLTOOL_RC}'
```
So you can simply type: `sqltool qortal`

Don't forget to use `SHUTDOWN;` before exiting sqltool so that database files are closed cleanly.

## Quick and dirty version

With `sqltool-2.5.0.jar` and `qortal.jar` in current directory, and database in `db/`

`java -cp qortal.jar:sqltool-2.5.0.jar org.hsqldb.cmdline.SqlTool --inlineRc=url=jdbc:hsqldb:file:db/blockchain`
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
- Create basic *settings.json* file: `echo '{}' > settings.json`
- Run JAR in same working directory as *settings.json*: `java -jar target/qortal-1.0.jar`
- Wrap in shell script, add JVM flags, redirection, backgrounding, etc. as necessary.
- Or use supplied example shell script: *run.sh*
- Or use supplied example shell script: *start.sh*
69 changes: 69 additions & 0 deletions TestNets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# How to build a testnet

## Create testnet blockchain config

- You can begin by copying the mainnet blockchain config `src/main/resources/blockchain.json`
- Insert `"isTestChain": true,` after the opening `{`
- Modify testnet genesis block

### Testnet genesis block

- Set `timestamp` to a nearby future value, e.g. 15 mins from 'now'
This is to give yourself enough time to set up other testnet nodes
- Retain the initial `ISSUE_ASSET` transactions!
- Add `ACCOUNT_FLAGS` transactions with `"andMask": -1, "orMask": 1, "xorMask": 0` to create founders
- Add at least one `REWARD_SHARE` transaction otherwise no-one can mint initial blocks!
You will need to calculate `rewardSharePublicKey` (and private key),
or make a new account on mainnet and use self-share key values
- Add `ACCOUNT_LEVEL` transactions to set initial level of accounts as needed
- Add `GENESIS` transactions to add QORT/LEGACY_QORA funds to accounts as needed

## Testnet `settings.json`

- Create a new `settings-test.json`
- Make sure to add `"isTestNet": true,`
- Make sure to reference testnet blockchain config file: `"blockchainConfig": "testchain.json",`
- It is a good idea to use a separate database: `"repositoryPath": "db-testnet",`
- You might also need to add `"bitcoinNet": "TEST3",` and `"litecoinNet": "TEST3",`

## Other nodes

- Copy `testchain.json` and `settings-test.json` to other nodes
- Alternatively, you can run multiple nodes on the same machine by:
* Copying `settings-test.json` to `settings-test-1.json`
* Configure different `repositoryPath`
* Configure use of different ports:
+ `"apiPort": 22391,`
+ `"listenPort": 22392,`

## Starting-up

- Start up at least as many nodes as `minBlockchainPeers` (or adjust this value instead)
- Probably best to perform API call `DELETE /peers/known`
- Add other nodes via API call `POST /peers <peer-hostname-or-IP>`
- Add minting private key to node(s) via API call `POST /admin/mintingaccounts <minting-private-key>`
This key must have corresponding `REWARD_SHARE` transaction in testnet genesis block
- Wait for genesis block timestamp to pass
- A node should mint block 2 approximately 60 seconds after genesis block timestamp
- Other testnet nodes will sync *as long as there is at least `minBlockchainPeers` peers with an "up-to-date" chain`
- You can also use API call `POST /admin/forcesync <connected-peer-IP-and-port>` on stuck nodes

## Dealing with stuck chain

Maybe your nodes have been offline and no-one has minted a recent testnet block.
Your options are:

- Start a new testnet from scratch
- Fire up your testnet node(s)
- Force one of your nodes to mint by:
+ Set a debugger breakpoint on Settings.getMinBlockchainPeers()
+ When breakpoint is hit, change `this.minBlockchainPeers` to zero, then continue
- Once one of your nodes has minted blocks up to 'now', you can use "forcesync" on the other nodes

## Tools

- `qort` tool, but use `-t` option for default testnet API port (62391)
- `qort` tool, but first set shell variable: `export BASE_URL=some-node-hostname-or-ip:port`
- `qort` tool, but prepend with one-time shell variable: `BASE_URL=some-node-hostname-or-ip:port qort ......`
- `peer-heights`, but use `-t` option, or `BASE_URL` shell variable as above

3 changes: 3 additions & 0 deletions WindowsInstaller/Install Files/AppData/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"apiDocumentationEnabled": true
}
70 changes: 70 additions & 0 deletions WindowsInstaller/Install Files/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
rootLogger.level = info
# On Windows, uncomment next line to set dirname:
# property.dirname = ${sys:user.home}\\AppData\\Local\\qortal\\
property.filename = ${sys:log4j2.filenameTemplate:-log.txt}

rootLogger.appenderRef.console.ref = stdout
rootLogger.appenderRef.rolling.ref = FILE

# Suppress extraneous bitcoinj library output
logger.bitcoinj.name = org.bitcoinj
logger.bitcoinj.level = error

# Override HSQLDB logging level to "warn" as too much is logged at "info"
logger.hsqldb.name = hsqldb.db
logger.hsqldb.level = warn

# Support optional, per-session HSQLDB debugging
logger.hsqldbRepository.name = org.qortal.repository.hsqldb
logger.hsqldbRepository.level = debug

# Suppress extraneous Jersey warning
logger.jerseyInject.name = org.glassfish.jersey.internal.inject.Providers
logger.jerseyInject.level = off

# Suppress extraneous Jersey EOF 'errors' (actually remote peers disconnecting early)
logger.jerseyEOF.name = org.glassfish.jersey.server.internal
logger.jerseyEOF.level = off

# Suppress extraneous Jetty entries
# 2019-02-14 11:46:27 INFO ContextHandler:851 - Started o.e.j.s.ServletContextHandler@6949e948{/,null,AVAILABLE}
# 2019-02-14 11:46:27 INFO AbstractConnector:289 - Started ServerConnector@50ad322b{HTTP/1.1,[http/1.1]}{0.0.0.0:9085}
# 2019-02-14 11:46:27 INFO Server:374 - jetty-9.4.11.v20180605; built: 2018-06-05T18:24:03.829Z; git: d5fc0523cfa96bfebfbda19606cad384d772f04c; jvm 1.8.0_181-b13
# 2019-02-14 11:46:27 INFO Server:411 - Started @2539ms
logger.jetty.name = org.eclipse.jetty
logger.jetty.level = warn
# Even more extraneous Jetty output
# 2019-01-26 02:18:10 WARN ResourceService:718 - java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms
logger.jettyRS.name = org.eclipse.jetty.server.ResourceService
logger.jettyRS.level = error

# Suppress extraneous slf4j entries
# 2019-02-14 11:46:27 INFO log:193 - Logging initialized @1636ms to org.eclipse.jetty.util.log.Slf4jLog
logger.slf4j.name = org.slf4j
logger.slf4j.level = warn

# Suppress extraneous Reflections entry
# 2019-02-27 10:45:25 WARN Reflections:179 - given scan urls are empty. set urls in the configuration
logger.orgReflections.name = org.reflections.Reflections
logger.orgReflections.level = off
logger.sunReflections.name = sun.reflect.Reflection
logger.sunReflections.level = off

appender.console.type = Console
appender.console.name = stdout
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = error

appender.rolling.type = RollingFile
appender.rolling.name = FILE
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.rolling.filePattern = ${dirname:-}${filename}.%i
appender.rolling.policy.type = SizeBasedTriggeringPolicy
appender.rolling.policy.size = 4MB
# Set the immediate flush to true (default)
# appender.rolling.immediateFlush = true
# Set the append to true (default), should not overwrite
# appender.rolling.append=true
33 changes: 33 additions & 0 deletions WindowsInstaller/Install Files/ntpcfg.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@echo off

:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

"%temp%\getadmin.vbs"
exit /B

:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------

net stop "Windows Time"

w32tm /config "/manualpeerlist:pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org cn.pool.ntp.org 0.cn.pool.ntp.org 1.cn.pool.ntp.org 2.cn.pool.ntp.org 3.cn.pool.ntp.org"

net start "Windows Time"

sc config w32time start= auto
Loading