Skip to content

Commit

Permalink
RA-87: API port changed;
Browse files Browse the repository at this point in the history
  • Loading branch information
mlinnik committed May 9, 2024
1 parent ade7ac3 commit e65ec08
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .env.IntegrationTest
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CARDANO_CONFIG=./config/${NETWORK}
API_DOCKER_IMAGE_TAG=main
API_SPRING_PROFILES_ACTIVE=dev
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
API_PORT=8081
API_PORT=8082
PRINT_EXCEPTION=true

ROSETTA_VERSION=1.4.13
Expand Down
4 changes: 2 additions & 2 deletions .env.docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DB_HOST=db
# Service name in docker-compose or local db
DB_PORT=5432
DB_SCHEMA=${NETWORK}
DB_PATH=data
DB_PATH=./data

## Cardano Node variables
CARDANO_NODE_HOST=cardano-node
Expand All @@ -36,7 +36,7 @@ CARDANO_CONFIG=./config/${NETWORK}
API_DOCKER_IMAGE_TAG=main
API_SPRING_PROFILES_ACTIVE=dev
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
API_PORT=8080
API_PORT=8082
PRINT_EXCEPTION=true

ROSETTA_VERSION=1.4.13
Expand Down
2 changes: 1 addition & 1 deletion .env.h2
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CARDANO_CONFIG=./config/${NETWORK}
API_DOCKER_IMAGE_TAG=main
API_SPRING_PROFILES_ACTIVE=h2
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
API_PORT=8080
API_PORT=8082
PRINT_EXCEPTION=true

ROSETTA_VERSION=1.4.13
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ settings.xml
.env*

/data/
/node/
/node-ipc/
/h2/
/logs/
/docker-compose-3rd.yaml
/testcontainers/node-ipc

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/config/application-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: ${API_PORT:8080}
port: ${API_PORT:8082}
compression:
enabled: true
mime-types: text/html,text/plain,text/css,application/javascript,application/json
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/config/application-h2.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: ${API_PORT:8080}
port: ${API_PORT:8082}
compression:
enabled: true
mime-types: text/html,text/plain,text/css,application/javascript,application/json
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/config/application-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: ${API_PORT:8080}
port: ${API_PORT:8082}
compression:
enabled: true
mime-types: text/html,text/plain,text/css,application/javascript,application/json
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/resources/application-test-integration.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: ${API_PORT:8080}
port: ${API_PORT:8082}
compression:
enabled: true
mime-types: text/html,text/plain,text/css,application/javascript,application/json
Expand Down
6 changes: 3 additions & 3 deletions docker-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ services:
environment:
- NETWORK=${NETWORK}
volumes:
- ${CARDANO_NODE_SOCKET_PATH}:/ipc
- ${CARDANO_NODE_SOCKET_PATH}:/node-ipc
- ${CARDANO_NODE_DB}:/data/db
- ${CARDANO_CONFIG}:/current
ports:
- ${CARDANO_NODE_PORT}:${CARDANO_NODE_PORT}
entrypoint: cardano-node run --port ${CARDANO_NODE_PORT} --config /current/config.json --topology /current/topology.json --database-path /data/db --socket-path /ipc/node.socket
- ${CARDANO_NODE_PORT}:8090
entrypoint: cardano-node run --database-path /data/db --host-addr 0.0.0.0 --port 8090 --socket-path /node-ipc/node.socket --topology /current/topology.json --config /current/config.json

