diff --git a/Dockerfile b/Dockerfile index 8d7ef47..ead2356 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM node:lts-alpine +FROM node:19.4-alpine +RUN apk add g++ make py3-pip # Create app directory WORKDIR /usr/src/app @@ -12,4 +13,4 @@ RUN npm ci ENV NPM_CONFIG_PREFIX=/home/node/.npm-global ENV PATH=$PATH:/home/node/.npm-global/bin -CMD [ "npm", "run", "start:dev" ] +CMD [ "npm", "run", "start:dev" ] \ No newline at end of file diff --git a/scripts/ecr_upload_image.sh b/scripts/ecr_upload_image.sh new file mode 100755 index 0000000..b39ff30 --- /dev/null +++ b/scripts/ecr_upload_image.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e +set -o pipefail + +aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ECR_REGISTRY_URI + +# AWS_ECR_REPOSITORY_NAME + +latest_commit=$(git rev-parse HEAD) + +# Get the current branch name (optional) +current_branch=$(git rev-parse --abbrev-ref HEAD) + +# Generate the Docker image tag by combining the version and the latest commit hash +image_tag="${AWS_ECR_REPOSITORY_NAME}:${current_branch}-${latest_commit}" + +sudo docker build --no-cache -t $image_tag . + +image_uri="${AWS_ECR_REGISTRY_URI}/${image_tag}" + +sudo docker tag $image_tag $image_uri + +sudo docker push $image_uri + +echo $image_uri diff --git a/src/bank/bank.service.ts b/src/bank/bank.service.ts index 717daef..57fa1f5 100644 --- a/src/bank/bank.service.ts +++ b/src/bank/bank.service.ts @@ -29,9 +29,7 @@ export class BankService { public async total(height?: number): Promise { try { const apikey = process.env.API_KEY - const [total] = await this.lcdService.bank.total({ height, 'x-apikey': apikey }) - return Coin.fromTerraCoins(total) } catch (err) { this.logger.error({ err }, 'Error getting the total supply of tokens in circulation for all denominations.') diff --git a/src/gov/gov.resolver.ts b/src/gov/gov.resolver.ts index 3486fe6..4f961d5 100644 --- a/src/gov/gov.resolver.ts +++ b/src/gov/gov.resolver.ts @@ -26,7 +26,7 @@ export class GovResolver { @ResolveField(() => String) public async proposer(@Args() args: GetGovArgs): Promise { - return this.govService.proposer(args.proposalId, args.height) + return this.govService.proposer(args.proposalId) } @ResolveField(() => [MsgDeposit]) diff --git a/src/gov/gov.service.ts b/src/gov/gov.service.ts index 262cd6c..74c9203 100644 --- a/src/gov/gov.service.ts +++ b/src/gov/gov.service.ts @@ -73,7 +73,7 @@ export class GovService { } } - public async proposer(proposalId: number, height?: number): Promise { + public async proposer(proposalId: number): Promise { try { return this.lcdService.gov.proposer(proposalId) } catch (err) { diff --git a/src/tendermint/tendermint.service.ts b/src/tendermint/tendermint.service.ts index 03cf8a8..1c4d759 100644 --- a/src/tendermint/tendermint.service.ts +++ b/src/tendermint/tendermint.service.ts @@ -18,7 +18,7 @@ export class TendermintService { public async nodeInfo(height?: number): Promise { try { const apikey = process.env.API_KEY - const data = (await this.lcdService.tendermint.nodeInfo({ height, 'x-apikey': apikey})) as any + const data = (await this.lcdService.tendermint.nodeInfo({ height, 'x-apikey': apikey })) as any return { id: data.default_node_info.default_node_id, @@ -67,7 +67,7 @@ export class TendermintService { public async validatorSet(height?: number): Promise { try { const apikey = process.env.API_KEY - const [validators] = await this.lcdService.tendermint.validatorSet(height, {'x-apikey': apikey}) + const [validators] = await this.lcdService.tendermint.validatorSet(height, { 'x-apikey': apikey }) return { validators: validators.map((validator) => ({ @@ -87,7 +87,7 @@ export class TendermintService { public async blockInfo(height?: number): Promise { try { const apikey = process.env.API_KEY - const info = await this.lcdService.tendermint.blockInfo(height, {'x-apikey': apikey}) + const info = await this.lcdService.tendermint.blockInfo(height, { 'x-apikey': apikey }) info.block.last_commit.signatures.forEach((s) => { // terra.js should be fixed to return number diff --git a/src/utils/utils.service.ts b/src/utils/utils.service.ts index 232be14..6ab06c7 100644 --- a/src/utils/utils.service.ts +++ b/src/utils/utils.service.ts @@ -18,7 +18,6 @@ export class UtilsService { const { denom, amount } = coin try { - const tax = await this.lcdService.utils.calculateTax(new TerraCoin(denom, amount)) return Coin.fromTerraCoin(tax)