Skip to content

Commit

Permalink
feat: change api default port to 3020 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters authored Sep 28, 2023
1 parent 65762fe commit 3d63a65
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ It will run local Ethereum node, ZkSync Era, Postgres DB and all Block Explorer

## 🔍 Verify Block Explorer is up and running

To verify front-end `App` is running open http://localhost:3010 in your browser. `API` should be available at http://localhost:3000. `Worker` - http://localhost:3001.
To verify front-end `App` is running open http://localhost:3010 in your browser. `API` should be available at http://localhost:3020. `Worker` - http://localhost:3001.

## 🕵️‍♂️ Testing
Run unit tests for all packages:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ services:
target: development-stage
command: npm run --prefix packages/api dev:debug
environment:
- PORT=3000
- PORT=3020
- METRICS_PORT=3005
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/block-explorer
ports:
- '3000:3000'
- '3020:3020'
- '3005:3005'
- '9231:9229'
- '9232:9230'
Expand Down
2 changes: 1 addition & 1 deletion packages/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DATABASE_CONNECTION_POOL_SIZE=50
DATABASE_CONNECTION_IDLE_TIMEOUT_MS=12000
METRICS_PORT=3005
COLLECT_DB_CONNECTION_POOL_METRICS_INTERVAL=10000
PORT=3000
PORT=3020
LOG_LEVEL=debug
LIMITED_PAGINATION_MAX_ITEMS=100000
DISABLE_API_SCHEMA_DOCS=false
Expand Down
2 changes: 1 addition & 1 deletion packages/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY --chown=node:node --from=build-stage /usr/src/app/packages/api/dist ./packa
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV

ARG PORT=3000
ARG PORT=3020
ENV PORT $PORT

ARG METRICS_PORT=3005
Expand Down
2 changes: 1 addition & 1 deletion packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $ npm run test:cov
```

## Docs
Locally Swagger docs are available at http://localhost:3000/docs. JSON version - http://localhost:3000/docs-json.
Locally Swagger docs are available at http://localhost:3020/docs. JSON version - http://localhost:3020/docs-json.

## Development

Expand Down
4 changes: 2 additions & 2 deletions packages/api/performance/addresspage.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config:
target: "http://127.0.0.1:3000"
target: "http://127.0.0.1:3020"
http:
timeout: 100
extendedMetrics: true
Expand All @@ -9,7 +9,7 @@ config:

environments:
local:
target: "http://localhost:3000"
target: "http://localhost:3020"
plugins:
metrics-by-endpoint:
useOnlyRequestNames: true
Expand Down
4 changes: 2 additions & 2 deletions packages/api/performance/homepage.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config:
target: "http://127.0.0.1:3000"
target: "http://127.0.0.1:3020"
http:
timeout: 100
extendedMetrics: true
Expand All @@ -9,7 +9,7 @@ config:

environments:
local:
target: "http://localhost:3000"
target: "http://localhost:3020"
plugins:
metrics-by-endpoint:
useOnlyRequestNames: true
Expand Down
4 changes: 2 additions & 2 deletions packages/api/performance/load-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config:
target: "http://127.0.0.1:3000"
target: "http://127.0.0.1:3020"
http:
timeout: 100
extendedMetrics: true
Expand All @@ -9,7 +9,7 @@ config:

environments:
local:
target: "http://localhost:3000"
target: "http://localhost:3020"
variables:
addresses:
- ["0x0000000000000000000000000000000000008001"]
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("config", () => {
it("sets default values", () => {
expect(config()).toEqual({
NODE_ENV: "test",
port: 3000,
port: 3020,
metrics: {
port: 3005,
collectDbConnectionPoolMetricsInterval: 10000,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default () => {

return {
NODE_ENV,
port: parseInt(PORT, 10) || 3000,
port: parseInt(PORT, 10) || 3020,
metrics: {
port: parseInt(METRICS_PORT, 10) || 3005,
collectDbConnectionPoolMetricsInterval: parseInt(COLLECT_DB_CONNECTION_POOL_METRICS_INTERVAL, 10) || 10000,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import type { EnvironmentConfig } from ".";
const config: EnvironmentConfig = {
networks: [
{
apiURLv2: "http://localhost:3000",
apiURLv2: "http://localhost:3020",
apiUrl: "https://zksync2-testnet-explorer.zksync.dev",
hostnames: ["localhost"],
icon: "/images/icons/zksync-arrows.svg",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/configs/local.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { EnvironmentConfig } from ".";
const config: EnvironmentConfig = {
networks: [
{
apiURLv2: "http://localhost:3000",
apiURLv2: "http://localhost:3020",
apiUrl: "https://zksync2-testnet-explorer.zksync.dev",
hostnames: ["localhost"],
icon: "/images/icons/zksync-arrows.svg",
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("config", () => {

it("sets default values", () => {
expect(config()).toEqual({
port: 3000,
port: 3001,
blockchain: {
rpcCallDefaultRetryTimeout: 30000,
rpcCallQuickRetryTimeout: 500,
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default () => {
} = process.env;

return {
port: parseInt(PORT, 10) || 3000,
port: parseInt(PORT, 10) || 3001,
blockchain: {
rpcUrl: BLOCKCHAIN_RPC_URL,
rpcCallDefaultRetryTimeout: parseInt(RPC_CALLS_DEFAULT_RETRY_TIMEOUT, 10) || 30000,
Expand Down

0 comments on commit 3d63a65

Please sign in to comment.