-
Notifications
You must be signed in to change notification settings - Fork 4
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
First version of backend #19
base: main
Are you sure you want to change the base?
Conversation
Added search service.
This pull request introduces 2 alerts when merging bc1d2d2 into 4d5d126 - view on LGTM.com new alerts:
|
- http://localhost:3000 - Garush Backend. | ||
- http://localhost:3001 - Garush Frontend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these ports used by Symbol nodes? Can't we have a Garush server and a Symbol node on the same machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are ports used for the local services while on development. On production, those services would have their own hostname and they will run on port 443 (HTTPS). Garush doesn't run any symbol node, it connects to them like any other app.
README.md
Outdated
The first time your run the services, you need to create the minio/s3 access key. | ||
|
||
Go to the Minio Console's user tab | ||
|
||
http://localhost:9001/users (`minioadmin:minioadmin`) | ||
|
||
And create a user with access and key `minioadmin1:minioadmin1`. These keys are the backend's default. | ||
|
||
Give this user all the permissions. TODO: Automatize the minio/s3 token for local development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first time your run the services, you need to create the minio/s3 access key. | |
Go to the Minio Console's user tab | |
http://localhost:9001/users (`minioadmin:minioadmin`) | |
And create a user with access and key `minioadmin1:minioadmin1`. These keys are the backend's default. | |
Give this user all the permissions. TODO: Automatize the minio/s3 token for local development | |
The first time you run the services, you need to create the minio/s3 access key: | |
- Go to the Minio Console's user tab: http://localhost:9001/users (`minioadmin:minioadmin`) | |
- Create a user with access and key `minioadmin1:minioadmin1`. These keys are the backend's default. | |
- Give this user all the permissions. TODO: Automatize the minio/s3 token for local development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
README.md
Outdated
- http://localhost:3000/art | ||
- http://localhost:3000/file | ||
|
||
The bullmq job would be populating the database and s3 bucket from the symbol and garush networks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bullmq job would be populating the database and s3 bucket from the symbol and garush networks. | |
The `bullmq` job will be populating the database and s3 bucket from the Symbol and Garush networks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work mate! Added a couple of small comments.
@Processor('garush') | ||
export class ArtJobService { | ||
constructor(@InjectQueue('garush') private queue: Queue, @Inject(ArtService) private readonly artService: ArtService) { | ||
queue.add('refresh_art', {}, { repeat: { every: 60000 } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be better to extract this to the configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basic extraction is done. We may want to extend the configuration so we can find grain the jobs, like every vs cron configuration, or add some custom job-specific param.
}); | ||
|
||
if (isObservable(artSubscriber)) { | ||
// I have hacked this with "rxjs": "file:../storage/node_modules/rxjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this compatibility issue still stands if it's the same rxjs version? It used to be a peer dependency in nestjs previously but not now I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storage -> rxjs 7.4.0 in their own node_modules
backend -> rxjs 7.4.0 in their own node_modules.
Both rxjs folders are different. When the backed tries to use an Observable created on storage, the rxjs on the backend raises an error thinking it's not observable. Basically this check fails
https://github.com/ReactiveX/rxjs/blob/master/src/internal/observable/innerFrom.ts#L16
raising
https://github.com/ReactiveX/rxjs/blob/master/src/internal/util/throwUnobservableError.ts#L8
This is not a version issue as everything is 7.4.0, but the instances are different. I think we should find a way that shared third part modules should be installed in a shared folder, I believe learn could fix that. Having said that, this seems to be a common problem, there should be npm solution for it.
@@ -0,0 +1,11 @@ | |||
export enum Network { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must have picked the name Network
so that it doesn't clash with SDK/NetworkType
, I guess. But it is not too clear that it's an enum by looking at the references. Should we find a different name like NFTNetworkType
or a better one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network is the identifier of a given network in the env, not its type. The garush solution uses 2 networks, the garush network (pre-sell) and the symbol network (after sold and resells). In my mind:
Dev env:
Garush = garush.dev -> testnet network type
Symbol = joeynet -> testnet network type
Prod env
Garush = a new garush network? -> testnet/mainnet? network type
Symbol = mainnet -> mainnet network type
You can notice that both dev networks use the same network type (with T prefixed addresses), Network
is not the same as network type.
We would have 2 running garush, a test env, and a prod env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I can see Network
and the SDK/NetworkType
are not the same, what I meant was the name Network
implies (to me) an object rather than an enum/identifier that's why I asked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any recommendation? should we go with NFTNetworkType?
This pull request introduces 1 alert when merging 06684a7 into 4d5d126 - view on LGTM.com new alerts:
|
Fix art refresh job. Some improvements Fixed unique index Improved logging
Includes first versions of:
rxjs 7.4.0 upgrade/ SDK upgrade
few storage improvements