-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Description See the following PRs: #688 #701 #691 --------- Co-authored-by: Hristiyan Mitov <[email protected]> Co-authored-by: Hristiyan Mitov <[email protected]>
- Loading branch information
1 parent
0e86c95
commit a1a422a
Showing
66 changed files
with
1,097 additions
and
696 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.limechain; | ||
|
||
public interface NodeService { | ||
|
||
void start(); | ||
|
||
void stop(); | ||
} |
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,14 @@ | ||
package com.limechain; | ||
|
||
import com.limechain.runtime.Runtime; | ||
|
||
/** | ||
* This interface defines states that are initialized by runtime data and updated | ||
* via consensus messages (e.g. BABE, GRANDPA, BEEFY). | ||
* | ||
* <p>Implementing classes initialize state from runtime and update it with consensus messages.</p> | ||
*/ | ||
public interface ServiceConsensusState { | ||
|
||
void populateDataFromRuntime(Runtime runtime); | ||
} |
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,10 @@ | ||
package com.limechain; | ||
|
||
public interface ServiceState { | ||
|
||
void initialize(); | ||
|
||
void initializeFromDatabase(); | ||
|
||
void persistState(); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/limechain/babe/api/scale/BabeApiConfigurationReader.java
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/limechain/babe/predigest/scale/PreDigestWriter.java
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 was deleted.
Oops, something went wrong.
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,29 @@ | ||
package com.limechain.client; | ||
|
||
public class AuthoringNode extends AbstractNode { | ||
import com.limechain.babe.state.EpochState; | ||
import com.limechain.grandpa.state.GrandpaSetState; | ||
import com.limechain.network.NetworkService; | ||
import com.limechain.rpc.server.AppBean; | ||
import com.limechain.storage.block.state.BlockState; | ||
import com.limechain.sync.SyncService; | ||
import com.limechain.sync.state.SyncState; | ||
import com.limechain.transaction.TransactionState; | ||
|
||
@Override | ||
public void start() { | ||
super.start(); | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class AuthoringNode extends HostNode { | ||
|
||
public AuthoringNode() { | ||
super(List.of( | ||
//TODO Add babe and grandpa services. | ||
Objects.requireNonNull(AppBean.getBean(NetworkService.class)), | ||
Objects.requireNonNull(AppBean.getBean(SyncService.class))), | ||
List.of( | ||
Objects.requireNonNull(AppBean.getBean(BlockState.class)), | ||
Objects.requireNonNull(AppBean.getBean(SyncState.class)), | ||
Objects.requireNonNull(AppBean.getBean(EpochState.class)), | ||
Objects.requireNonNull(AppBean.getBean(GrandpaSetState.class)), | ||
Objects.requireNonNull(AppBean.getBean(TransactionState.class)))); | ||
} | ||
} |
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,12 +1,26 @@ | ||
package com.limechain.client; | ||
|
||
import lombok.extern.java.Log; | ||
import com.limechain.babe.state.EpochState; | ||
import com.limechain.grandpa.state.GrandpaSetState; | ||
import com.limechain.network.NetworkService; | ||
import com.limechain.rpc.server.AppBean; | ||
import com.limechain.storage.block.state.BlockState; | ||
import com.limechain.sync.SyncService; | ||
import com.limechain.sync.state.SyncState; | ||
|
||
@Log | ||
public class FullNode extends AbstractNode { | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Override | ||
public void start() { | ||
super.start(); | ||
public class FullNode extends HostNode { | ||
|
||
public FullNode() { | ||
super(List.of( | ||
Objects.requireNonNull(AppBean.getBean(NetworkService.class)), | ||
Objects.requireNonNull(AppBean.getBean(SyncService.class))), | ||
List.of( | ||
Objects.requireNonNull(AppBean.getBean(BlockState.class)), | ||
Objects.requireNonNull(AppBean.getBean(SyncState.class)), | ||
Objects.requireNonNull(AppBean.getBean(EpochState.class)), | ||
Objects.requireNonNull(AppBean.getBean(GrandpaSetState.class)))); | ||
} | ||
} |
Oops, something went wrong.