This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
25 changed files
with
593 additions
and
54 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
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
19 changes: 19 additions & 0 deletions
19
common-kafka/src/test/kotlin/fund/cyber/common/kafka/BrokerUtils.kt
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,19 @@ | ||
package fund.cyber.common.kafka | ||
|
||
import org.apache.kafka.clients.admin.AdminClient | ||
import org.apache.kafka.clients.admin.Config | ||
import org.apache.kafka.clients.consumer.ConsumerConfig | ||
import org.apache.kafka.common.config.ConfigResource | ||
import org.apache.kafka.common.config.ConfigResource.Type.TOPIC | ||
import java.util.* | ||
|
||
|
||
fun AdminClient.getTopicConfig(topic: String): Config? { | ||
val topicResource = ConfigResource(TOPIC, topic) | ||
val configs = this.describeConfigs(listOf(topicResource)) | ||
return configs.all().get()[topicResource] | ||
} | ||
|
||
fun adminClientProperties(kafkaBrokers: String) = Properties().apply { | ||
put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaBrokers) | ||
} |
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
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
14 changes: 14 additions & 0 deletions
14
common/src/main/kotlin/fund/cyber/search/model/ethereum/Supply.kt
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 fund.cyber.search.model.ethereum | ||
|
||
import java.math.BigDecimal | ||
|
||
|
||
data class EthereumSupply( | ||
val blockNumber: Long, | ||
val uncleNumber: Long, | ||
val totalSupply: BigDecimal, | ||
val genesisSupply: BigDecimal, | ||
val miningBlocksSupply: BigDecimal, | ||
val miningUnclesSupply: BigDecimal, | ||
val includingUnclesSupply: BigDecimal | ||
) |
7 changes: 7 additions & 0 deletions
7
common/src/main/kotlin/fund/cyber/search/model/events/Topics.kt
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,8 +1,15 @@ | ||
package fund.cyber.search.model.events | ||
|
||
import fund.cyber.search.model.chains.Chain | ||
import fund.cyber.search.model.chains.ChainInfo | ||
|
||
|
||
val Chain.txPumpTopic: String get() = name + "_TX_PUMP" | ||
val Chain.blockPumpTopic: String get() = name + "_BLOCK_PUMP" | ||
val Chain.unclePumpTopic: String get() = name + "_UNCLE_PUMP" | ||
|
||
|
||
val ChainInfo.txPumpTopic: String get() = fullName + "_TX_PUMP" | ||
val ChainInfo.blockPumpTopic: String get() = fullName + "_BLOCK_PUMP" | ||
val ChainInfo.unclePumpTopic: String get() = fullName + "_UNCLE_PUMP" | ||
val ChainInfo.supplyTopic: String get() = fullName + "_SUPPLY" |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Build and Run locally | ||
```bash | ||
docker build -t build/raw-api -f ./docs/Dockerfile ./ && docker run -p 8080:8080 build/raw-api | ||
docker build -t build/raw-api -f ./docs/api/Dockerfile ./ && docker run -p 8080:8080 build/raw-api | ||
``` |
Oops, something went wrong.