Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/MIDAZ-501 #503

Merged
merged 45 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cd1bc6b
feature: add new table balance for perfomance poc;
MartinezAvellan Feb 3, 2025
e23a9ab
fix: add insert values on table; :bug:
MartinezAvellan Feb 4, 2025
e952a37
fix: add column that accepts account to be negative; :bug:
MartinezAvellan Feb 4, 2025
8d06d22
fix: remove extension; add index; :bug:
MartinezAvellan Feb 4, 2025
e89d870
feature: create balance sql implements;
MartinezAvellan Feb 4, 2025
23f0e16
fix: tables accounts and balance; :bug:
MartinezAvellan Feb 4, 2025
b86d541
fix: adjust accounts removing old fields and reorganizing it; :bug:
MartinezAvellan Feb 5, 2025
ef34a89
fix: update asset to remove old fields on create external account; :bug:
MartinezAvellan Feb 5, 2025
ace0f85
refactor: rename transaction operations queue/exchange/key to transac…
MartinezAvellan Feb 5, 2025
e1265df
refactor: rename transaction operations queue/exchange/key to transac…
MartinezAvellan Feb 5, 2025
aeedcf9
feat: add on asset and account when creation account to send to the t…
MartinezAvellan Feb 5, 2025
7bc5f5e
fix: remove portfolio routes and funcs on account that was deprecated…
MartinezAvellan Feb 5, 2025
a7e547a
refactor: change account id to return uuid; change name of variable o…
MartinezAvellan Feb 5, 2025
6a3b41c
feat: create structure to receive account from rabbitmq and create ba…
MartinezAvellan Feb 5, 2025
f6b36ab
fix: add two index one by alias e another by account_id; :bug:
MartinezAvellan Feb 5, 2025
7e91f64
fix: remove grpc accounts from ledger; :bug:
MartinezAvellan Feb 5, 2025
dfb0a57
fix: remove old references from accounts; :bug:
MartinezAvellan Feb 5, 2025
b3d0b56
fix: remove protobuf door on ledger; :bug:
MartinezAvellan Feb 5, 2025
2224904
fix: reusable protobuf door on transaction and transaction door on au…
MartinezAvellan Feb 5, 2025
1ccefc5
fix: remove protobuf reference on ledger; :bug:
MartinezAvellan Feb 5, 2025
5742f1b
refactor: change transaction to use account on ledger to use balance …
MartinezAvellan Feb 6, 2025
2da9f63
refactor: change portfolio_id for balance_id; remove apis get by port…
MartinezAvellan Feb 6, 2025
1264569
refactor: change X-Midaz-Id for X-Request-Id; :hammer:
MartinezAvellan Feb 6, 2025
263cae3
fix: midazId name; :bug:
MartinezAvellan Feb 6, 2025
4cba531
refactor: change all int and float64 to int64; :hammer:
MartinezAvellan Feb 6, 2025
7dcf25d
refactor: add get account and lock, sub or add on redis using lua scr…
MartinezAvellan Feb 7, 2025
3f1eefd
refactor: adjust redis return error 0018 to ErrInsufficientFunds; :ha…
MartinezAvellan Feb 7, 2025
587f362
feat: update balance async; rename validate accounts to validate bala…
MartinezAvellan Feb 7, 2025
63d084d
feat: add trace on casdoor; :sparkles:
MartinezAvellan Feb 7, 2025
2d1fbce
fix: revert telemetry; :bug:
MartinezAvellan Feb 7, 2025
697b8fa
refactor: add gopsutil to get mem and cpu usage instead of get from c…
MartinezAvellan Feb 8, 2025
2bba68d
fix: remove old locks rules; :bug:
MartinezAvellan Feb 8, 2025
4e69e5f
refactor: change get mem and cpu to start and run async after http ca…
MartinezAvellan Feb 8, 2025
9fa10f2
refactor: change update balance name for select for update; :hammer:
MartinezAvellan Feb 8, 2025
3eacf02
fix: make sec and make lint; :bug:
MartinezAvellan Feb 8, 2025
6bddbea
fix: adjust go test after change asset and account; :bug: :bug:
MartinezAvellan Feb 10, 2025
90b7965
refactor: adjust mdz cli to remove portfolio id and other fileds in a…
MartinezAvellan Feb 10, 2025
e3c17a2
fix: update dockerfile port; :bug:
MartinezAvellan Feb 10, 2025
a70cfd4
fature: generate openapi and swagger; use linux distroless image again;
MartinezAvellan Feb 10, 2025
41260c9
fix: update ports docker; :bug:
MartinezAvellan Feb 10, 2025
5fe3156
fix: update description log oeprations to operations; :bug:
MartinezAvellan Feb 10, 2025
1074626
fix: add log to catch erros when cannot marshal result var; :bug:
MartinezAvellan Feb 10, 2025
d201dec
fix: add validation to avoid ambiguous account on source and distribu…
MartinezAvellan Feb 10, 2025
1c52e66
fix: add rule to only lock balances on redis if has more than one bal…
MartinezAvellan Feb 10, 2025
db49250
Merge branch 'develop' into feature/MIDAZ-501
MartinezAvellan Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/audit/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# APP
VERSION=v1.47.0
SERVER_PORT=3005
SERVER_PORT=3002
SERVER_ADDRESS=:${SERVER_PORT}

