Skip to content

Latest commit

 

History

History
42 lines (21 loc) · 2.04 KB

README.md

File metadata and controls

42 lines (21 loc) · 2.04 KB

Sparkz Example: Twinscoin

Currently, Sparkz's distribution contains one example of blockchain system built on top of Sparkz: TwinsCoin.

Twinscoin is a hybrid Proof-of-Work(PoW) and Proof-of-Stake(PoS) cryptocurrency with 1:1 correspondence between PoW and PoS blocks. The main goal is to protect the hybrid chain against majority of hashing power being adversarial.

The main characteristic of the implementation are:

  • The use of the Twinscoin consensus protocol;

  • A Bitcoin-like transaction model with a transaction having multiple inputs and outputs (with no scripts, however);

  • Persistence through the IODB versioned key-value database.

⚠️ ⚠️ The examples module uses unsafe operations in the persistence module that makes the project itself not production ready, but just an example of a concrete implementation using Sparkz ⚠️ ⚠️

Execution

To run, you need to have Java8 and SBT (Scala Build Tool) installed.

In the terminal, run sbt, and then type the following commands in the SBT shell:

  1. > project examples
  2. > runMain examples.hybrid.HybridApp src/main/resources/settings.conf

This will create and run a node with the given settings. To create and run more nodes, repeat the steps above using the other setting files (e.g. settings2.conf, settings3.conf, ...) in the src/main/resources/ folder.

Note to MacOS users: The 127.0.0.X loopback addresses (for X > 1) are disabled by default in MacOS. Therefore, the creation of nodes with settingsX.conf (for X > 1) fails. To prevent the failure, enable the addresses.

Web User Interface

You can interact with the nodes you created through a web browser. For the node created with settings.conf, visit localhost:9085.

TODO: Add instructions about how to perform a transaction through wallet/transfer.