Qortal Project

The future of blockchain platforms

User Tools

Site Tools


qortal_core

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
qortal_core [12/19/2021 12:15] gfactorqortal_core [12/07/2022 13:56] – [How do I enable "top-only" mode?] gfactor
Line 2: Line 2:
 {{:qortal_official_logo_transparent_.png?400|}} {{:qortal_official_logo_transparent_.png?400|}}
  
-**How does the core auto update work?**+===== How does the core auto update work? =====
  
-When a new build is released, part of the process builds a special XOR'd JAR (the contents are obfuscated to get around certain virus scanners that incorrectly assume all JARs are malicious). That gets uploaded to GitHub. Then the commit hash and hash of the JAR itself are referenced by the ARBITRARY transaction that goes on chain. When the transaction reaches the approval threshold, the core downloads the XOR'd JAR from GutHub, verifies the checksum, converts it back to a regular JAR, and then runs it. +When a new build is released, part of the process builds a special XOR'd JAR (the contents are obfuscated to get around certain virus scanners that incorrectly assume all JARs are malicious). That gets uploaded to GitHub. Then the commit hash and hash of the JAR itself are referenced by the ARBITRARY transaction that goes on chain. When the transaction reaches the approval threshold, the core downloads the XOR'd JAR from GitHub, verifies the checksum, converts it back to a regular JAR, and then runs it. 
  
 With QDN, we can skip the GitHub part and just include the XOR'd JAR directly with the ARBITRARY transaction. But that won't be for a couple more versions as we have to transition it over. With QDN, we can skip the GitHub part and just include the XOR'd JAR directly with the ARBITRARY transaction. But that won't be for a couple more versions as we have to transition it over.
Line 12: Line 12:
 You must always have the core running to stay fully synced and “minting”. The UI does not have to be running. This also means your computer cannot sleep as that would stop the core from running. You must always have the core running to stay fully synced and “minting”. The UI does not have to be running. This also means your computer cannot sleep as that would stop the core from running.
  
-**How long does it usually take to sync the chain the first time?**+===== How long does it usually take to sync the chain the first time? =====
  
 It can take up to a few days to fully synchronize full chain. As of version 2.0 this problem has been solved by automatically downloading a bootstrap on first launch. You will then start syncing from 98 or 99%. It can take up to a few days to fully synchronize full chain. As of version 2.0 this problem has been solved by automatically downloading a bootstrap on first launch. You will then start syncing from 98 or 99%.
  
-**What should settings.json look like?**+===== What should settings.json look like? =====
  
 <code>{ <code>{
Line 22: Line 22:
 }</code> }</code>
  
-**How do disable automatic bootstraps?**+===== How does database auto trimming work? Can trim it manually=====
  
-If you would prefer to sync from genesisadd the following setting:+At the moment the default is a random number between 3 and 14 days. So you have to run the core for at least 3 days (ideally 14) before it will trim. This is set like thisreferred to as staggering, to avoid everyone trimming and causing peer connection issues at the same time. After an auto update, everyone's cores start at similar times, so they would then trim at similar times later if we did have this particular setting for trimming. 
  
-<code>"bootstrap": false</code>+To trim the db on demand, LEAVE THE CORE RUNNING otherwise there will be no API server to receive the command. It's safe to run - the core will just stop functioning during the maintenance. Which normally takes 3-10 mins depending on the hardware. Possibly longer for others.
  
-**How do I enable "top-only" mode?**+You can go here: 
 +http://localhost:12391/api-documentation/#/Admin/performRepositoryMaintenance
  