cardano-submit-api:
image: ghcr.io/intersectmbo/cardano-submit-api:${CARDANO_NODE_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion docker/.env.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CARDANO_NODE_SOCKET=/node-ipc/node.socket
## Api env
API_SPRING_PROFILES_ACTIVE=dev
# staging, h2, test. Additional profiles: mempool (if mempool should be activated)
API_PORT=8080
API_PORT=8082

ROSETTA_VERSION=1.4.13
TOPOLOGY_FILEPATH=/current/topology.json
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ COPY --from=java-builder /root/app/yaci-indexer/target/*.jar /yaci-indexer/app.j
# Run
RUN mkdir /logs

EXPOSE 8081
EXPOSE 8082

COPY ./docker/entrypoint.sh /sbin/entrypoint.sh
ENTRYPOINT ["/sbin/entrypoint.sh"]
Expand Down
6 changes: 3 additions & 3 deletions docker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The build can take up to 1.5 hours.

### 2. Run
````
docker run --env-file .\docker\.env.dockerfile -p 8080:8080 -it {image_name}:latest
docker run --env-file .\docker\.env.dockerfile -p 8082:8082 -it {image_name}:latest
````
We need to specify the path to the environment variables file and open the port.

Expand Down Expand Up @@ -47,15 +47,15 @@ PG_VERSION=14

### 5. Volume with Cardano node data
````
docker run --env-file .\docker\.env.dockerfile -p 8080:8080 -v {custom_folder}:/data/db -it {image_name}:latest
docker run --env-file .\docker\.env.dockerfile -p 8082:8082 -v {custom_folder}:/data/db -it {image_name}:latest
````
It is possible to root the cardano node data volumetrically to the /data/db point.

We can mount a volume with Cardano node data to ``/data/db`` to prevent loading during initialization.

### 6. Volume with custom network configurations
````
docker run --env-file .\docker\.env.dockerfile -p 8080:8080 -v {custom_folder}:/config -it {image_name}:latest
docker run --env-file .\docker\.env.dockerfile -p 8082:8082 -v {custom_folder}:/config -it {image_name}:latest
````
The cardano node configuration json's are stored in the ``config`` folder and copied into the image on build.
If we want to use a custom configuration without rebuilding the image, we can mount a volume with configs to ``/config``
Expand Down
2 changes: 1 addition & 1 deletion docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Within root folder of the project there are example `.env` files, which can be c
| `CARDANO_NODE_DB` | Cardano node db path | /data/cardano-node/db |
| `CARDANO_CONFIG` | Cardano node config path | ./config/${NETWORK}/config |
| `API_SPRING_PROFILES_ACTIVE` | Api spring profile | dev |
| `API_PORT` | Rosetta api exposed port | 8080 |
| `API_PORT` | Rosetta api exposed port | 8082 |
| `ROSETTA_VERSION` | Rosetta version | 1.4.13 |
| `TOPOLOGY_FILEPATH` | Topology file path | ./config/${NETWORK}/topology.json |
| `GENESIS_SHELLEY_PATH` | Genesis file path | ./config/${NETWORK}/shelley-genesis.json |
Expand Down
2 changes: 1 addition & 1 deletion postmanTests/Rosetta-java-env.postman_environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"values": [
{
"key": "URL",
"value": "localhost:8080",
"value": "localhost:8082",
"type": "default",
"enabled": true
},
Expand Down
2 changes: 1 addition & 1 deletion rosetta-cli-tests/data/byron_sample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"online_url": "http://localhost:8080",
"online_url": "http://localhost:8082",
"data": {
"start_index": 0,
"end_conditions": {
Expand Down
2 changes: 1 addition & 1 deletion rosetta-cli-tests/data/preview_sample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"online_url": "http://localhost:8080",
"online_url": "http://localhost:8082",
"data": {
"start_index": 1,
"end_conditions": {
Expand Down
2 changes: 1 addition & 1 deletion rosetta-cli-tests/data/shelley_sample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"online_url": "http://localhost:8080",
"online_url": "http://localhost:8082",
"data": {
"start_index": 4603000,
"end_conditions": {
Expand Down
2 changes: 1 addition & 1 deletion rosetta-cli-tests/data/shelley_transition.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"online_url": "http://localhost:8080",
"online_url": "http://localhost:8082",
"data": {
"start_index": 4490000,
"end_conditions": {
Expand Down

0 comments on commit e65ec08

Please sign in to comment.