Closed taijusanagi closed 3 years ago
This is code first development, so actual development may differ.
only below endpoint is enough for the first development
All structure is described here https://github.com/chocomintapp/chocoserver/issues/1#issuecomment-821920631
Chocoserver manage blockchain event and metadata
I need to organize this
network -> block -> transactions -> logs network -> contract
contract and logs are one to many
actually, required query is just contract, then contract returns all log, and log is just analyzed, that's enough
rename log to event, so that not confusing with logging
Basically using graphQL and have REST wrapper is better
Guide for graphQL
No repository for "Block" was found. Looks like this entity is not registered in current "default" connection? +33ms
nest start and ts-node difference https://stackoverflow.com/questions/45989574/repositorynotfounderror-typeorm/49113172
loading entity for ts-node and nest start is bit different so need to organize it again.
This tutorial says maybe only env value is ok for the migration generation https://blog.theodo.com/2019/05/an-overview-of-nestjs-typeorm-release-your-first-application-in-less-than-30-minutes/
this issue is saying only env is fine https://github.com/typeorm/typeorm/issues/490
But I'm using nestjs/config module pattern, so need to find other way
generating ormconfg.json using env config generate migration and actual migration is done by ormconfig.json nest start is using env config and ts ts-node start
https://docs.nestjs.com/techniques/database
Alternatively, rather than passing a configuration object to forRoot(), we can create an ormconfig.json file in the project root directory.
Ormconfig is only required for the forRoot
I have this provider pattern, but it may not required, just have 1 config is better to manage https://github.com/chocomintapp/chocoserver/blob/a8a781c835baaa0c62b41790a1a9c2ce00730035/src/providers/database/postgres/provider.module.ts
It is better to copy the snapshot in issue to keep tracking
I follow this and config to singleton, without nestjs https://medium.com/@gausmann.simon/nestjs-typeorm-and-postgresql-full-example-development-and-project-setup-working-with-database-c1a2b1b11b8f
How to access relationship ID from Parent's joined field in NestJS/TypeORM https://stackoverflow.com/questions/54163467/how-to-access-relationship-id-from-parents-joined-field-in-nestjs-typeorm
use gRPC for microservice connection and graphql for frontend