-Top-only mode allows you to access most of the network features with a much smaller db size (around 1GB instead of 10GB). Enabling this doesn't support the network as much as full node, so it is best to only enable top-only mode in situations where it's not possible to hold the full 10GB+ dbTo enable top-only mode, add this setting:+Or use this command: 
 +<code>curl -X DELETE "http://localhost:12391/admin/repository" -H  "accept: */*" -H  "X-API-KEY: apiKeyGoesHere"</code> 
 + 
 +A few things worth mentioning... 
 + 
 +1. Since v2.0 we optimized the db storage size so that it increases much more slowly than it used to. 
 + 
 +2. We have recently found way to reduce the size of the legacy blocks considerably, so this can be done in the future and we can rebuild the archives. This will also reduce the size of the bootstraps. 
 + 
 +3. Anyone can run in topOnly mode, which only holds the last 1450 blocks. So there is no real need for everyone to run full nodes long term. We only need a subset of the network to be running full nodes so that people can still sync from more than 1450 blocks ago. 
 + 
 +===== How do I disable automatic bootstraps? ===== 
 + 
 +If you would prefer to sync from genesis, add the following setting: 
 + 
 +<code>"bootstrap": false</code>
  
-<code>"topOnly": true</code>+===== How do I enable "top-onlymode? =====
  
-**My node is taking a long time to sync and get peers. Any solutions?** +Refer to the [[How To Reduce Bandwidth]] page. 
 +===== My node is taking a long time to sync and get peers. Any solutions? =====
  
 You can try changing your router settings with port forwarding, or virtual server. These different methods have worked for several people. Otherwise, reach out on Discord for further diagnostics and solutions. You can try changing your router settings with port forwarding, or virtual server. These different methods have worked for several people. Otherwise, reach out on Discord for further diagnostics and solutions.
Line 47: Line 64:
 Look at the second IP address with a dynamic port. This is UPnP working. Instead of 12392 , it has opened a 44380 port for TCP handshake / connect / ACK. Look at the second IP address with a dynamic port. This is UPnP working. Instead of 12392 , it has opened a 44380 port for TCP handshake / connect / ACK.
  
-**I am seeing the number of connections go up, then back down to 0.** +===== I am seeing the number of connections go up, then back down to 0. =====
  
 You are likely having one of these issues:  You are likely having one of these issues: 
Line 54: Line 71:
   - you have some sort of firewall issue. No need to turn off firewall, just allow TCP 12392 (and 12391 if you use API remotely).   - you have some sort of firewall issue. No need to turn off firewall, just allow TCP 12392 (and 12391 if you use API remotely).
  
-**To add a peer, do you use the IP address? Port?** +===== To add a peer, do you use the IP address? Port? =====
  
 Use hostname or IP address. Port is not needed unless it's non-default. When you install, it does come with node1 to node10.qortal.org pre-added.  Use hostname or IP address. Port is not needed unless it's non-default. When you install, it does come with node1 to node10.qortal.org pre-added. 
Line 65: Line 82:
   - [21c8:4ed::4:5]:12392   - [21c8:4ed::4:5]:12392
  
-**Where is the best place to build API calls?**+===== Where is the best place to build API calls? =====
  
 http://localhost:12391/api-documentation/ http://localhost:12391/api-documentation/
  
-**What is the difference between+===== What is the difference between minBlockchainPeers,  maxPeers, and minOutboundPeers? =====
-1) minBlockchainPeers 2) maxPeers 3) minOutboundPeers?**+
  
   - minBlockchainPeers defines minimum needed to mint / genblock    - minBlockchainPeers defines minimum needed to mint / genblock 
Line 76: Line 92:
   - minOutboundPeers defines minimum peers your node is allowed to connect to   - minOutboundPeers defines minimum peers your node is allowed to connect to
  
-**What shoud the correct syntax look like for modifying peer settings?**+===== What should the correct syntax look like for modifying peer settings? =====
  
 <code> <code>
 {"minBlockchainPeers": 3, "minOutboundPeers": 16, "maxPeers": 16} </code> {"minBlockchainPeers": 3, "minOutboundPeers": 16, "maxPeers": 16} </code>
  
-**Is there a guide somewhere how to import a QORA seed into core (no GUI) to get minting? Where is the private key?** +===== Is there a guide somewhere how to import a QORA seed into core  to get minting? Where is the private key? =====
  
-<code>curl -X POST "http://localhost:12391/admin/mintingaccounts" -H "accept: text/plain" -H "Content-Type: text/plain" -d "private key"?</code>+If you are a QORA user, you will first need to obtain your ADDRESS SEED (be sure you do not obtain your ACCOUNT SEED as that is a different thing.) Once you have obtained your ADDRESS SEED, you can use the 'QORA seed' login method in Qortal UI to login to the QORA account on Qortal (and obtain your Qortal account address, etc.) 
  
