Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
3ea2bf3
Model: Milestone->Round
oracle58 May 21, 2019
1dac88b
ViewModel: MilestoneViewModel -> RoundViewModel
oracle58 May 21, 2019
d5fee0a
Added getHashes, addMilestone and size to RoundViewModel
oracle58 May 21, 2019
0c95900
StateDiffViewModel: milestoneHash -> roundIndex
oracle58 May 21, 2019
f1a81ec
LatestMilestoneTracker finality update (wip)
oracle58 May 21, 2019
e331304
Merge pull request #52 from HelixNetwork/dev
oracle58 May 21, 2019
70a622f
LatestMilestoneTracker update
oracle58 May 21, 2019
bb11e06
MilestoneService update
fsbbn May 22, 2019
e360e4d
LatestSolidMilestoneTracker update
fsbbn May 22, 2019
67dc36d
MilestoneService 2nd update - renaming and fixing unsolved parts
fsbbn May 23, 2019
6811450
use new method name
fsbbn May 23, 2019
31a5091
LatestSolidMilestoneTracker 2nd update - renaming and improve trackin…
fsbbn May 23, 2019
05efc21
fix merge conflict
fsbbn May 23, 2019
8f669c2
update LedgerService and fix updateRoundIndexOfMilestoneTransactions …
fsbbn May 27, 2019
5da7aef
Merge branch 'finality-update' of github.com:HelixNetwork/testnet-1.0…
oracle58 May 27, 2019
a3b1221
resolve conflicts
oracle58 May 27, 2019
958209f
resolve
oracle58 May 27, 2019
0ee0700
resolve2
oracle58 May 27, 2019
94c9807
rename coordinatorAddress to trusteeAddress
fsbbn May 27, 2019
ff9ac39
update SnapshotService
fsbbn May 27, 2019
2fc1f42
update SnapshotService and fix related problems with seenMilestones (…
fsbbn May 29, 2019
07e7c27
rename getLatestRoundIndex() in LocalSnapshotManager
fsbbn May 29, 2019
f448813
raw design and impl of ValidatorTracker
fsbbn May 29, 2019
f8f55b9
implement processTrusteeTransaction
fsbbn Jun 5, 2019
936efac
proof if tx is orphaned from the perspective of one of the confirmed …
fsbbn Jun 5, 2019
a23ad63
Merge pull request #68 from HelixNetwork/dev
fsbbn Jun 13, 2019
063d0e0
implement processTrusteeTransaction and updateValidatorAddresses
fsbbn Jun 13, 2019
5fef0d7
Merge branch 'dev' of https://github.com/HelixNetwork/testnet-1.0 int…
fsbbn Jun 13, 2019
f803d31
implement validation function for merkle signatures
fsbbn Jun 13, 2019
e941579
Merge branch 'dev' of https://github.com/HelixNetwork/testnet-1.0 int…
fsbbn Jun 13, 2019
0cb821b
sync new validator when latest round ends
fsbbn Jun 16, 2019
aa29320
implement getConfirmedTips in RoundViewModel for better accessibility
fsbbn Jun 16, 2019
7ed2cdf
start from confirmed tips to get/check solid entry points
fsbbn Jun 16, 2019
faf7638
remove latest milestone
fsbbn Jun 16, 2019
d243672
integrate validatorTracker
fsbbn Jun 17, 2019
4eb4ffd
hardcode own coordinator address
fsbbn Jun 17, 2019
b7e3986
store seenRounds without hash
fsbbn Jun 17, 2019
a9813a5
add all milestones of round to elementsToDelete
fsbbn Jun 17, 2019
656c47f
get a random milestone of round as solid entry point for tip selectio…
fsbbn Jun 17, 2019
c9bfb39
request all milestones of a round
fsbbn Jun 17, 2019
d6b440a
traverse tangle starting at confirmed tips
fsbbn Jun 17, 2019
d66144e
implementation of getTipSet, getConfirmedTips, getConfirmingMilestone…
fsbbn Jun 17, 2019
95e0702
send a tip request packet of transactions corresponding to all milest…
fsbbn Jun 17, 2019
018a7bc
implement getTrusteeAddress TestnetConfig
fsbbn Jun 17, 2019
7973dd0
spawnTipRequesterThread temporary solution with NULL_HASH
fsbbn Jun 18, 2019
6ef842f
no tip selection for milestones
fsbbn Jun 18, 2019
a9c4f1f
rename getTrusteeAddress
fsbbn Jun 18, 2019
f30800d
implement round counter thread
fsbbn Jun 18, 2019
cf04bd0
refactor latestRound to currentRound and fix related issues
fsbbn Jun 18, 2019
2b32e7b
typo
fsbbn Jun 18, 2019
e4e0c98
fix findLatestProcessedSolidRoundInDatabase
fsbbn Jun 18, 2019
675865e
debug findLatestProcessedSolidRoundInDatabase
fsbbn Jun 19, 2019
9c5c3c6
rename NomineeTracker
fsbbn Jun 26, 2019
42f0922
fix load, get tips from correct transaction(s), implement toString()
fsbbn Jun 26, 2019
4307708
update snapshot index of milestones, fix already validated check (not…
fsbbn Jun 26, 2019
6beab53
bootstrap current round index after ledger state is restored, rename …
fsbbn Jun 26, 2019
768a8cd
make bootstrapCurrentRoundIndex public, store milestone at the end of…
fsbbn Jun 26, 2019
89e6aa9
make bootstrapCurrentRoundIndex public, store milestone at the end of…
fsbbn Jun 26, 2019
63226a2
log confirmation status when doing balance diff
fsbbn Jun 26, 2019
f86f098
add tips transaction to milestone bundle
fsbbn Jun 26, 2019
4ff9a79
hardcode address for new nominee keyfile, access nominee keyfile for …
fsbbn Jun 26, 2019
c50b80f
store milestone when validated
fsbbn Jun 26, 2019
5d7e015
return false when trying to load a round without milestones (not sure…
fsbbn Jun 26, 2019
0186b59
get round depending on time instead of getting it from roundCounter
fsbbn Jun 26, 2019
a56f928
get milestone of a given address
fsbbn Jun 30, 2019
571805f
define genesis time, delete round tracker, store milestone after vali…
fsbbn Jun 30, 2019
10c399c
delete second executor service
fsbbn Jun 30, 2019
5e8c677
enable incrementing index
fsbbn Jun 30, 2019
abb8590
bootstrap current round happens in latest milestone tracker
fsbbn Jun 30, 2019
36c34b8
prints
fsbbn Jun 30, 2019
cacb62c
implement getLatestRoundHashes
fsbbn Jun 30, 2019
3b86f16
make normal tip selection for branch and trunc
fsbbn Jun 30, 2019
9c80fc4
move on to round with milestones
fsbbn Jul 1, 2019
e7d6c3e
check if there is already a milestone with the same address
fsbbn Jul 1, 2019
2fcad9b
check if round has finished without milestones
fsbbn Jul 1, 2019
c04035e
if there is no latest round take null hash as branch and trunk
fsbbn Jul 1, 2019
57fe1f9
check if round has milestones
fsbbn Jul 1, 2019
4a81056
show confirmed status in graphstream
fsbbn Jul 1, 2019
7b0dc93
comment bug
fsbbn Jul 5, 2019
b404f83
if round already contains hash -> already validated
fsbbn Jul 5, 2019
7db124e
get correct transactions in bundle
fsbbn Jul 5, 2019
a1407e6
integrate nomineeTracker
fsbbn Jul 5, 2019
961d70b
merkle tree representation as List
fsbbn Jul 5, 2019
e14d9cc
getBalances fix
fsbbn Jul 5, 2019
c347ae4
correct merkle tree size, fixed size nextKeys
fsbbn Jul 7, 2019
be03ff5
get merkle root of milestones to store as snapshot hash
fsbbn Jul 7, 2019
04586a8
reference merkle root of confirmed tips and snapshot hash as branch a…
fsbbn Jul 7, 2019
4eea5fc
getTipSet() -> static
fsbbn Jul 7, 2019
4789a91
print snapshot
fsbbn Jul 7, 2019
268d5f1
add method to check if transaction is part of milestone bundle
fsbbn Jul 9, 2019
8690ead
if leaves size=1 return leave
fsbbn Jul 9, 2019
2ce932f
move getRoundIndex (from tag) to RoundViewModel for bette access
fsbbn Jul 9, 2019
d24de21
implement getMilestoneTrunk and getMilestoneBranch
fsbbn Jul 9, 2019
f701fcd
use specific getMilestonTrunk/Branch for transaction of milestone bun…
fsbbn Jul 9, 2019
51edd16
set correct references for milestone bundle in graphstream
fsbbn Jul 9, 2019
5fa134b
getRoundIndex from RoundViewModel, new genesis time
fsbbn Jul 9, 2019
065bc78
add GENESIS_TIME and ROUND_DURATION to config
fsbbn Jul 14, 2019
e68c4a5
get tips first, get previous round and build merkle tree instead of t…
fsbbn Jul 14, 2019
edddc4d
logs
fsbbn Jul 14, 2019
a1ee390
calculate next round start
fsbbn Jul 14, 2019
5bf2071
getGenesisTime and getRoundDuration
fsbbn Jul 14, 2019
27fff97
take genesis time and round duration from config
fsbbn Jul 14, 2019
e0ef3e3
use equals
fsbbn Jul 14, 2019
136249e
logs
fsbbn Jul 14, 2019
9db5de3
logs
fsbbn Jul 16, 2019
d543497
update genesis time
fsbbn Jul 16, 2019
64abfff
update milestone references in graph when applying to ledger
fsbbn Jul 16, 2019
e540319
remove round label for milestones
fsbbn Jul 16, 2019
54d768d
don't update milestone references in graph before they are recognized…
fsbbn Jul 16, 2019
c498e68
enable sending multiple tx with confirmed tips when there are more th…
fsbbn Jul 16, 2019
7a8b358
rename
fsbbn Jul 16, 2019
aadb938
update approvees column in database of tx that are referenced by mile…
fsbbn Jul 16, 2019
14d4dbe
fix getBalances, reference NULL_HASH if previous round doesn't exist
fsbbn Jul 23, 2019
8108a29
do a 1s round pause between each round to make sure previous round is…
fsbbn Jul 23, 2019
e7380b8
comment
fsbbn Jul 23, 2019
c2b93c9
genesis time
fsbbn Jul 23, 2019
d69807d
if no prev round, take NULL_HASH
fsbbn Jul 23, 2019
8e2bd40
update status of approver
fsbbn Jul 23, 2019
5eefff8
set milestone before update approvees
fsbbn Jul 23, 2019
7f95442
dev merge
fsbbn Jul 24, 2019
9736c8c
rename milestonePublisher, add updateKeyfile()
fsbbn Jul 24, 2019
7c5a628
get seed from keyfile
fsbbn Jul 26, 2019
8107b02
publish candidate tx (application) with new address
fsbbn Jul 29, 2019
e2ac2d6
integrate curator
fsbbn Jul 29, 2019
5bbd495
keyIndex is independant of roundIndex
fsbbn Jul 29, 2019
2556417
process and validate candidate transactions, get nominees
fsbbn Jul 30, 2019
892dcf1
implement NomineePublisher
fsbbn Jul 30, 2019
9ec6bb4
send transaction to update nominees, take correct keyindex, add Candi…
fsbbn Jul 30, 2019
ab65914
validate nominee tx with merkle path depth 15, fix getNomineeAddresses
fsbbn Jul 30, 2019
0946ad4
update nominees when start round is reached, store round of latestNom…
fsbbn Jul 30, 2019
d046bb5
integrate nomineeTracker, candidateTracker and nomineePublisher
fsbbn Jul 30, 2019
94a8320
add nomineeTracker to API tests
fsbbn Jul 30, 2019
9554ad4
take correct keyIndex and filepath
fsbbn Jul 30, 2019
42cc48c
genesis time
fsbbn Jul 30, 2019
c65f2bd
logs
fsbbn Jul 30, 2019
c005f80
rename logger
fsbbn Jul 31, 2019
712a871
add nomineeTracker, activate MilestonePublisher when address is accep…
fsbbn Jul 31, 2019
4cf16e0
recover keyIndex and keyfileIndex when starting node
fsbbn Aug 1, 2019
2e2fc08
store keyIndex and keyfileIndex in keyfile, move getSeed, tree and pa…
fsbbn Aug 1, 2019
777a4d1
logs
fsbbn Aug 1, 2019
ed64189
wait 20s before spamming
fsbbn Aug 2, 2019
bb86b7d
delete addToNomineeQueue from interface
fsbbn Aug 2, 2019
4fa6189
move initial nominees to CandidateTracker, enable removing nominees, …
fsbbn Aug 2, 2019
210a0ee
remove old address when generating new keyfile
fsbbn Aug 2, 2019
8682cf1
remove initial nominees, logs
fsbbn Aug 2, 2019
2b2f6b9
store latest nominee tx hash, check current idy = 0, replace all nomi…
fsbbn Aug 2, 2019
3aca215
reference initial nominee tx hash, store 1/-1 fro join/leave in tag, …
fsbbn Aug 2, 2019
2aec63f
add nomineeTracker to API tests
fsbbn Aug 2, 2019
a8a2bd3
add nomineeTracker to API
fsbbn Aug 2, 2019
6fccf1f
delete this
fsbbn Aug 2, 2019
ffdbb6b
logs
fsbbn Aug 2, 2019
c56901e
add config parameters and flags for nominee and curator
fsbbn Aug 2, 2019
5380620
bump version
oracle58 Aug 6, 2019
c8b0277
Added todos and optimized verbosity
oracle58 Aug 6, 2019
a20c7a0
--nominee is not a boolean anymore, but rather takes a path to the se…
oracle58 Aug 6, 2019
c317c54
Fix missing braces for checkstyle
oracle58 Aug 6, 2019
51089fe
Added BundleFactory, milestone bundle type and templates for other types
oracle58 Aug 6, 2019
6590fbe
Refactoring: BundleTypes & publishing
oracle58 Aug 6, 2019
2640f9f
Merge pull request #111 from HelixNetwork/finality-update-of
fsbbn Aug 7, 2019
97f5baf
genesis time
fsbbn Aug 7, 2019
5ce1c96
fix genesis time
fsbbn Aug 7, 2019
04d63dc
Merge branch 'finality-update-2' of https://github.com/HelixNetwork/h…
fsbbn Aug 7, 2019
ff6a954
implement helping methods for creating a bundle
fsbbn Aug 7, 2019
7ef4a1a
use BundleTypes to construct milestone, nominee and registration bundles
fsbbn Aug 7, 2019
ead6d34
rename milestoneTracker, delete unused methods
fsbbn Aug 7, 2019
a396232
Refactor bundletypes 2
oracle58 Aug 7, 2019
970bb0d
minor
oracle58 Aug 7, 2019
be1ef6f
Refactor bundletypes 3
oracle58 Aug 7, 2019
d50d51e
cleanup unused
oracle58 Aug 7, 2019
16624db
Refactor bundletypes 4
oracle58 Aug 7, 2019
a4620ea
Merge pull request #112 from HelixNetwork/finality-update-of-2
fsbbn Aug 8, 2019
d66b0c6
move validateCandidate to service
fsbbn Aug 9, 2019
1df56a3
solidifiy candidates with current round index
fsbbn Aug 9, 2019
fb998e4
create nominee directory with nomineeSolidifier, Service, Exception a…
fsbbn Aug 9, 2019
269a8a7
don't use publish
fsbbn Aug 9, 2019
b716add
make path to keyfile variable
fsbbn Aug 11, 2019
5742acf
implement is_BundleStructureValid
fsbbn Aug 11, 2019
300e9eb
allow referencing null hash
fsbbn Aug 11, 2019
aa8af23
remove belowMaxDepth check
fsbbn Aug 11, 2019
cc2fe0f
comment bugs in milestonePublisher
fsbbn Aug 11, 2019
3ca66db
isCandidateBundleStructureValid does not work
fsbbn Aug 11, 2019
d822fb1
typo
fsbbn Aug 11, 2019
e197b26
fixing local snapshots
fsbbn Aug 13, 2019
9676b11
add roundPause, nomineeKeyfile and curatorKeyfile to config
fsbbn Aug 14, 2019
9cdeee5
make private
fsbbn Aug 14, 2019
31f9bf4
enable sending milestones/registrations/nomineeTx with higher securit…
fsbbn Aug 14, 2019
b170be9
add nominee and curator security level to config
fsbbn Aug 14, 2019
b692e55
take security level from config
fsbbn Aug 14, 2019
5469569
rename
fsbbn Aug 14, 2019
a6cb4e8
take security level from config (2)
fsbbn Aug 14, 2019
21c7003
merge
fsbbn Aug 14, 2019
e7dd0f7
set new nominee address
fsbbn Aug 14, 2019
52de56f
fix wrong index
fsbbn Aug 14, 2019
882acfb
set nominee security = 2
fsbbn Aug 14, 2019
65dcbc9
Commit fix by cristina into merged branch: isCandidateBundleStructure…
oracle58 Aug 15, 2019
2bcac54
Update README.md
oracle58 Aug 23, 2019
a1bfb9a
Update pom.xml
oracle58 Aug 23, 2019
2c82356
Enabled candidate bundle structure validation
cristinavasiu Sep 6, 2019
f41565b
Refactor round index
cristinavasiu Sep 6, 2019
d216539
Merge branch 'finality-update-2-merge' of https://github.com/HelixNet…
crizaqcri Sep 6, 2019
806911b
check solidity of latest (current) round, before consider previous ro…
fsbbn Sep 5, 2019
46c7db5
only the first transaction should contain the nominee address
fsbbn Sep 5, 2019
723121a
wait before start sending nominees
fsbbn Aug 20, 2019
f1c5c56
send registration if nominee isn't part of initial nominees
fsbbn Aug 20, 2019
da172ea
get curator security from config
fsbbn Aug 19, 2019
d78509d
dataFragment fix
fsbbn Aug 19, 2019
be59d12
Change tag hash size from 32 to 8 bytes
cristinavasiu Sep 11, 2019
04b4bbb
Fix round index upper limit
cristinavasiu Sep 11, 2019
79bdaf7
Merge branch 'finality-update-2-merge' of https://github.com/HelixNet…
cristinavasiu Sep 11, 2019
f60e408
dev merge
fsbbn Sep 13, 2019
e31e3c8
dev merge
fsbbn Sep 13, 2019
7adf140
fixed Hash size to support new TagHash size
Sep 15, 2019
69c1b46
fixed Transaction metadata size to support new TagHash size
Sep 15, 2019
419c2ac
updated EntryPointSelectorImplTest (Round is used instead of Milestone)
Sep 15, 2019
b13e69d
mockRound() was added
Sep 15, 2019
8904087
Merge pull request #133 from HelixNetwork/finality-dev-merge-1309
oracle58 Sep 16, 2019
a834344
update README.md for finality
oracle58 Sep 16, 2019
eeaad7e
change description in pom
oracle58 Sep 16, 2019
0c045a7
only initialize Publisher/Spammer when flag
oracle58 Sep 16, 2019
6689420
remove/comment debug prints
oracle58 Sep 16, 2019
ee3e923
fix null pointer in shutdown hook
oracle58 Sep 16, 2019
fc7f14e
Update changelog.md
oracle58 Sep 16, 2019
c06bfa0
fix curator address and security level
oracle58 Sep 16, 2019
dbb34e6
update docker.md
oracle58 Sep 16, 2019
ab3558e
dockerfile: helix-1.0 -> helix
oracle58 Sep 16, 2019
1fe1aa8
minor
oracle58 Sep 16, 2019
ff98e4c
comment snapshot tests
oracle58 Sep 16, 2019
0581071
comment getNomineesOfRound() until it's fixed
oracle58 Sep 16, 2019
cb23691
graphstream windows fix
oracle58 Sep 16, 2019
5f31983
enabel publish keyChange bundle
fsbbn Sep 17, 2019
3b3970c
track keyChange bundle with CandidateTracker and update addresss dire…
fsbbn Sep 17, 2019
99efbb8
set startRoundDelay = 2 for faster key change
fsbbn Sep 17, 2019
e7d83d9
remove prints
fsbbn Sep 17, 2019
b18ede5
Merge pull request #134 from HelixNetwork/no-curator
oracle58 Sep 17, 2019
165757d
update changelog.md
oracle58 Sep 17, 2019
8c452b4
updated nominee instructions
oracle58 Sep 17, 2019
ea1ac87
Added initial nominees
oracle58 Sep 17, 2019
47c1980
Add nominee to initial nominees
oracle58 Sep 17, 2019
7c55f39
Set actual genesis time for testnet
oracle58 Sep 17, 2019
f7bcbeb
bump to 0.6.1
oracle58 Sep 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.6.1
- Curator-less implementation
- Set initial nominees
- Set testnet genesis time

## 0.6.0
- Finality Update integration. For more info see the [specifications](https://github.com/HelixNetwork/helix-specs/blob/master/specs/1.0/finality.md).

## 0.5.9

- Added security levels according to specifications
Expand Down
6 changes: 3 additions & 3 deletions DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The provided dockerfile only contains the bare minimum of configuration paramete
2. build: installs Maven on top of the java stage and compiles Helix
3. final container: copies the helix jar file using the java stage as base

The built container assumes the WORKDIR inside the container is /helix-1.0/data: this means that the database directory will be written inside that directory by default. If a system administrator wants to retain the database across restarts, it is his/her job to mount a docker volume in the right folder
The built container assumes the WORKDIR inside the container is /helix/data: this means that the database directory will be written inside that directory by default. If a system administrator wants to retain the database across restarts, it is his/her job to mount a docker volume in the right folder

## Getting Started

Expand All @@ -32,7 +32,7 @@ In order to run this container you'll need docker installed.
### Example

```shell
sudo docker run helixnetwork/helix-1.0:latest -p 8085
sudo docker run helixnetwork/helix:latest -p 8085
```

This will run the helix with its API listening on port 8085, with no peers and a fresh database.
Expand All @@ -44,7 +44,7 @@ You can also pass more command line options to the docker run command and those
If you want to use a `<conf_name>`.ini file with the docker container, supposing it's stored under /path/to/conf/`<conf_name>`.ini on your docker host, then pass -v /path/to/conf:/helix/conf and add -c /helix/conf/`<conf_name>`.ini as docker run arguments. So for example the docker run command above would become:

```shell
docker run -v /path/to/conf:/helix/conf -v /path/to/data:/helix/data helixnetwork/helix-1.0:latest -p 8085 -c /helix/conf/<conf_name>.ini
docker run -v /path/to/conf:/helix/conf -v /path/to/data:/helix/data helixnetwork/helix:latest -p 8085 -c /helix/conf/<conf_name>.ini
```

## Security
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM helixnetwork/base16.04:latest as builder
LABEL maintainer="dt@hlx.ai"

WORKDIR /helix-1.0
COPY . /helix-1.0
WORKDIR /helix
COPY . /helix
RUN mvn clean package

FROM openjdk:jre-slim
Expand All @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
socat \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /helix-1.0/target/helix*.jar /helix-1.0/target/
COPY --from=builder /helix/target/helix*.jar /helix/target/
COPY docker/entrypoint.sh /

# Default environment variables configuration. See DOCKER.md for details.
Expand Down Expand Up @@ -40,7 +40,7 @@ COPY docker/entrypoint.sh /
ENV JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+DisableAttachMechanism -XX:InitiatingHeapOccupancyPercent=60 -XX:G1MaxNewSizePercent=75 -XX:MaxGCPauseMillis=10000 -XX:+UseG1GC" \
JAVA_MIN_MEMORY=2G \
JAVA_MAX_MEMORY=4G \
DOCKER_HLX_JAR_PATH="/helix-1.0/target" \
DOCKER_HLX_JAR_PATH="/helix/target" \
DOCKER_HLX_JAR_FILE="helix*.jar" \
DOCKER_HLX_REMOTE_LIMIT_API="interruptAttachToTangle, attachToTangle, addNeighbors, removeNeighbors, getNeighbors" \
DOCKER_HLX_MONITORING_API_PORT_ENABLE=0 \
Expand All @@ -49,5 +49,5 @@ ENV JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+DisableAttachMechanism -
DOCKER_HLX_LOGGING_LEVEL="info" \
DOCKER_JAVA_NET_PREFER_IPV4_STACK=true

WORKDIR /helix-1.0/data
WORKDIR /helix/data
ENTRYPOINT [ "/entrypoint.sh" ]
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

[![license][4]][5] [![build][6]][7] [![grade][8]][9] [![coverage][10]][11] [![discord][14]][15]

# Helix-1.0
# Helix

A Quorum based Tangle implementation forked from [**IRI**](https://github.com/iotaledger/iri/).

- **Latest release:** 0.5.9 pre-release
- **Latest release:** 0.6.1 pre-release
- **License:** GPLv3

Special thanks to all of the [IOTA Contributors](https://github.com/iotaledger/iri/graphs/contributors)!
Expand All @@ -22,19 +21,24 @@ Make sure you have [**Maven**](https://maven.apache.org/) and [**Java 8**](https

### Download

$ git clone https://github.com/HelixNetwork/helix-1.0.git
$ git clone https://github.com/HelixNetwork/helix.git

### Build

Build an executable jar at the `target` directory using maven.

$ cd helix-1.0
$ cd helix
$ mvn clean package

### Launch
### Launch Full node

java -jar target/helix-<VERSION>.jar -p 8085

### Launch Nominee node
Launching a node as a nominee first requires to generate a 64 character hex string, that is used as a seed for key generation. You will find the public key in the last line of the `nominee.key` file contained in the resources directory. If you wish to act as a nominee, please send a request to dt@hlx.ai containing your public key.

java -jar target/helix-<VERSION>.jar -p 8085 --nominee <pathToNomineeSeed>

## Configuration

| Option | Short | Description | Example Input |
Expand Down Expand Up @@ -65,8 +69,6 @@ PORT = 8085
UDP_RECEIVER_PORT = 4100
NEIGHBORS = udp://my.favorite.com:5100
HXI_DIR = XI
HEADLESS = true
DEBUG = true
DB_PATH = db
ZMQ_ENABLED = true
```
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

<groupId>net.helix</groupId>
<artifactId>helix</artifactId>
<version>0.5.9</version>

<version>0.6.1</version>

<name>Helix</name>
<description>Helix-1.0</description>
<description>Helix Protocol</description>

<scm>
<url>https://github.com/helixnetwork/helix-1.0/</url>
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/net/helix/hlx/BundleValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.helix.hlx.model.Hash;
import net.helix.hlx.service.snapshot.Snapshot;
import net.helix.hlx.storage.Tangle;
import org.bouncycastle.util.encoders.Hex;

import java.util.*;

Expand Down Expand Up @@ -61,11 +62,13 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot

TransactionViewModel tail = TransactionViewModel.fromHash(tangle, tailHash);
if (tail.getCurrentIndex() != 0 || tail.getValidity() == -1) {
//System.out.println("Empty List");
return Collections.EMPTY_LIST;
}

List<List<TransactionViewModel>> transactions = new LinkedList<>();
final Map<Hash, TransactionViewModel> bundleTransactions = loadTransactionsFromTangle(tangle, tail);
// System.out.println("bundle size: " + bundleTransactions.size());

//we don't really iterate, we just pick the tail tx. See the if on the next line
for (TransactionViewModel transactionViewModel : bundleTransactions.values()) {
Expand Down Expand Up @@ -99,13 +102,9 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot
|| bundleValue > TransactionViewModel.SUPPLY)
) {
instanceTransactionViewModels.get(0).setValidity(tangle, initialSnapshot, -1);
//System.out.println("Semantics Error!");
break;
}
// todo address validation
/* if (transactionViewModel.value() != 0 && transactionViewModel.getAddressHash().bytes()[Sha3.HASH_LENGTH - 1] != 0) {
instanceTransactionViewModels.get(0).setValidity(tangle, initialSnapshot, -1);
break;
}*/

// It's supposed to become -3812798742493 after 3812798742493 and to go "down" to -1 but
// we hope that no one will create such long bundles
Expand All @@ -120,6 +119,8 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot
}
sha3Instance.squeeze(bundleHashBytes, 0, bundleHashBytes.length);
//verify bundle hash is correct
//System.out.println("Bundle Hash: " + instanceTransactionViewModels.get(0).getBundleHash());
//System.out.println("recalculated Bundle Hash: " + Hex.toHexString(bundleHashBytes));
if (Arrays.equals(instanceTransactionViewModels.get(0).getBundleHash().bytes(), bundleHashBytes)) {
//normalizing the bundle in preparation for signature verification
normalizedBundle = Winternitz.normalizedBundle(bundleHashBytes);
Expand All @@ -146,6 +147,7 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot
//signature verification
if (! Arrays.equals(transactionViewModel.getAddressHash().bytes(), addressBytes)) {
instanceTransactionViewModels.get(0).setValidity(tangle, initialSnapshot, -1);
//System.out.println("Signature Error!");
break MAIN_LOOP;
}
} else {
Expand All @@ -159,6 +161,7 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot
//bundle hash verification failed
else {
instanceTransactionViewModels.get(0).setValidity(tangle, initialSnapshot, -1);
//System.out.println("Bundle Hash Error!");
}
}
//bundle validity status is known
Expand All @@ -169,6 +172,7 @@ public static List<List<TransactionViewModel>> validate(Tangle tangle, Snapshot
//total bundle value does not sum to 0
else {
instanceTransactionViewModels.get(0).setValidity(tangle, initialSnapshot, -1);
//System.out.println("Bundle Sum Error!");
}
//break from main loop
break;
Expand Down
34 changes: 23 additions & 11 deletions src/main/java/net/helix/hlx/HLX.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import net.helix.hlx.service.API;
import net.helix.hlx.service.ApiArgs;
import net.helix.hlx.service.Spammer;
import net.helix.hlx.service.milestone.MSS;
import net.helix.hlx.service.milestone.impl.MilestonePublisher;
import net.helix.hlx.service.curator.impl.NomineePublisher;
import net.helix.hlx.service.restserver.resteasy.RestEasy;
import net.helix.hlx.utils.HelixIOUtils;
import org.apache.commons.lang3.ArrayUtils;
Expand Down Expand Up @@ -39,13 +40,13 @@
* </ul>
* </p>
*
* @see <a href="https://docs.hlx.ai/sbx">Online documentation on hlx</a>
* @see <a href="https://docs.hlx.ai/protocol">Online documentation on hlx</a>
*/
public class HLX {

public static final String MAINNET_NAME = "HLX";
public static final String TESTNET_NAME = "HLX Testnet";
public static final String VERSION = "0.5.9";
public static final String VERSION = "0.6.1";

/**
* The entry point of the helix sandbox.
Expand Down Expand Up @@ -96,7 +97,8 @@ private static class HLXLauncher {
public static Helix helix;
public static API api;
public static XI XI;
public static MSS mss;
public static MilestonePublisher milestonePublisher;
//public static NomineePublisher nomineePublisher;
public static Spammer spammer;

/**
Expand All @@ -121,8 +123,6 @@ public static void main(String [] args) throws Exception {
XI = new XI(helix);
ApiArgs apiArgs = new ApiArgs(helix, XI);
api = new API(apiArgs);
mss = new MSS(config, api);
spammer = new Spammer(config, api);
shutdownHook();

try {
Expand All @@ -135,12 +135,19 @@ public static void main(String [] args) throws Exception {
log.error("Exception during Helix node initialisation: ", e);
throw e;
}
if(config.getMsDelay() > 0) {
mss.startScheduledExecutorService();
if (config.getNominee() != null) {
milestonePublisher = new MilestonePublisher(config, api, helix.candidateTracker);
milestonePublisher.startScheduledExecutorService();
}
if(config.getSpamDelay() > 0) {
/*if (config.getCuratorEnabled()) {
nomineePublisher = new NomineePublisher(config, api);
nomineePublisher.startScheduledExecutorService();
}*/
/* todo: disable spammer temporarily
if (config.getSpamDelay() > 0) {
spammer = new Spammer(config, api);
spammer.startScheduledExecutorService();
}
}*/
}

/**
Expand All @@ -151,7 +158,12 @@ private static void shutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
log.info("Shutting down Helix node, please hold tight...");
try {
mss.shutdown();
if (helix.configuration.getNominee() != null) {
milestonePublisher.shutdown();
}
/*if (helix.configuration.getCuratorEnabled()) {
nomineePublisher.shutdown();
}*/
XI.shutdown();
api.shutDown();
helix.shutdown();
Expand Down
38 changes: 30 additions & 8 deletions src/main/java/net/helix/hlx/Helix.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import net.helix.hlx.service.TipsSolidifier;
import net.helix.hlx.service.ledger.impl.LedgerServiceImpl;
import net.helix.hlx.service.milestone.impl.*;
import net.helix.hlx.service.nominee.impl.*;
import net.helix.hlx.service.curator.impl.*;
import net.helix.hlx.service.snapshot.SnapshotException;
import net.helix.hlx.service.snapshot.impl.LocalSnapshotManagerImpl;
import net.helix.hlx.service.snapshot.impl.SnapshotProviderImpl;
Expand Down Expand Up @@ -79,12 +81,18 @@ public class Helix {
public final SnapshotServiceImpl snapshotService;
public final LocalSnapshotManagerImpl localSnapshotManager;
public final MilestoneServiceImpl milestoneService;
public final LatestMilestoneTrackerImpl latestMilestoneTracker;
//public final NomineeServiceImpl nomineeService;
public final CuratorServiceImpl curatorService;
public final MilestoneTrackerImpl latestMilestoneTracker;
//public final NomineeTrackerImpl nomineeTracker;
public final CandidateTrackerImpl candidateTracker;
public final LatestSolidMilestoneTrackerImpl latestSolidMilestoneTracker;
public final SeenMilestonesRetrieverImpl seenMilestonesRetriever;
public final LedgerServiceImpl ledgerService = new LedgerServiceImpl();
public final AsyncTransactionPruner transactionPruner;
public final MilestoneSolidifierImpl milestoneSolidifier;
//public final NomineeSolidifierImpl nomineeSolidifier;
public final CandidateSolidifierImpl candidateSolidifier;
public final TransactionRequesterWorkerImpl transactionRequesterWorker;

public final Tangle tangle;
Expand Down Expand Up @@ -124,10 +132,16 @@ public Helix(HelixConfig configuration) throws TransactionPruningException, Snap
? new LocalSnapshotManagerImpl()
: null;
milestoneService = new MilestoneServiceImpl();
latestMilestoneTracker = new LatestMilestoneTrackerImpl();
//nomineeService = new NomineeServiceImpl();
curatorService = new CuratorServiceImpl();
latestMilestoneTracker = new MilestoneTrackerImpl();
//nomineeTracker = new NomineeTrackerImpl();
candidateTracker = new CandidateTrackerImpl();
latestSolidMilestoneTracker = new LatestSolidMilestoneTrackerImpl();
seenMilestonesRetriever = new SeenMilestonesRetrieverImpl();
milestoneSolidifier = new MilestoneSolidifierImpl();
//nomineeSolidifier = new NomineeSolidifierImpl();
candidateSolidifier = new CandidateSolidifierImpl();
transactionPruner = configuration.getLocalSnapshotsEnabled() && configuration.getLocalSnapshotsPruningEnabled()
? new AsyncTransactionPruner()
: null;
Expand Down Expand Up @@ -167,7 +181,7 @@ public void init() throws Exception {
}

if (configuration.isRevalidate()) {
tangle.clearColumn(net.helix.hlx.model.persistables.Milestone.class);
tangle.clearColumn(net.helix.hlx.model.persistables.Round.class);
tangle.clearColumn(net.helix.hlx.model.StateDiff.class);
tangle.clearMetadata(net.helix.hlx.model.persistables.Transaction.class);
}
Expand All @@ -181,6 +195,8 @@ public void init() throws Exception {

latestMilestoneTracker.start();
latestSolidMilestoneTracker.start();
//nomineeTracker.start();
candidateTracker.start();
seenMilestonesRetriever.start();
milestoneSolidifier.start();
transactionRequesterWorker.start();
Expand Down Expand Up @@ -209,13 +225,19 @@ private void injectDependencies() throws SnapshotException, TransactionPruningEx
if (localSnapshotManager != null) {
localSnapshotManager.init(snapshotProvider, snapshotService, transactionPruner, configuration);
}
milestoneService.init(tangle, snapshotProvider, snapshotService, configuration);
latestMilestoneTracker.init(tangle, snapshotProvider, milestoneService, milestoneSolidifier, configuration);
milestoneService.init(tangle, snapshotProvider, snapshotService, transactionValidator, configuration);
//nomineeService.init(tangle, snapshotProvider, snapshotService, configuration);
curatorService.init(tangle, snapshotProvider, snapshotService, configuration);
//nomineeTracker.init(tangle, snapshotProvider, nomineeService, nomineeSolidifier, configuration);
candidateTracker.init(tangle, snapshotProvider, curatorService, candidateSolidifier, configuration);
latestMilestoneTracker.init(tangle, snapshotProvider, milestoneService, milestoneSolidifier, candidateTracker, configuration);
latestSolidMilestoneTracker.init(tangle, snapshotProvider, milestoneService, ledgerService,
latestMilestoneTracker);
seenMilestonesRetriever.init(tangle, snapshotProvider, transactionRequester);
milestoneSolidifier.init(snapshotProvider, transactionValidator);
ledgerService.init(tangle, snapshotProvider, snapshotService, milestoneService, graph);
//nomineeSolidifier.init(snapshotProvider, transactionValidator);
candidateSolidifier.init(snapshotProvider, transactionValidator);
ledgerService.init(tangle, snapshotProvider, snapshotService, milestoneService, configuration, graph);
if (transactionPruner != null) {
transactionPruner.init(tangle, snapshotProvider, spentAddressesService, tipsViewModel, configuration)
.restoreState();
Expand All @@ -230,7 +252,7 @@ private void rescanDb() throws Exception {
tangle.clearColumn(net.helix.hlx.model.persistables.Approvee.class);
tangle.clearColumn(net.helix.hlx.model.persistables.BundleNonce.class);
tangle.clearColumn(net.helix.hlx.model.persistables.Tag.class);
tangle.clearColumn(net.helix.hlx.model.persistables.Milestone.class);
tangle.clearColumn(net.helix.hlx.model.persistables.Round.class);
tangle.clearColumn(net.helix.hlx.model.StateDiff.class);
tangle.clearMetadata(net.helix.hlx.model.persistables.Transaction.class);

Expand Down Expand Up @@ -305,4 +327,4 @@ private TipSelector createTipSelector(TipSelConfig config) {
return new TipSelectorImpl(tangle, snapshotProvider, ledgerService, entryPointSelector, ratingCalculator,
walker, config);
}
}
}
Loading