# LOG LEVEL
Expand Down
13 changes: 2 additions & 11 deletions components/audit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/audit/cmd/app/main.go

FROM alpine:latest

ARG USER=midaz
RUN apk add --update sudo

RUN adduser -D $USER \
&& echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER \
&& chmod 0440 /etc/sudoers.d/$USER

USER $USER
FROM gcr.io/distroless/static-debian12

COPY --from=builder /app /app

EXPOSE 3005
EXPOSE 3002

ENTRYPOINT ["/app"]
10 changes: 5 additions & 5 deletions components/infra/rabbitmq/etc/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"durable": true
},
{
"name": "transaction_operations_queue",
"name": "transaction_balance_queue",
"vhost": "/",
"durable": true
},
Expand All @@ -85,7 +85,7 @@
"durable": true
},
{
"name": "transaction_operations_exchange",
"name": "transaction_balance_exchange",
"vhost": "/",
"type": "direct",
"durable": true
Expand All @@ -106,11 +106,11 @@
"routing_key": "audit_key"
},
{
"source": "transaction_operations_exchange",
"source": "transaction_balance_exchange",
"vhost": "/",
"destination": "transaction_operations_queue",
"destination": "transaction_balance_queue",
"destination_type": "queue",
"routing_key": "transaction_operations_key"
"routing_key": "transaction_balance_key"
},
{
"source": "ledger_accounts_exchange",
Expand Down
10 changes: 2 additions & 8 deletions components/ledger/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ VERSION=v1.47.0
SERVER_PORT=3000
SERVER_ADDRESS=:${SERVER_PORT}

# PROTOBUF
PROTO_URL=localhost
PROTO_PORT=3001
PROTO_ADDRESS=:${PROTO_PORT}

# DB POSTGRESQL PRIMARY AND REPLICA
DB_HOST=midaz-postgres-primary
DB_USER=midaz
Expand Down Expand Up @@ -69,11 +64,10 @@ RABBITMQ_PORT_HOST=3003
RABBITMQ_PORT_AMPQ=3004
RABBITMQ_DEFAULT_USER=ledger
RABBITMQ_DEFAULT_PASS=lerian
RABBITMQ_EXCHANGE=transaction_operations_exchange
RABBITMQ_KEY=transaction_operations_key
RABBITMQ_EXCHANGE=transaction_balance_exchange
RABBITMQ_KEY=transaction_balance_key
RABBITMQ_QUEUE=ledger_accounts_queue


# SWAGGER
SWAGGER_TITLE=Ledger API
SWAGGER_DESCRIPTION=Documentation for the Midaz Ledger API
Expand Down
13 changes: 2 additions & 11 deletions components/ledger/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,13 @@ COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/ledger/cmd/app/main.go

FROM alpine:latest

ARG USER=midaz
RUN apk add --update sudo

RUN adduser -D $USER \
&& echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER \
&& chmod 0440 /etc/sudoers.d/$USER

USER $USER
FROM gcr.io/distroless/static-debian12

COPY --from=builder /app /app

# Copy the migrations directory.
COPY --from=builder /ledger-app/components/ledger/migrations /components/ledger/migrations

EXPOSE 3000 3001
EXPOSE 3000

ENTRYPOINT ["/app"]
4 changes: 0 additions & 4 deletions components/ledger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ ps:
@$(DOCKER_CMD) -f docker-compose.yml ps

# App Commands
.PHONY: grpc-ledger-gen
grpc-ledger-gen:
@protoc --proto_path=../../pkg/mgrpc --go-grpc_out=../../pkg/mgrpc --go_out=../../pkg/mgrpc ../../pkg/mgrpc/account/account.proto

.PHONY: run
run:
@go run cmd/app/main.go .env
Expand Down
Loading
Loading