-You need to publish your reward-share/self-share transaction first, one step of that is generating your reward-share private key, which is what you pass to /admin/mintingaccounts probably easiest to build your API call using the API documentation page /admin/mintingaccounts uses your reward-share private key.+Once you have logged into the QORA account, you can create and assign the minting key just like you would with any other Qortal account. Create the key with a 0% reward share to your own public key, wait for it to confirm, then assign it in node management add minting acccount.
  
-**So first call would be: /utils/privatekey with QORA seed as parameter?**+The API call below is the method for adding the minting key to a headless machine.
  
-Yes, to find your public key and you need "apiRestricted": false in API node's settings.json to allow that call. Use /utils/publickey to obtain public key from private key and /utils/privatekey to generate private key from 16-byte entropy (not actually in use, mostly for dev use).+<code>curl -X POST "http://localhost:12391/admin/mintingaccounts" -H "accept: text/plain" -H "Content-Type: text/plain" -d "MINTING_KEY_HERE"</code>
  
-**Does Qortal support IPv6 software?**+===== Does Qortal support IPv6 software? =====
  
 -Djava.net.preferIPv4Stack=false \ (software is capable). It all comes down to OS capability. GenX is capable. Windows is also IPv6 enabled by default. -Djava.net.preferIPv4Stack=false \ (software is capable). It all comes down to OS capability. GenX is capable. Windows is also IPv6 enabled by default.
  
-**If you have a Linux node, this will throttle your overall outbound connections and cap them at 10. It prevents overloading the network and your node in return. Do not use this if you serve a public node:**+===== If you have a Linux node, this will throttle your overall outbound connections and cap them at 10. It prevents overloading the network and your node in return. Do not use this if you serve a public node: =====
  
 <code>iptables -A OUTPUT -p tcp –syn –dport 12392 -m connlimit –connlimit-above 10 -j REJECT </code> <code>iptables -A OUTPUT -p tcp –syn –dport 12392 -m connlimit –connlimit-above 10 -j REJECT </code>
  
  
-**If I only want to install & run a node on my Windows server and link the minting rewards to my Wallet (Reward Key), how would this be done?**+===== If I only want to install & run a node on my Windows server and link the minting rewards to my Wallet (Reward Key), how would this be done? =====
  
   - Download JDK standalone installer    - Download JDK standalone installer 
Line 106: Line 122:
   - Download core zip for Github (not the full installer).   - Download core zip for Github (not the full installer).
  
-**I upgraded the ram on my VPS so that my browser wouldn't crash while loading the UI perhaps I missed something when rebooting, is there a command I can use to check?** +===== I upgraded the ram on my VPS so that my browser wouldn't crash while loading the UI perhaps I missed something when rebooting, is there a command I can use to check? ===== 
  
-Under qortal folder you can check the log file status tail -f log.txt.1+Under qortal folder you 
 +can check the log file status tail -f log.txt.1
  
-**It seems like sometimes most nodes are 2+ blocks behind, why?**+===== It seems like sometimes most nodes are 2+ blocks behind, why? =====
  
 This is due to your node doing AT state trimming which takes a time worth one or two blocks. This is due to your node doing AT state trimming which takes a time worth one or two blocks.
  
-**Where can I find what to input in settings.json file?**+===== Where can I find what to input in settings.json file to optimize=====
  
