forked from LimeChain/Fruzhin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup kademlia and warp sync (#8)
Fixes [Fruzhin#495](LimeChain#495) ## Checklist: - [x] I have read the [contributing guidelines](https://github.com/LimeChain/Fruzhin/blob/dev/CONTRIBUTING.md). - [x] My PR title matches the [Conventional Commits spec](https://www.conventionalcommits.org/). - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. --------- Co-authored-by: Yordan Atanasov <[email protected]>
- Loading branch information
Showing
34 changed files
with
992 additions
and
458 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
10 changes: 8 additions & 2 deletions
10
src/main/java/com/limechain/chain/lightsyncstate/Authority.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package com.limechain.chain.lightsyncstate; | ||
|
||
import com.limechain.teavm.annotation.Reflectable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.io.Serializable; | ||
import java.math.BigInteger; | ||
|
||
@Getter | ||
@Setter | ||
@Reflectable | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Authority implements Serializable { | ||
private final byte[] publicKey; | ||
private final BigInteger weight; | ||
private byte[] publicKey; | ||
private BigInteger weight; | ||
} |
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
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
16 changes: 4 additions & 12 deletions
16
src/main/java/com/limechain/network/StrictProtocolBinding.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
package com.limechain.network; | ||
|
||
public abstract class StrictProtocolBinding<T> { | ||
public abstract class StrictProtocolBinding { | ||
String protocolId; | ||
|
||
protected StrictProtocolBinding(String protocolId/*, T protocol*/) { | ||
this.protocolId = protocolId; | ||
} | ||
|
||
// public T dialPeer(Host us, PeerId peer, AddressBook addrs) { | ||
// Multiaddr[] addr = addrs.get(peer) | ||
// .join().stream() | ||
// .filter(address -> !address.toString().contains("/ws") && !address.toString().contains("/wss")) | ||
// .toList() | ||
// .toArray(new Multiaddr[0]); | ||
// if (addr.length == 0) | ||
// throw new IllegalStateException("No addresses known for peer " + peer); | ||
// | ||
// return dial(us, peer, addr).getController().join(); | ||
// } | ||
} |
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
Oops, something went wrong.