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 [11/17/2021 16:37] gfactorqortal_core [12/07/2022 13:56] – [How do I enable "top-only" mode?] gfactor
Line 1: Line 1:
 ====== Qortal Core ====== ====== Qortal Core ======
 {{:qortal_official_logo_transparent_.png?400|}} {{:qortal_official_logo_transparent_.png?400|}}
 +
 +===== 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 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.
  
 **Do I have to run the core and UI at all times? In other words, if the core is running, but the UI is not, am I still minting?** **Do I have to run the core and UI at all times? In other words, if the core is running, but the UI is not, am I still minting?**
  
-You must always have the core running to stay fully synced and “minting”. The UI does not have to be 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>
-    "apiDocumentationEnabled": true +"apiDocumentationEnabled": true 
-  }+}</code>
  
-**How do I disable automatic bootstraps?**+===== How does database auto trimming work? Can I trim it manually? ===== 
 + 
 +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 this, referred 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.  
 + 
 +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. 
 + 
 +You can go here: 
 +http://localhost:12391/api-documentation/#/Admin/performRepositoryMaintenance 
 + 
 +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 a 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: If you would prefer to sync from genesis, add the following setting:
-  "bootstrap": false 
  
-**How do I enable "top-onlymode?**+<code>"bootstrap": false</code>
  
-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 a 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: +===== How do I enable "top-onlymode? ===== 
-  "topOnly": true+ 
 +Refer to the [[How To Reduce Bandwidth]] page. 
 +===== My node is taking a long time to sync and get peersAny solutions? =====
  
-**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.
 +
 It is never a good idea to add your node in DMZ. That will stop all the DPI and SPI and if you have the API enabled and white listed, you are putting your computer at risk! DMZ bypasses the SPI mechanism of the built in filters and all the internet traffic can reach your node directly. SPI (stateful packet inspection) firewall protects you by examining incoming packets against existing connections. It is never a good idea to add your node in DMZ. That will stop all the DPI and SPI and if you have the API enabled and white listed, you are putting your computer at risk! DMZ bypasses the SPI mechanism of the built in filters and all the internet traffic can reach your node directly. SPI (stateful packet inspection) firewall protects you by examining incoming packets against existing connections.
 Also add UPnP text. If a router has it then it must be enabled. UPnP or NAT-pmp opens dynamic port ranges to act as an assist for SPI. Enabling NAT/UPnP solves problem for the most but unfortunately due to the torrent p2p laws most ISPs now filter ports by default at the client side so port forward is also needed. For example: Also add UPnP text. If a router has it then it must be enabled. UPnP or NAT-pmp opens dynamic port ranges to act as an assist for SPI. Enabling NAT/UPnP solves problem for the most but unfortunately due to the torrent p2p laws most ISPs now filter ports by default at the client side so port forward is also needed. For example:
Line 37: 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: 
-1) your system clock is somehow misconfigured, particularly common with Windows systems. Check clock in bottom-right 'system tray' compared with http://time.is/ - if they differ then you need to fix this. Other nodes will refuse to talk to your node if your time is too different.  
-2) 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? 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. These work as well: 1) node2.qortal.org 2) 51.83.114.66 3) node2.qortal.org:12392 4) [21c8:4ed::4:5]:12392 
  
-**Where is the best place to build API calls?**+  - your system clock is somehow misconfigured, particularly common with Windows systems. Check clock in bottom-right 'system tray' compared with http://time.is/ - if they differ then you need to fix this. Other nodes will refuse to talk to your node if your time is too different.  
 +  - 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? ===== 
 + 
 +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.  
 + 
 +These work as well:  
 + 
 +  - node2.qortal.org  
 +  - 51.83.114.66 
 +  - node2.qortal.org:12392 
 +  - [21c8:4ed::4:5]:12392 
 + 
 +===== 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?**+
  
-1) minBlockchainPeers defines minimum needed to mint / genblock  +  - minBlockchainPeers defines minimum needed to mint / genblock  
-2) maxPeers defines limit cap that will not be exceeded  +  maxPeers defines limit cap that will not be exceeded 
-3) minOutboundPeers defines minimum peers your node is allowed to connect to.+  minOutboundPeers defines minimum peers your node is allowed to connect to
  
-**Is there a guide somewhere how to import a QORA seed into core (no GUI) to get minting? Where is the private key?**  +===== What should the correct syntax look like for modifying peer settings=====
-Is it curl -X POST "http://localhost:12391/admin/mintingaccounts" -H "accept: text/plain" -H "Content-Type: text/plain" -d "private key"?  +
-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.+
  
-**So first call would be: /utils/privatekey with QORA seed as parameter?** +<code> 
-Yesto find your public key and you need "apiRestricted": false in API node's settings.json to allow that callUse /utils/publickey to obtain public key from private key and /utils/privatekey to generate private key from 16-byte entropy (not actually in usemostly for dev use).+{"minBlockchainPeers"3, "minOutboundPeers": 16, "maxPeers": 16} </code> 
 + 
 +===== Is there a guide somewhere how to import a QORA seed into core  to get mintingWhere is the private key? ===== 
 + 
 +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.)  
 + 
 +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. 
 + 
 +The API call below is the method for adding the minting key to a headless machine. 
 + 
 +<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: =====
  
-iptables -A OUTPUT -p tcp –syn –dport 12392 -m connlimit –connlimit-above 10 -j REJECT +<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? =====
-1. Download JDK standalone installer  +
-2. Use Localhost core IP with a remote UI access to enter reward share key  +
-3. 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?**  +  - Download JDK standalone installer  
-Under qortal folder you can check the log file status tail -f log.txt.1+  - Use Localhost core IP with a remote UI access to enter reward share key  
 +  - 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? =====  
 + 
 +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>
-    "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":+}</code>
-        "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 +
-}+
  
-**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, tx - rx - verify - store - forward - verify - store — infinity. A safe 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 bandwidthwhat could I set the peer settings to?** +It will not mint as self connect does not count. Your node itself is null !=1. Even if you doyou only fork yourself in an isolated LAN and will never sync. This works by connect: 
  
-Probably worth trying with these: +<code>tx - rx - verify - store - forward - verify - store — infinity</code> 
-"minBlockchainPeers": 3, +
-"minOutboundPeers": 7, +
-"maxPeers": 7+
  
-**What is the max number of peers I could set to support the network?** You could set your maxPeers to 100This 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, etcFor 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.+A safe bet would be to set at minimum of 10Not too low and not too highYou could go as low as 3.
  
-**My core is at higher block height then height on block explorer,or stuck at some height. What shall I do?**+=====If I want lower bandwidth or have lower bandwidth service, what could I set the peer settings to?=====  
 + 
 +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. 
 + 
 +=====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.
    
 You can try to orphan to some height (ditch your block height to inputted  height): You can try to orphan to some height (ditch your block height to inputted  height):
-Click here: http://localhost:12391/api-documentation/#/Admin/orphan +http://localhost:12391/api-documentation/#/Admin/orphan
- +
-Click Try it out+
  
 2. Enter desired block height for ditching to (for example: 300000)  2. Enter desired block height for ditching to (for example: 300000)