This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Documentation (#7) * documentation v1 * documentation v2 Added a paragraph about the longest chain rule. Added the image about the Scalachain node and the actor hierarchy. Small grammar corrections * Cluster (#19) * Initial cluster integration - added cluster configuration - added cluster manager and listener - added /status/members endpoint - added docker-compose file - improved application configuration * Transaction broadcast first implementation * Transaction broadcast refactoring - transaction broadcast has been refactored. * Docker improvement Improved docker image creation. Sbt is downloaded during image creation to reduce start time of containers. Source code can be mounted in a folderinside the container and then copied in the /development one. This in order to prevent problems due to concurrent r/w in the same volume by multiple containers. * Fixed tests Tests are fixed to support the new cluster architecture * New block broadcast The broadcast of new blocks has been implemented. Fixed the persistence of snapshots in containers. * Updated documentation for the new cluster feature * Improved style
- Loading branch information
1 parent
b3b6e05
commit 8c95f7b
Showing
28 changed files
with
406 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
.idea | ||
target/ | ||
persistence/journal/* | ||
persistence/snapshots/* | ||
persistence/snapshots/* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
version: '3.7' | ||
|
||
networks: | ||
scalachain-network: | ||
|
||
services: | ||
seed: | ||
networks: | ||
- scalachain-network | ||
image: elleflorio/scalachain | ||
volumes: | ||
- ~/Development/scala/scalachain/:/tmp/scalachain | ||
ports: | ||
- '2552:2552' | ||
- '8000:8000' | ||
environment: | ||
SERVER_IP: 0.0.0.0 | ||
CLUSTER_IP: seed | ||
CLUSTER_SEED_IP: seed | ||
SCALACHAIN_PERSISTENCE_DIR: '/persistence/seed/journal' | ||
SCALACHAIN_SNAPSHOTS_DIR: '/persistence/seed/snapshots' | ||
command: ["local", "/tmp/scalachain"] | ||
|
||
node1: | ||
networks: | ||
- scalachain-network | ||
image: elleflorio/scalachain | ||
volumes: | ||
- ~/Development/scala/scalachain/:/tmp/scalachain | ||
ports: | ||
- '8001:8000' | ||
environment: | ||
SERVER_IP: 0.0.0.0 | ||
CLUSTER_IP: node1 | ||
CLUSTER_PORT: 1600 | ||
CLUSTER_SEED_IP: seed | ||
CLUSTER_SEED_PORT: 2552 | ||
SCALACHAIN_NODE_ID: node1 | ||
SCALACHAIN_PERSISTENCE_DIR: '/persistence/node1/journal' | ||
SCALACHAIN_SNAPSHOTS_DIR: '/persistence/node1/snapshots' | ||
command: ["local", "/tmp/scalachain"] | ||
|
||
node2: | ||
networks: | ||
- scalachain-network | ||
image: elleflorio/scalachain | ||
volumes: | ||
- ~/Development/scala/scalachain/:/tmp/scalachain | ||
ports: | ||
- '8002:8000' | ||
environment: | ||
SERVER_IP: 0.0.0.0 | ||
CLUSTER_IP: node2 | ||
CLUSTER_PORT: 1600 | ||
CLUSTER_SEED_IP: seed | ||
CLUSTER_SEED_PORT: 2552 | ||
SCALACHAIN_NODE_ID: node2 | ||
SCALACHAIN_PERSISTENCE_DIR: '/persistence/node2/journal' | ||
SCALACHAIN_SNAPSHOTS_DIR: '/persistence/node2/snapshots' | ||
command: ["local", "/tmp/scalachain"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mxfile modified="2019-03-26T21:22:48.602Z" host="www.draw.io" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/8.8.0 Chrome/61.0.3163.100 Electron/2.0.2 Safari/537.36" etag="CtiQ_G8Z8pSDfTESHG_I" version="10.5.8" type="device"><diagram id="F2S_QHZglgRF0Ka7Bkp2" name="Page-1">3Vpdc+I2FP01flzGlixjHgNJt53ZtJlmO90+KpbAygqLkUWA/vrKWMYWMqxJAbPhgdG9lmTpnHuPrz88OJmvP0u8SB8FodwDPll78N4DYIhi/V84NqUDxaB0zCQjpSuoHc/sX2qcvvEuGaG51VEJwRVb2M5EZBlNlOXDUoqV3W0quH3WBZ5Rx/GcYO56/2ZEpaU3BsPa/ytls7Q6cxCNyiNzXHU2O8lTTMSq4YIPHpxIIVTZmq8nlBfYVbiU4345cHS3MEkz1WXAK3z9dP9HToIxeUpJ8tfXMAw/mW28Yb40GzaLVZsKASmWGaHFJL4Hx6uUKfq8wElxdKUp175Uzbm2At2cMs4nggup7UxkutPYnIFKRdcHlx7sANGBRMWcKrnRXcwAMDIYmiACQ2OvakqQb3xpgw4QGyc2YTDbzV0jpRsGrBOAq+KzARQlOnKMKaRKxUxkmD/U3rENZd3nixALA+ArVWpj0gAvlbDhpWumvjXa/xRTDQAy5v3aTL01NpWR6Q1/axrNYYVdj9ta1UCC83S72mBHY7HH4yRqSMRSJvQYdiaPsZxRdaQfag8KSTlW7M1ex/kJdjPhigT7A9SgOOjI7wBZDP+A3h4Yhb0y6mjdhC9zReUjzrSMSw9EXC9+/FK0ZkXrLlFayQ4LYnCaIHoAEkzjaaL9uZLiO20ciZKYvkzPo5fQR5ZewtjVywC06GV0KbkEDvaPLCsg9y+AMaIxCdswjsELjKLzYBwhG+Owd4zhofj+wvR/diTA990/IR37Id8/HaFDx7jY/0eKedA7yEHgwHjNq7RVhg07lmGBXYYN+yrDUMeL9oGYuNJFG95Onf2+MvtH9PbAaNQro+HtMPrOO6cbpDTslVJ0O5R2VeHbpxT0SSlyqpffBaF17XLZkvEqd0m7EvFm7pIit2TkIvmepJhlH6hs7B/oUa9V4xWe7VyqZow7alevj+5iJ43+fHj+WiTQ028nKdeJD7x12kynU5C0KheJXiJ0poTaV6625+GtCQUvdh/mSlfxEgVX0uXCXl5O9qDXkCgbXwdHf/vzWl81YM5mmTYTjaO+0YbjAmWm13FnDswZIdtkbmPV5v0MNHV5bTFEAzAKg2AYhUMfxTFsIQ1dijQ3UVxdzMhd8RqtQJXjPGeJzc+7hMZFzHqR40JQ+TrrhznDk2D6xDtCgj1CINjLh1L/zKgaXWcigNAAHZ+qlEhnqi1Ru43/D+5GDncTMZ8vMx3uiuZbSDWipyaYSaTbz61gXwLj0Mmt0TUVsMqdpgIuF1S+sbytXhbTDleiD8sWRK4SXpct92H5ydJ3+2oH9kWqSpLT9S4+PtG71U6b9ScQZff6OxL48B8=</diagram></mxfile> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.1.6 | ||
sbt.version = 1.2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,63 @@ | ||
akka.persistence.journal.plugin = "akka.persistence.journal.leveldb" | ||
akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local" | ||
akka { | ||
actor { | ||
provider = "cluster" | ||
} | ||
persistence { | ||
journal { | ||
plugin = "akka.persistence.journal.leveldb" | ||
leveldb { | ||
dir = ${scalachain.persistence.dir} | ||
# DO NOT USE THIS IN PRODUCTION !!! | ||
# See also https://github.com/typesafehub/activator/issues/287 | ||
native = false | ||
} | ||
} | ||
snapshot-store { | ||
plugin = "akka.persistence.snapshot-store.local" | ||
local.dir = ${scalachain.snapshots.dir} | ||
} | ||
} | ||
remote { | ||
log-remote-lifecycle-events = on | ||
netty.tcp { | ||
hostname = ${clustering.ip} | ||
port = ${clustering.port} | ||
} | ||
} | ||
cluster { | ||
seed-nodes = [ | ||
"akka.tcp://"${clustering.cluster.name}"@"${clustering.seed-ip}":"${clustering.seed-port} | ||
] | ||
auto-down-unreachable-after = 10s | ||
} | ||
} | ||
http { | ||
ip = "127.0.0.1" | ||
ip = ${?SERVER_IP} | ||
|
||
akka.persistence.journal.leveldb.dir = "persistence/journal" | ||
akka.persistence.snapshot-store.local.dir = "persistence/snapshots" | ||
port = 8000 | ||
port = ${?SERVER_PORT} | ||
} | ||
clustering { | ||
ip = "127.0.0.1" | ||
ip = ${?CLUSTER_IP} | ||
|
||
# DO NOT USE THIS IN PRODUCTION !!! | ||
# See also https://github.com/typesafehub/activator/issues/287 | ||
akka.persistence.journal.leveldb.native = false | ||
port = 2552 | ||
port = ${?CLUSTER_PORT} | ||
|
||
seed-ip = "127.0.0.1" | ||
seed-ip = ${?CLUSTER_SEED_IP} | ||
|
||
seed-port = 2552 | ||
seed-port = ${?CLUSTER_SEED_PORT} | ||
|
||
cluster.name = "scalachain" | ||
} | ||
scalachain { | ||
node.id = "node0" | ||
node.id = ${?SCALACHAIN_NODE_ID} | ||
persistence.dir = "persistence/journal" | ||
persistence.dir = ${?SCALACHAIN_PERSISTENCE_DIR} | ||
snapshots.dir = "persistence/snapshots" | ||
snapshots.dir = ${?SCALACHAIN_SNAPSHOTS_DIR} | ||
} |
Oops, something went wrong.