-Default data in settings:+Add these settings:
  
 <code>{ <code>{
-    "MAINNET_LISTEN_PORT": 12392, +"apiDocumentationEnabled": false
-    "TESTNET_LISTEN_PORT": 62392, +"apiEnabled": true, 
-    "MAINNET_API_PORT": 12391, +"apiRestricted": false, 
-    "TESTNET_API_PORT": 62391, +"autoUpdateEnabled": true, 
-    "bindAddress": "::", +"minBlockchainPeers": 8
-    "uiPort": 12388, +"minOutboundPeers": 16, 
-    "uiLocalServers":+"maxPeers": 32, 
-        "localhost", "127.0.0.1", "172.24.1.1", "qor.tal" +"listenPort": 12392
-    ], +"allowConnectionsWithOlderPeerVersions": false
-    "uiRemoteServers":+
-        "node1.qortal.org", "node2.qortal.org", "node3.qortal.org", "node4.qortal.org", "node5.qortal.org", +
-        "node6.qortal.org", "node7.qortal.org", "node8.qortal.org", "node9.qortal.org", "node10.qortal.org" +
-    ]+
-    "apiEnabled": true, +
-    "apiPort": 12391, +
-    "apiWhitelist":+
-        "::1", +
-        "127.0.0.1" +
-    ], +
-    "apiRestricted": false, +
-    "apiLoggingEnabled": false, +
-    "apiDocumentationEnabled": false, +
-    "sslKeystorePathname": null, +
-    "sslKeystorePassword": null, +
-    "wipeUnconfirmedOnStart": false, +
-    "maxUnconfirmedPerAccount": 25, +
-    "maxTransactionTimestampFuture": 86400000, +
-    "autoUpdateEnabled": true, +
-    "repositoryBackupInterval": 0, +
-    "showBackupNotification": false, +
-    "isTestNet": false, +
-    "listenPort": 12392, +
-    "minBlockchainPeers": 5+
-    "minOutboundPeers": 16, +
-    "maxPeers": 32, +
-    "maxNetworkThreadPoolSize": 20+
-    "networkPoWComputePoolSize": 2, +
-    "slowQueryThreshold": null, +
-    "repositoryPath": "db", +
-    "autoUpdateRepos":+
-        "https://github.com/Qortal/qortal/raw/%s/qortal.update", +
-        "https://[email protected]/Qortal/qortal/%s/qortal.update" +
-    ], +
-    "ntpServers": ["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" +
-    ], +
-    "testNtpOffset": null+
 }</code> }</code>
  
-**Could I set minBlockchainPeers to 1? Would it mint?**+=====Could I set minBlockchainPeers to 1? Would it mint?=====
  
 It will not mint as self connect does not count. Your node itself is null !=1. Even if you do, you only fork yourself in an isolated LAN and will never sync. This works by connect:  It will not mint as self connect does not count. Your node itself is null !=1. Even if you do, you only fork yourself in an isolated LAN and will never sync. This works by connect: 
Line 184: Line 155:
 A safe bet would be to set at minimum of 10. Not too low and not too high. You could go as low as 3. A safe bet would be to set at minimum of 10. Not too low and not too high. You could go as low as 3.
  
-**If I want lower bandwidth, what could I set the peer settings to?**  +=====If I want lower bandwidth or have lower bandwidth service, what could I set the peer settings to?===== 
- +
-Probably worth trying with these (leave the minOutboundPeer blank): +
- +
-<code>"minBlockchainPeers": 3, +
-"maxPeers": 7</code>+
  
-**What is the max number of peers I could set to support the network?** +Refer to the [[How To Reduce Bandwidth]] page. 
 +=====What is the max number of peers I could set to support the network?=====
  
 You could set your maxPeers to 100. This should be fine with other default settings. This should be more than sufficient for helping the network. Remember that every new peer you have will use more network data. It’s up to each individual what they are planning to use their node for, how much bandwidth and network data they want to use, etc. For supporting the NETWORK most, port forwarding, and 100 maxPeers. For supporting your own network data the most, and conserving it: maxPeers 7, and minBlockchainPeers 3. You could set your maxPeers to 100. This should be fine with other default settings. This should be more than sufficient for helping the network. Remember that every new peer you have will use more network data. It’s up to each individual what they are planning to use their node for, how much bandwidth and network data they want to use, etc. For supporting the NETWORK most, port forwarding, and 100 maxPeers. For supporting your own network data the most, and conserving it: maxPeers 7, and minBlockchainPeers 3.
  
-**My core is at higher block height then height on block explorer,or stuck at some height. What shall I do?**+=====My core is at higher block height then height on block explorer,or stuck at some height. What shall I do?=====
  
 Your core must be running all the time. Do not close window with orphaning before it is orphaned to desired block height. Your core must be running all the time. Do not close window with orphaning before it is orphaned to desired block height.