# Swirlds SDK

The Swirlds SDK contains the Swirlds browser, example apps with source code that can run in that browser, and documentation for installing, running, and writing new apps using Eclipse.

## Useful documentation

Swirlds SDK license

Libraries used by the SDK

How to run apps in the Swirlds browser

Key management

The Swirlds SDK demo apps

How to install / recompile the example apps from the command line

Installing on the Debian operating system

Installing on Raspbian operating system

How to create a new Swirlds app using the SDK and Eclipse

The javadoc for the various platform classes that apps use

Advanced development: optimizing FastCopyable classes

Tech Report SWIRLDS-TR-2016-01 - a long description of the hashgraph, the consensus algorithm, and the math proofs

Tech Report SWIRLDS-TR-2016-02 - examples that walk through every step of the algorithm

## Files and directories in the sdk directory

README.txt | a note saying to see this file
swirlds.jar | the browser (contains the platform and API)
config.txt | this controls which app runs in the browser, and how it runs
pom.xml | useful for recompiling all the demos in Eclipse with Maven
/data | information used by the browser
/data/apps | a few demo apps
/data/keys | the cryptographic keys to use (if any) and scripts to generate them
/source | Eclipse projects with source code for all the demo apps (also on GitHub)
/docs | documentation for using the browser and writing new apps
/docs/index.html | this file
/docs/javadoc | the javadoc files for various platform API classes and methods that apps can use

## Version history

Version 0.23.1
Fixes and performance improvements for VirtualMap and JasperDB. Iterator performance improvements. Addressed concerns with very verbose log output.
Version 0.22.1
Introduced the new disk based VirtualMap and JasperDB engine. Performance enhancements. New APIs introduced for VirtualMap and JasperDB.
Version 0.21.0
Performance enhancements to the network protocols.
Version 0.20.0
Minor fixes and improvements. Enhanced serialization interfaces.
Version 0.19.0
Full support for running in docker/containerd environments.
Version 0.18.1
Improved FCMap memory utilization. Minor fixes and enhancements.
Version 0.17.1
Fixed several performance and correctness issues.
Version 0.16.0
New data structures introduced. Minor bug fixes and enhancements.
Version 0.15.1
Version number realignment. Major changes to the event stream API, new statistics added, merkle tree routes introduced, and updates to the FCMap and other Platform Public APIs.
Version 0.9.4
Resolves a locking issue in the FCQueue hashing.
Version 0.9.3
Updated third-party dependencies.
Version 0.9.2
Resolves issues with third-party Maven dependencies impacted by the JCenter sunset.
Version 0.9.1
Performance enhancements and bug fix related to locking during a reconnect.
Version 0.9.0
Minor enhancements to the consensus algorithm implementation. Optimized BinaryObjectStore thread safety to increase performance and reduce the possibility of high lock contention.
Version 0.8.1
Minor performance improvements to the new Object Streaming API implemented in the prior release.
Version 0.8.0
Major functional and performance enhancements to the Object Streaming API.
Version 0.7.4
Major breaking changes as outlined below:

- Renamed the Signature class to TransactionSignature and added a new SelfSignature implementation for use with the Object Streaming API.
- Performance improvements to the FCQueue hashing implementation.
- Required changes in the SwirldState interface:
  - Added the new genesisInit(Platform platform, AddressBook addressBook) method, which is called exactly once when state is first created.
  - The old init(Platform platform, AddressBook addressBook) method, will now be called when a pre-existing state is recreated (e.g. restart / reconnect).
- Added the following new Platform statistics:
  - fcmGetMicroSec
  - fcmGfmMicroSec
  - fcmReplaceMicroSec
  - fcmPutMicroSec
  - fcqAddLockAcquisitionMicros
  - fcqRemoveLockAcqMicroSec
  - fcqPollLockAcqMicroSec
  - fcqAddExecMicroSec
  - fcqRemoveExecMicroSec

Version 0.7.3
Minor bug fixes and implemented changes suggested by our audit team.
Version 0.7.2
Minor enhancements and improvements to the Merkle Data Structures API.
Version 0.7.1
Minor bug fixes to address various issues identified in the Merkle Data Structures API that was introduced in the prior release.
Version 0.7.0
Major system-wide enhancements and performance improvements as outlined below:

