Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
napalmpapalam committed Dec 1, 2023
1 parent 98aad8c commit 4b8c516
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 111 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].

## [1.1.1] - 2023-12-01
### Fixed
- Docker Compose compatibility

## [1.1.0] - 2023-12-01
### Added
- Local build CI
Expand Down Expand Up @@ -64,7 +68,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

- Initiated project

[Unreleased]: https://gitlab.com/rarimo/scan/compare/1.1.0...HEAD
[Unreleased]: https://gitlab.com/rarimo/scan/compare/1.1.1...HEAD
[1.1.1]: https://gitlab.com/rarimo/scan/compare/1.1.0...1.1.1
[1.1.0]: https://gitlab.com/rarimo/scan/compare/1.0.9...1.1.0
[1.0.9]: https://gitlab.com/rarimo/scan/compare/1.0.8...1.0.9
[1.0.8]: https://gitlab.com/rarimo/scan/compare/1.0.7...1.0.8
Expand Down
18 changes: 8 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@ FROM node:18-alpine AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY . ./

RUN npm install --legacy-peer-deps && npm run build --legacy-peer-deps
COPY package.json yarn.lock ./

RUN npm install --legacy-peer-deps
COPY . ./
RUN npm run build --legacy-peer-deps

# Production image, copy all the files and run next
FROM node:18-alpine AS runner
WORKDIR /app

ENV NODE_ENV production

RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder /app/package.json ./package.json
COPY .env .

USER nextjs

EXPOSE 8000

ENV PORT 8000

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
ENV NEXT_TELEMETRY_DISABLED 1

