rwadurian/backend/services/blockchain-service
hailin d983525aa5 fix(wallet): resolve account creation and wallet status query issues
This commit fixes three critical bugs that prevented the wallet creation
flow from completing successfully:

1. mpc-service: extraPayload not included in Kafka messages
   - KeygenCompletedEvent's extraPayload (containing userId, accountSequence,
     username, derivedAddresses) was being set dynamically but not serialized
   - identity-service received events without userId and skipped processing
   - Fix: Merge extraPayload into the published payload in event-publisher

2. mpc-service: KAFKA_BROKERS hostname mismatch
   - mpc-service used KAFKA_BROKERS=rwa-kafka:29092
   - Kafka advertises itself as kafka:29092 in cluster metadata
   - During consumer group rebalance, mpc-service couldn't connect to
     the coordinator address returned by Kafka
   - Fix: Use kafka:29092 to match Kafka's advertised listener

3. blockchain-service: recovery_mnemonics table missing
   - RecoveryMnemonic model exists in schema.prisma but not in migration
   - prisma migrate deploy found no pending migrations
   - Address derivation failed with "table does not exist" error
   - Fix: Use prisma db push instead of migrate deploy to sync schema

Tested: E2E flow now completes successfully
- POST /user/auto-create creates account
- MPC keygen completes and publishes event with extraPayload
- blockchain-service derives addresses and saves recovery mnemonic
- GET /user/wallet returns status=ready with 3 addresses and mnemonic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 07:57:17 -08:00
..
.claude fix(mobile-app): update share link domain to rwaapi.szaiai.com 2025-12-06 21:15:55 -08:00
prisma refactor(mnemonic): move recovery_mnemonics to blockchain-service (DDD) 2025-12-08 00:54:25 -08:00
scripts feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00
src feat(mnemonic): propagate accountSequence through MPC keygen flow (DDD) 2025-12-08 01:08:27 -08:00
.dockerignore feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00
.env.example docs(config): update .env.example files for production deployment 2025-12-07 04:55:21 -08:00
.eslintrc.js feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00
.gitignore feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00
.prettierrc feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00
DEVELOPMENT_GUIDE.md docs: update blockchain-service guide with address derivation responsibilities 2025-12-06 20:02:50 -08:00
Dockerfile fix(wallet): resolve account creation and wallet status query issues 2025-12-08 07:57:17 -08:00
deploy.sh . 2025-12-07 00:40:19 -08:00
docker-compose.yml refactor: unify docker-compose configs to use shared infrastructure 2025-12-07 00:35:56 -08:00
nest-cli.json feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00
package-lock.json feat(blockchain-service): add Prisma migration for init schema 2025-12-07 08:23:14 -08:00
package.json fix(blockchain-service): install @scure/bip39 dependency 2025-12-07 00:25:27 -08:00
tsconfig.json feat(blockchain-service): implement complete blockchain service with DDD + Hexagonal architecture 2025-12-06 20:54:58 -08:00