Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #174 from HelixNetwork/dev
Browse files Browse the repository at this point in the history
0.6.9
  • Loading branch information
oracle58 authored Sep 25, 2019
2 parents 24c25fe + 282ccae commit c516264
Show file tree
Hide file tree
Showing 48 changed files with 609 additions and 837 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Log file
*.log
log.*

# BlueJ files
*.ctxt
Expand Down
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.6.9
- Set `GENESIS_TIME` to [mainnet-genesis-time](https://github.com/HelixNetwork/helix-dao-data#genesis-time)
- Update Undertow from 1.4.6 to 2.0.26
- Removed obsolete nominee tracking
- Renamed curator->ValidatorManager
- Renamed nominee -> Validator
- Modified the following configs:
- `--curator` => `--validator-manager`
- `--update-nominee` => `--update-validator`
- `--start-nominee` => `--start-validator`
- `--nominee` => `--validator`
- `--testnet-no-coo-validation` => `--testnet-no-milestone-sign-validation`
- Fixed Logback configuration

## 0.6.8
- Remove Graphstream
- Snapshots are saved to specifiable dir within of root
Expand All @@ -14,7 +28,7 @@
## 0.6.5
- getNodeInfo now only reflects relevant information
- Store nominees in local db and fix getNomineesOfRound()
- Deleted empty HelixTest
- Deleted empty HelixTest
- Fix debug info and javadocs in Tests
- Fix for debug info, javadoc and variable names in src

Expand Down Expand Up @@ -46,4 +60,4 @@

## pre-0.6.0

These change-logs have been removed to keep the file concise, if there are specific interests, feel free to reach out to the contributors.
These change-logs have been removed to keep the file concise, if there are specific interests, feel free to reach out to the contributors.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Pendulum

Pendulum is a quorum based [Tangle](https://github.com/iotaledger/iri/) implementation designed towards reliable timekeeping and high-throughput messaging.
- **Latest release:** 0.6.8 pre-release
- **Latest release:** 0.6.9 pre-release
- **License:** GPLv3

Special thanks to all of the [IOTA Contributors](https://github.com/iotaledger/iri/graphs/contributors)!
Expand Down Expand Up @@ -34,11 +34,11 @@ Build an executable jar at the `target` directory using maven.

java -jar target/pendulum-<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 [email protected] containing your public key.

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

### Launch Validator node
Launching a node as a validator 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 `validator.key` file contained in the resources directory. If you wish to act as a validator, please send a request to [email protected] containing your public key.
java -jar target/pendulum-<VERSION>.jar -p 8085 --validator <pathToValidatorSeed>

### Nginx cluster sample config

Expand Down Expand Up @@ -125,7 +125,15 @@ server {
| `--remote-limit-api` | | Exclude certain API calls from being able to be accessed remotely | `--remote-limit-api "attachToTangle, addNeighbors"` |
| `--send-limit` | | Limit the outbound bandwidth consumption. Limit is set to mbit/s | `--send-limit 1.0` |
| `--max-peers` | | Limit the number of max accepted peers. Default is set to 0. | `--max-peers 8` |
| `--dns-resolution-false` | | Ignores DNS resolution refreshing | `--dns-resolution-false` |
| `--dns-resolution-false` | | Ignores DNS resolution refreshing | `--dns-resolution-false` |
| `--savelog-enabled` | | Writes the log to file system | `--savelog-enabled` | | `--pow-disabled` |
| `--validator` | | Flag that enables applying as a validator in the network. A path to a file containing the seed has to be passed. | `--savelog-enabled` | | `--pow-disabled` |
| `--update-validator` | | The desired delay for updating validators in seconds. | `--savelog-enabled` | | `--pow-disabled` |
| `--start-validator` | | The number of rounds between validators are published and the round they start to operate. | `--savelog-enabled` | | `--pow-disabled` |
| `--genessis` | | Time when the ledger started. | `--savelog-enabled` | | `--pow-disabled` |
| `--round` | | Duration of a round in milli secounds. | `--savelog-enabled` | | `--pow-disabled` |
| `--round-pause` | | Duration of time to finalize the round in milli secounds. | `--savelog-enabled` | | `--pow-disabled` |
| `--dns-resolution-false` |


### INI
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>net.pendulum</groupId>
<artifactId>pendulum</artifactId>

<version>0.6.8</version>
<version>0.6.9</version>

<name>Pendulum</name>
<description>Pendulum Protocol</description>
Expand Down
21 changes: 11 additions & 10 deletions src/main/java/net/helix/pendulum/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.helix.pendulum.service.Spammer;
import net.helix.pendulum.service.milestone.impl.MilestonePublisher;
import net.helix.pendulum.service.restserver.resteasy.RestEasy;
import net.helix.pendulum.service.validatomanager.impl.ValidatorPublisher;
import net.helix.pendulum.utils.PendulumIOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -45,7 +46,7 @@ public class Main {

public static final String MAINNET_NAME = "Pendulum";
public static final String TESTNET_NAME = "Pendulum Testnet";
public static final String VERSION = "0.6.8";
public static final String VERSION = "0.6.9";

/**
* The entry point of Pendulum.
Expand Down Expand Up @@ -97,7 +98,7 @@ private static class MainLauncher {
public static API api;
public static XI XI;
public static MilestonePublisher milestonePublisher;
//public static NomineePublisher nomineePublisher;
public static ValidatorPublisher validatorPublisher;
public static Spammer spammer;

/**
Expand Down Expand Up @@ -134,14 +135,14 @@ public static void main(String [] args) throws Exception {
log.error("Exception during Pendulum node initialisation: ", e);
throw e;
}
if (config.getNominee() != null || new File(config.getNomineeKeyfile()).isFile() ) {
if (config.getValidator() != null || new File(config.getValidatorKeyfile()).isFile() ) {
milestonePublisher = new MilestonePublisher(config, api, pendulum.candidateTracker);
milestonePublisher.startScheduledExecutorService();
}
/*if (config.getCuratorEnabled()) {
nomineePublisher = new NomineePublisher(config, api);
nomineePublisher.startScheduledExecutorService();
}*/
if (config.getValidatorManagerEnabled()) {
validatorPublisher = new ValidatorPublisher(config, api);
validatorPublisher.startScheduledExecutorService();
}
/* todo: disable spammer temporarily
if (config.getSpamDelay() > 0) {
spammer = new Spammer(config, api);
Expand All @@ -157,11 +158,11 @@ private static void shutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
log.info("Shutting down Pendulum node, please hold tight...");
try {
if (pendulum.configuration.getNominee() != null || new File(pendulum.configuration.getNomineeKeyfile()).isFile()) {
if (pendulum.configuration.getValidator() != null || new File(pendulum.configuration.getValidatorKeyfile()).isFile()) {
milestonePublisher.shutdown();
}
/*if (pendulum.configuration.getCuratorEnabled()) {
nomineePublisher.shutdown();
/*if (pendulum.configuration.getValidatorManagerEnabled()) {
validatorPublisher.shutdown();
}*/
XI.shutdown();
api.shutDown();
Expand Down
24 changes: 10 additions & 14 deletions src/main/java/net/helix/pendulum/Pendulum.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import net.helix.pendulum.network.impl.TransactionRequesterWorkerImpl;
import net.helix.pendulum.network.replicator.Replicator;
import net.helix.pendulum.service.TipsSolidifier;
import net.helix.pendulum.service.curator.impl.CandidateSolidifierImpl;
import net.helix.pendulum.service.curator.impl.CandidateTrackerImpl;
import net.helix.pendulum.service.curator.impl.CuratorServiceImpl;
import net.helix.pendulum.service.ledger.impl.LedgerServiceImpl;
import net.helix.pendulum.service.milestone.impl.LatestSolidMilestoneTrackerImpl;
import net.helix.pendulum.service.milestone.impl.MilestoneServiceImpl;
Expand All @@ -39,6 +36,9 @@
import net.helix.pendulum.service.tipselection.impl.WalkerAlpha;
import net.helix.pendulum.service.transactionpruning.TransactionPruningException;
import net.helix.pendulum.service.transactionpruning.async.AsyncTransactionPruner;
import net.helix.pendulum.service.validatomanager.impl.CandidateSolidifierImpl;
import net.helix.pendulum.service.validatomanager.impl.CandidateTrackerImpl;
import net.helix.pendulum.service.validatomanager.impl.ValidatorManagerServiceImpl;
import net.helix.pendulum.storage.Indexable;
import net.helix.pendulum.storage.Persistable;
import net.helix.pendulum.storage.PersistenceProvider;
Expand Down Expand Up @@ -96,7 +96,7 @@ public class Pendulum {
public final SnapshotServiceImpl snapshotService;
public final LocalSnapshotManagerImpl localSnapshotManager;
public final MilestoneServiceImpl milestoneService;
public final CuratorServiceImpl curatorService;
public final ValidatorManagerServiceImpl validatorManagerService;
public final MilestoneTrackerImpl latestMilestoneTracker;
public final CandidateTrackerImpl candidateTracker;
public final LatestSolidMilestoneTrackerImpl latestSolidMilestoneTracker;
Expand Down Expand Up @@ -140,15 +140,14 @@ public Pendulum(PendulumConfig configuration) throws TransactionPruningException
? new LocalSnapshotManagerImpl()
: null;
milestoneService = new MilestoneServiceImpl();
//nomineeService = new NomineeServiceImpl();
curatorService = new CuratorServiceImpl();
//validatorService = new ValidatorServiceImpl();
validatorManagerService = new ValidatorManagerServiceImpl();
latestMilestoneTracker = new MilestoneTrackerImpl();
//nomineeTracker = new NomineeTrackerImpl();
candidateTracker = new CandidateTrackerImpl();
latestSolidMilestoneTracker = new LatestSolidMilestoneTrackerImpl();
seenMilestonesRetriever = new SeenMilestonesRetrieverImpl();
milestoneSolidifier = new MilestoneSolidifierImpl();
//nomineeSolidifier = new NomineeSolidifierImpl();
//validatorSolidifier = new ValidatorSolidifierImpl();
candidateSolidifier = new CandidateSolidifierImpl();
transactionPruner = configuration.getLocalSnapshotsEnabled() && configuration.getLocalSnapshotsPruningEnabled()
? new AsyncTransactionPruner()
Expand Down Expand Up @@ -203,7 +202,6 @@ public void init() throws Exception {

latestMilestoneTracker.start();
latestSolidMilestoneTracker.start();
//nomineeTracker.start();
candidateTracker.start();
seenMilestonesRetriever.start();
milestoneSolidifier.start();
Expand Down Expand Up @@ -237,16 +235,14 @@ private void injectDependencies() throws SnapshotException, TransactionPruningEx
localSnapshotManager.init(snapshotProvider, snapshotService, transactionPruner, 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);
validatorManagerService.init(tangle, snapshotProvider, snapshotService, configuration);
candidateTracker.init(tangle, snapshotProvider, validatorManagerService, 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);
//nomineeSolidifier.init(snapshotProvider, transactionValidator);
//validatorSolidifier.init(snapshotProvider, transactionValidator);
candidateSolidifier.init(snapshotProvider, transactionValidator);
ledgerService.init(tangle, snapshotProvider, snapshotService, milestoneService, configuration);
if (transactionPruner != null) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/helix/pendulum/TransactionValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public boolean checkSolidity(Hash hash, boolean milestone, int maxProcessedTrans
TransactionViewModel milestoneTx;
if ((milestoneTx = transaction.isMilestoneBundle(tangle)) != null){
Set<Hash> parents = RoundViewModel.getMilestoneTrunk(tangle, transaction, milestoneTx);
parents.addAll(RoundViewModel.getMilestoneBranch(tangle, transaction, milestoneTx, config.getNomineeSecurity()));
parents.addAll(RoundViewModel.getMilestoneBranch(tangle, transaction, milestoneTx, config.getValidatorSecurity()));
for (Hash parent : parents){
nonAnalyzedTransactions.offer(parent);
}
Expand Down Expand Up @@ -411,7 +411,7 @@ public void updateStatus(TransactionViewModel transactionViewModel) throws Excep
TransactionViewModel milestoneTx;
if ((milestoneTx = transactionViewModel.isMilestoneBundle(tangle)) != null){
Set<Hash> parents = RoundViewModel.getMilestoneTrunk(tangle, transactionViewModel, milestoneTx);
parents.addAll(RoundViewModel.getMilestoneBranch(tangle, transactionViewModel, milestoneTx, config.getNomineeSecurity()));
parents.addAll(RoundViewModel.getMilestoneBranch(tangle, transactionViewModel, milestoneTx, config.getValidatorSecurity()));
for (Hash parent : parents){
tipsViewModel.removeTipHash(parent);
//System.out.println("Remove Tip: " + parent.hexString());
Expand Down Expand Up @@ -459,7 +459,7 @@ private boolean quickSetSolid(final TransactionViewModel transactionViewModel) t
TransactionViewModel milestoneTx;
if ((milestoneTx = transactionViewModel.isMilestoneBundle(tangle)) != null){
Set<Hash> parents = RoundViewModel.getMilestoneTrunk(tangle, transactionViewModel, milestoneTx);
parents.addAll(RoundViewModel.getMilestoneBranch(tangle, transactionViewModel, milestoneTx, config.getNomineeSecurity()));
parents.addAll(RoundViewModel.getMilestoneBranch(tangle, transactionViewModel, milestoneTx, config.getValidatorSecurity()));
for (Hash parent : parents){
if (!checkApproovee(fromHash(tangle, parent))) {
solid = false;
Expand Down
Loading

0 comments on commit c516264

Please sign in to comment.