- The FastCopyable interface now requires the copy method to return mutable objects.
- Log4j2 dependency version updated to 2.13.2 to resolve security vulnerabilities.
- Added a new LocalEvents.evn file that is written with every saved state on disk and should be included backups.
- Beta Mirror Nodes
  - Added support for Beta Mirror Nodes.
  - Added a new isZeroWeightNode() method to the Platform interface.
- Cryptography API
  - Relocated the Cryptography API package to the swirlds-common module.
  - Major internal optimizations and support for Merkle data structures added.
- Merkle Data Structures
  - Merkle Data Structures API added and data structures updated.
  - FCQueue and FCMap updated to implement Merkle Data Structure support.

Version 0.6.5-patch.2
Patch release to address an overly verbose log statement from the prior patch release.
Version 0.6.5-patch.1
Patch release to address an issue with gossip/sync connection reference counting.
Version 0.6.5
FCMap implementation moved to separate maven dependency swirlds-fcmap. FCQueue introduced as a separate maven dependency swirlds-fcqueue. Cryptography introduced as a new public API located in the com.swirlds.common.crypto package. Some classes moved from com.swirlds.platform package and relocated to subpackages under the com.swirlds.common top-level package. The swirlds-common maven dependency is now mandatory for all Swirlds apps. Platform improvements and bug fixes.
Version 0.6.0
Introduced semantic versioning across all Swirlds Platform components. Maven dependency for swirlds-platform renamed to swirlds-platform-core. Platform improvements and bug fixes.
Version 19.10.03
Removed the FCFileSystem. Added methods copyFromExtra(), copyToExtra(), diffCopyFrom(), diffCopyTo() & delete() to the FastCopyable interface. Added newSignedState() to the SwirldMain interface. Added InvalidSignedStateListener interface to help developers debug if an app allows the state on different nodes to get out of sync. Platform improvements and bug fixes.
Version 18.12.30
Updated file system documentation. Deprecated old file system method names and introduced updated method names. Added additional statistics. New setting "waitAtStartup" added to config.txt. Added new method to SwirldMain API called "platformStatusChange".
Version 18.10.23
Runs on JDK 10. Support for ed25519 signature verification. Small improvements in the API, which require small changes in the apps, as shown in the source code of the demo apps.
Version 18.05.23
Minor improvements, bug fixes, performance tweaks.
Version 18.02.27
The platform now predicts an estimated consensus timestamp for transactions that don't yet have consensus. The GameDemo app has been restructured to take advantage of this new feature.
Version 17.09.15
Added a browser window showing various aspects of how the network is performing.
Version 17.06.11
Enabled TLS. All communication is encrypted with TLS 1.2, with algorithms and key sizes chosen to conform to the Commercial National Security Algorithm Suite (CNSA suite), using the Java 8 cipher suite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384. Documentation is now available for key management.
Version 17.01.18
Added documentation and support for developing new apps without Eclipse. App development can now be done from the command line using only Java, Maven, and a text editor.
Version 17.01.04
Added NAT piercing. If this is run on a machine behind a router that does Network Address Translation (NAT), then it will now tell the router to set up port forwarding, so that computers outside the router can communicate with it. This will use either uPNP or NAT-PMP, whichever the router supports.
Version 16.12.11
Added a new fast copyable filesystem, and a FilesystemDemo app to demonstrate it. This means the app can create what appears to be an external hard drive, and can create files and directories on it. But it is actually shared between all the members, and all of them see a single, consistent view of it as it changes over time. Furthermore, even if it has grown very large, an app can make a "fast copy" of it, which appears to be a new external drive containing an exact copy of all the bytes on the original drive. Both the original and copy can then be modified independently. The "fast copy" happens almost instantly because of a copy-on-write mechanism that causes information to only be truly copied when a file changes.
Version 16.10.05
Added two new demos. The StatsDemo collects various statistics about the running system, such as transactions per second, and writes them to a CSV file. The CryptocurrencyDemo app demonstrates a simulated stock market running on a real cryptocurrency (at least it would be real if the program were to be allowed to run forever, and encryption were turned on). This also allows unlimited numbers of members.
Version 16.08.11
This is the initial Alpha release of the Swirlds platform and SDK. This is just a very early Alpha version. It doesn't have signatures and security, it only has a limited set of features, the API may change, and future releases will flesh out more of the core features. This supports up to three computers running the browser and communicating over the internet, or three instances can run on a single machine. Either way, they should be started at the same time, in order to connect with each other.