-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: implemented /mempool * feat: implemented /mempool * feat: removed unused mapper * chore: added snapshot version of yaci-store * chore: added snapshot version of yaci-store * refactor according to github comments * refactor according to github comments * chore: changed snapshot, activated parallel processing for yaci-store * chore: adding configurability for socket and node db * chore: db path configurable * chore: adjusted path for node syncing * doc: added doc for restoring a snapshot * chore: added configs and adjusted env files * added configs * chore: yaci version back to rc1 and added volume to docker-compose * Changed mempool configurability to spring profiles. * chore: changed error code of exception to avoid overlaps
- Loading branch information
Showing
44 changed files
with
16,467 additions
and
15,022 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
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,46 @@ | ||
LOG=INFO | ||
NETWORK=mainnet | ||
PROTOCOL_MAGIC=764824073 | ||
|
||
#common env | ||
DB_ADMIN_USER_NAME="rosetta_db_admin" | ||
DB_ADMIN_USER_SECRET="weakpwd#123_d" | ||
|
||
DB_IMAGE_NAME="postgres" | ||
DB_IMAGE_TAG="latest" | ||
DB_NAME="rosetta-java-preprod" | ||
DB_HOST="db" # Service name in docker-compose or local db | ||
DB_PORT="5433" | ||
DB_SCHEMA=${NETWORK} | ||
DB_PATH="./data" | ||
|
||
MAXIMUM_POOL_SIZE=80 | ||
JDBC_BATCH_SIZE=1000 | ||
SCHEMA=${NETWORK} | ||
CARDANO_NODE_HOST="cardano-node" | ||
CARDANO_NODE_PORT=3002 | ||
CARDANO_NODE_VERSION="8.9.0" | ||
NODE_SUBMIT_API_PORT=8090 | ||
CARDANO_NODE_SOCKET="./nodeMN" | ||
CARDANO_NODE_DB="./nodeMN/db" | ||
CARDANO_CONFIG="./config/${NETWORK}" | ||
|
||
#api env | ||
API_SPRING_PROFILES_ACTIVE_API="dev" | ||
API_EXPOSED_PORT="8088" | ||
API_BIND_PORT="8088" | ||
TRANSACTION_TTL=3000 | ||
|
||
DB_CONNECTION_PARAMS_PROVIDER_TYPE="ENVIRONMENT" | ||
DB_DRIVER_CLASS_NAME="org.postgresql.Driver" | ||
|
||
ROSETTA_VERSION=1.4.13 | ||
TOPOLOGY_FILEPATH=/config/${NETWORK}/topology.json | ||
GENESIS_SHELLEY_PATH=/config/${NETWORK}/shelley-genesis.json | ||
GENESIS_BYRON_PATH=/config/${NETWORK}/byron-genesis.json | ||
API_NODE_SOCKET_PATH=./node/node.socket | ||
PRINT_EXCEPTION=true | ||
|
||
#api env | ||
API_SPRING_PROFILES_ACTIVE_YACI_INDEXER="postgres" # node profiles: devkit || database profiles: h2, postgres | ||
INDEXER_NODE_PORT=3002 |
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
37 changes: 37 additions & 0 deletions
37
...n/java/org/cardanofoundation/rosetta/api/mempool/controller/MempoolApiImplementation.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.cardanofoundation.rosetta.api.mempool.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.apache.commons.lang3.NotImplementedException; | ||
import org.cardanofoundation.rosetta.api.mempool.service.MempoolService; | ||
import org.openapitools.client.api.MempoolApi; | ||
import org.openapitools.client.model.MempoolResponse; | ||
import org.openapitools.client.model.MempoolTransactionRequest; | ||
import org.openapitools.client.model.MempoolTransactionResponse; | ||
import org.openapitools.client.model.NetworkRequest; | ||
import org.openapitools.client.model.TransactionIdentifier; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@Profile("mempool") | ||
public class MempoolApiImplementation implements MempoolApi { | ||
|
||
private final MempoolService mempoolService; | ||
|
||
@Override | ||
public ResponseEntity<MempoolResponse> mempool(NetworkRequest networkRequest) { | ||
MempoolResponse mempoolResponse = MempoolResponse.builder() | ||
.transactionIdentifiers(mempoolService.getCurrentTransactionIdentifiers(networkRequest.getNetworkIdentifier().getNetwork())) | ||
.build(); | ||
return ResponseEntity.ok(mempoolResponse); | ||
} | ||
|
||
@Override | ||
public ResponseEntity<MempoolTransactionResponse> mempoolTransaction( | ||
MempoolTransactionRequest mempoolTransactionRequest) { | ||
throw new NotImplementedException("Not implemented yet"); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
api/src/main/java/org/cardanofoundation/rosetta/api/mempool/service/MempoolService.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.cardanofoundation.rosetta.api.mempool.service; | ||
|
||
import java.util.List; | ||
import org.openapitools.client.model.Transaction; | ||
import org.openapitools.client.model.TransactionIdentifier; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Profile("mempool") | ||
public interface MempoolService { | ||
|
||
List<TransactionIdentifier> getCurrentTransactionIdentifiers(String network); | ||
} |
Oops, something went wrong.