CMD ["node_modules/.bin/next", "start"]
CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone',
eslint: {
ignoreDuringBuilds: true,
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scan",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"gitHooks": {
"pre-commit": "yarn lint",
Expand Down
8 changes: 4 additions & 4 deletions src/callers/block.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CONFIG } from '@/config'
import {
apolloClient,
BlockFragment,
BlockListFragment,
getApollo,
GetBlockByHeight,
GetBlockByHeightQuery,
GetBlockCount,
Expand Down Expand Up @@ -30,7 +30,7 @@ export const getBlocksList = async ({
limit?: number
offset?: number
}): Promise<BlockListFragment[]> => {
const { data } = await apolloClient.query<GetBlockListQuery>({
const { data } = await getApollo().query<GetBlockListQuery>({
query: GetBlockList,
fetchPolicy: 'network-only',
variables: { limit, offset, where: createWhereFilter(operator) },
Expand All @@ -39,7 +39,7 @@ export const getBlocksList = async ({
}

export const getBlockCount = async (args?: { operator?: string }): Promise<number> => {
const { data } = await apolloClient.query<GetBlockCountQuery>({
const { data } = await getApollo().query<GetBlockCountQuery>({
query: GetBlockCount,
fetchPolicy: 'network-only',
variables: { where: createWhereFilter(args?.operator) },
Expand All @@ -49,7 +49,7 @@ export const getBlockCount = async (args?: { operator?: string }): Promise<numbe
}

export const getBlockByHeight = async (height: number): Promise<BlockFragment> => {
const { data } = await apolloClient.query<GetBlockByHeightQuery>({
const { data } = await getApollo().query<GetBlockByHeightQuery>({
query: GetBlockByHeight,
fetchPolicy: 'network-only',
variables: { height: height },
Expand Down
8 changes: 4 additions & 4 deletions src/callers/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { TokenType } from '@rarimo/client'

import { CONFIG } from '@/config'
import {
apolloClient,
Collection_Bool_Exp,
CollectionBaseFragment,
CollectionFragment,
getApollo,
GetCollectionByIndex,
GetCollectionByIndexQuery,
GetCollectionCount,
Expand All @@ -27,7 +27,7 @@ export const getCollectionList = async (
offset = 0,
filters: TokenType[] = [],
): Promise<CollectionBaseFragment[]> => {
const { data } = await apolloClient.query<GetCollectionListQuery>({
const { data } = await getApollo().query<GetCollectionListQuery>({
query: GetCollectionList,
fetchPolicy: 'network-only',
variables: { limit, offset, where: createCollectionWhere(filters) },
Expand All @@ -37,7 +37,7 @@ export const getCollectionList = async (
}

export const getCollectionCount = async (filters: TokenType[] = []): Promise<number> => {
const { data } = await apolloClient.query<GetCollectionCountQuery>({
const { data } = await getApollo().query<GetCollectionCountQuery>({
query: GetCollectionCount,
fetchPolicy: 'network-only',
variables: { where: createCollectionWhere(filters) },
Expand All @@ -47,7 +47,7 @@ export const getCollectionCount = async (filters: TokenType[] = []): Promise<num
}

export const getCollectionByIndex = async (index: string): Promise<CollectionFragment> => {
const { data } = await apolloClient.query<GetCollectionByIndexQuery>({
const { data } = await getApollo().query<GetCollectionByIndexQuery>({
query: GetCollectionByIndex,
fetchPolicy: 'network-only',
variables: { index },
Expand Down
14 changes: 7 additions & 7 deletions src/callers/confirmation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CONFIG } from '@/config'
import {
apolloClient,
ConfirmationBaseFragment,
ConfirmationFragment,
getApollo,
GetConfirmationByRoot,
GetConfirmationByRootQuery,
GetConfirmationCount,
Expand Down Expand Up @@ -39,7 +39,7 @@ export const getConfirmationList = async (
limit: number = CONFIG.PAGE_LIMIT,
offset = 0,
): Promise<ConfirmationBaseFragment[]> => {
const { data } = await apolloClient.query<GetConfirmationListQuery>({
const { data } = await getApollo().query<GetConfirmationListQuery>({
query: GetConfirmationList,
fetchPolicy: 'network-only',
variables: { limit, offset },
Expand All @@ -49,7 +49,7 @@ export const getConfirmationList = async (
}

export const getConfirmationCount = async (): Promise<number> => {
const { data } = await apolloClient.query<GetConfirmationCountQuery>({
const { data } = await getApollo().query<GetConfirmationCountQuery>({
query: GetConfirmationCount,
fetchPolicy: 'network-only',
})
Expand All @@ -58,7 +58,7 @@ export const getConfirmationCount = async (): Promise<number> => {
}

export const getConfirmationByRoot = async (root: string): Promise<ConfirmationFragment> => {
const { data } = await apolloClient.query<GetConfirmationByRootQuery>({
const { data } = await getApollo().query<GetConfirmationByRootQuery>({
query: GetConfirmationByRoot,
fetchPolicy: 'network-only',
variables: { root },
Expand All @@ -76,7 +76,7 @@ export const getConfirmationOperationList = async ({
offset: number
indexes: string[]
}): Promise<OperationFragment[]> => {
const { data } = await apolloClient.query<GetConfirmationOperationListQuery>({
const { data } = await getApollo().query<GetConfirmationOperationListQuery>({
query: GetConfirmationOperationList,
fetchPolicy: 'network-only',
variables: { limit, offset, where: buildOperationWhere(indexes) },
Expand All @@ -94,7 +94,7 @@ export const getConfirmationOperationVotes = async ({
limit: number
offset: number
}): Promise<OperationVoteFragment[]> => {
const { data } = await apolloClient.query<GetConfirmationOperationVoteListQuery>({
const { data } = await getApollo().query<GetConfirmationOperationVoteListQuery>({
query: GetConfirmationOperationVoteList,
fetchPolicy: 'network-only',
variables: { where: buildVoteWhere(indexes), limit, offset },
Expand All @@ -104,7 +104,7 @@ export const getConfirmationOperationVotes = async ({
}

export const getConfirmationOperationVoteCount = async (operations: string[]): Promise<number> => {
const { data } = await apolloClient.query<GetConfirmationOperationVoteCountQuery>({
const { data } = await getApollo().query<GetConfirmationOperationVoteCountQuery>({
query: GetConfirmationOperationVoteCount,
fetchPolicy: 'network-only',
variables: { where: buildVoteWhere(operations) },
Expand Down
8 changes: 4 additions & 4 deletions src/callers/network.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CONFIG } from '@/config'
import {
apolloClient,
getApollo,
GetNetworkByName,
GetNetworkByNameQuery,
GetNetworkCount,
Expand All @@ -14,7 +14,7 @@ export const getNetworkList = async (
limit: number = CONFIG.PAGE_LIMIT,
offset = 0,
): Promise<NetworkFragment[]> => {
const { data } = await apolloClient.query<GetNetworkListQuery>({
const { data } = await getApollo().query<GetNetworkListQuery>({
query: GetNetworkList,
fetchPolicy: 'network-only',
variables: { limit, offset },
Expand All @@ -24,7 +24,7 @@ export const getNetworkList = async (
}

export const getNetworkCount = async (): Promise<number> => {
const { data } = await apolloClient.query<GetNetworkCountQuery>({
const { data } = await getApollo().query<GetNetworkCountQuery>({
query: GetNetworkCount,
fetchPolicy: 'network-only',
})
Expand All @@ -33,7 +33,7 @@ export const getNetworkCount = async (): Promise<number> => {
}

export const getNetworkByName = async (name: string): Promise<NetworkFragment> => {
const { data } = await apolloClient.query<GetNetworkByNameQuery>({
const { data } = await getApollo().query<GetNetworkByNameQuery>({
query: GetNetworkByName,
fetchPolicy: 'network-only',
variables: { name },
Expand Down
12 changes: 6 additions & 6 deletions src/callers/operation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CONFIG } from '@/config'
import {
apolloClient,
getApollo,
GetOperationByIndex,
GetOperationByIndexQuery,
GetOperationCount,
Expand All @@ -19,7 +19,7 @@ export const getOperationList = async (
limit: number = CONFIG.PAGE_LIMIT,
offset = 0,
): Promise<OperationFragment[]> => {
const { data } = await apolloClient.query<GetOperationListQuery>({
const { data } = await getApollo().query<GetOperationListQuery>({
query: GetOperationList,
fetchPolicy: 'network-only',
variables: { limit, offset },
Expand All @@ -29,7 +29,7 @@ export const getOperationList = async (
}

export const getOperationCount = async (): Promise<number> => {
const { data } = await apolloClient.query<GetOperationCountQuery>({
const { data } = await getApollo().query<GetOperationCountQuery>({
query: GetOperationCount,
fetchPolicy: 'network-only',
})
Expand All @@ -38,7 +38,7 @@ export const getOperationCount = async (): Promise<number> => {
}

export const getOperationByIndex = async (index: string): Promise<GetOperationByIndexQuery> => {
const { data } = await apolloClient.query<GetOperationByIndexQuery>({
const { data } = await getApollo().query<GetOperationByIndexQuery>({
query: GetOperationByIndex,
fetchPolicy: 'network-only',
variables: { index },
Expand All @@ -56,7 +56,7 @@ export const getOperationVotes = async ({
limit: number
offset: number
}): Promise<OperationVoteFragment[]> => {
const { data } = await apolloClient.query<GetOperationVoteListQuery>({
const { data } = await getApollo().query<GetOperationVoteListQuery>({
query: GetOperationVoteList,
fetchPolicy: 'network-only',
variables: { operation, limit, offset },
Expand All @@ -66,7 +66,7 @@ export const getOperationVotes = async ({
}

export const getOperationVoteCount = async (operation: string): Promise<number> => {
const { data } = await apolloClient.query<GetOperationVoteCountQuery>({
const { data } = await getApollo().query<GetOperationVoteCountQuery>({
query: GetOperationVoteCount,
fetchPolicy: 'network-only',
variables: { operation },
Expand Down
16 changes: 8 additions & 8 deletions src/callers/proposal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CONFIG } from '@/config'
import { apolloClient } from '@/graphql'
import { getApollo } from '@/graphql'
import {
GetProposalBase,
GetProposalBaseQuery,
Expand All @@ -25,7 +25,7 @@ export const getProposalList = async (
limit: number = CONFIG.PAGE_LIMIT,
offset = 0,
): Promise<ProposalBaseFragment[]> => {
const { data } = await apolloClient.query<GetProposalBaseQuery>({
const { data } = await getApollo().query<GetProposalBaseQuery>({
query: GetProposalBase,
fetchPolicy: 'network-only',
variables: { limit, offset },
Expand All @@ -35,7 +35,7 @@ export const getProposalList = async (
}

export const getProposalCount = async (): Promise<number> => {
const { data } = await apolloClient.query<GetProposalCountQuery>({
const { data } = await getApollo().query<GetProposalCountQuery>({
query: GetProposalCount,
fetchPolicy: 'network-only',
})
Expand All @@ -44,7 +44,7 @@ export const getProposalCount = async (): Promise<number> => {
}

export const getProposalByID = async (id: string): Promise<ProposalFragment> => {
const { data } = await apolloClient.query<GetProposalByIdQuery>({
const { data } = await getApollo().query<GetProposalByIdQuery>({
query: GetProposalById,
fetchPolicy: 'network-only',
variables: { id: Number(id) },
Expand All @@ -58,7 +58,7 @@ export const getProposalDepositsListByID = async (
limit: number = CONFIG.PAGE_LIMIT,
offset = 0,
): Promise<ProposalDepositFragment[]> => {
const { data } = await apolloClient.query<GetProposalDepositsByIdQuery>({
const { data } = await getApollo().query<GetProposalDepositsByIdQuery>({
query: GetProposalDepositsById,
fetchPolicy: 'network-only',
variables: { id: Number(id), limit, offset },
Expand All @@ -68,7 +68,7 @@ export const getProposalDepositsListByID = async (
}

export const getProposalDepositsCountByID = async (id: string): Promise<number> => {
const { data } = await apolloClient.query<GetProposalDepositsCountByIdQuery>({
const { data } = await getApollo().query<GetProposalDepositsCountByIdQuery>({
query: GetProposalDepositsCountById,
fetchPolicy: 'network-only',
variables: { id: Number(id) },
Expand All @@ -82,7 +82,7 @@ export const getProposalVotesListByID = async (
limit: number = CONFIG.PAGE_LIMIT,
offset = 0,
): Promise<ProposalVoteFragment[]> => {
const { data } = await apolloClient.query<GetProposalVotesByIdQuery>({
const { data } = await getApollo().query<GetProposalVotesByIdQuery>({
query: GetProposalVotesById,
fetchPolicy: 'network-only',
variables: { id: Number(id), limit, offset },
Expand All @@ -92,7 +92,7 @@ export const getProposalVotesListByID = async (
}

export const getProposalVotesCountByID = async (id: string): Promise<number> => {
const { data } = await apolloClient.query<GetProposalVotesCountByIdQuery>({
const { data } = await getApollo().query<GetProposalVotesCountByIdQuery>({
query: GetProposalVotesCountById,
fetchPolicy: 'network-only',
variables: { id: Number(id) },
Expand Down
Loading

0 comments on commit 4b8c516

Please sign in to comment.