forked from Qortal/qortal
catbref
00996b047f
Networking work-in-progress:
As per work done by szisti in PR#45: Extracted MessageException from inside Message into its own class. Extracted MessageType from inside Message into its own class. Converted reflection-based Message.fromByteBuffer method call to non-reflection, functional interface, method-reference. This should have minor performance improvement but stronger method signature and type enforcement, as well as better IDE integration. Message.fromByteBuffer method 'contract' tightened up to: 1. throw BufferUnderflowException if there are not enough bytes to deserialize message 2. throw MessageException if bytes contain invalid data 3. should not return null Message.toData method 'contract' tightened up to: 1. return null if the message has no payload to serialize 2. throw IOException directly - no need to try-catch in each subclass Several Message-subclass fields now marked 'final' as per IDE suggestion. Several Message-subclass fromByteBuffer() method signatures have changed 'throws' list. Several bytes.remaining() != some-value changed to bytes.remaining() < some-value as per new contract. Some bytes.remaining() checks removed for fixed-length messages because we can rely on ByteBuffer throwing BufferUnderflowException. Some bytes.remaining() checks retained for variable-length messages, or messages that read a large amount of data, to prevent wasted memory allocations. Other minor tidying up
Qortal Project - Official Repo
Build / run
- Requires Java 11. OpenJDK 11 recommended over Java SE.
- Install Maven
- Use Maven to fetch dependencies and build:
mvn clean package
- Built JAR should be something like
target/qortal-1.0.jar
- 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: start.sh
Description
Qortal Core - Main Code Repository
Decentralized Data Network - Blockchain - TRUE Cross-Chain Trading - Application and Website Hosting - Much More - Qortal is the future internet infrastructure for the global digital world.
Languages
Java
98%
JavaScript
0.6%
Shell
0.5%
HTML
0.5%
Perl
0.3%