FinanceChain offers a powerful financial API built with Elixir and Phoenix, expertly utilizing blockchain technology and OTP principles for fault tolerance and high concurrency. Designed for reliability and data integrity, it supports core banking operations like deposits, withdrawals, and transfers while ensuring each account functions independently, maximizing performance.
FinanceChain is a powerful financial API crafted using Elixir and Phoenix, designed with a focus on blockchain principles and the Open Telecom Platform (OTP). This architecture allows for exceptional concurrency and fault tolerance, making it suitable for various banking operations.

The primary goal of FinanceChain is to deliver a reliable API that can seamlessly handle essential banking tasks such as deposits, withdrawals, and transfers. This project tackles the inherent challenges of managing financial accounts with high levels of concurrency, reliability, and data integrity.
By implementing a system that treats each account as an independent, concurrent process (a GenServer), FinanceChain encapsulates its own mini-blockchain. This design facilitates parallel account operations while leveraging OTP's supervisory capabilities for fault tolerance.
FinanceChain is grounded in the following principles:
FinanceChain.BlockChain.AccountServer GenServer, enabling concurrent operations without contention.AccountServer maintains a dedicated blockchain, streamlining state management and localizing transaction history.account_ids to their corresponding AccountServer process IDs (PIDs) for quick lookup and communication.FinanceChain comprises several essential modules:
Registry and DynamicSupervisor for accounts.GenServer managing the blockchain for individual accounts and maintaining transaction history.FinanceChain exposes several endpoints:
Reset System State POST /reset
200 OKGet Account Balance GET /balance?account_id={id}
200 OK with the balance.Deposit Funds POST /event (type: deposit)
201 Created with the updated balance.Withdraw Funds POST /event (type: withdraw)
201 Created with updated balance on success.Transfer Funds POST /event (type: transfer)
201 Created with updated balances for both accounts.To enhance production readiness, several improvements are suggested:
No comments yet.
Sign in to be the first to comment.