Skip to content
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

Develop #27

Merged
merged 65 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9e57abc
Merge pull request #3 from ferrumnet/main
zikriya Jan 31, 2023
f960a59
redis host and port issue
AbdulAhadArain Feb 1, 2023
0e4f93d
Merge branch 'main' of https://github.com/AbdulAhadArain/multiswap-no…
AbdulAhadArain Feb 1, 2023
cd2aba3
Merge pull request #4 from AbdulAhadArain/develop
zikriya Feb 1, 2023
82d87b7
api createJobBySwapHash response have been modified
Feb 1, 2023
faa8c8f
Merge branch 'develop' of https://github.com/ferrumnet/multiswap-node…
Feb 1, 2023
400d572
Merge pull request #5 from zikriya/develop
zikriya Feb 1, 2023
ded4b24
dockerize app
Feb 2, 2023
53158a0
Merge pull request #6 from ferrumnet/dockerization
zikriya Feb 2, 2023
8c1ae9e
api updateTransactionJobStatus request body modified with transaction…
Feb 3, 2023
6d6a7b7
Merge pull request #7 from zikriya/develop
zikriya Feb 3, 2023
ef0880d
signature creation
AbdulAhadArain Feb 17, 2023
e549575
confict resolved
AbdulAhadArain Feb 17, 2023
a0c03ce
Merge pull request #8 from AbdulAhadArain/develop
zikriya Feb 17, 2023
bbab91b
source chainId fixed
AbdulAhadArain Feb 27, 2023
6e3df27
Merge pull request #9 from AbdulAhadArain/develop
zikriya Feb 27, 2023
c808986
ci/cd test
AbdulAhadArain Feb 28, 2023
a66e53a
Merge pull request #10 from AbdulAhadArain/develop
zikriya Feb 28, 2023
0b022f0
createJobBySwapHash api response updated
Feb 28, 2023
8a44867
Merge pull request #11 from zikriya/develop
zikriya Feb 28, 2023
02abf55
updated code for event decode
AbdulAhadArain Mar 1, 2023
e22a0d6
event decoded using web3 js
AbdulAhadArain Mar 2, 2023
4f3c322
signature with event logs
AbdulAhadArain Mar 2, 2023
46860f9
Merge pull request #1 from AbdulAhadArain/feature/event-decode
AbdulAhadArain Mar 2, 2023
cf1bfc6
Merge branch 'develop' into develop
AbdulAhadArain Mar 2, 2023
eca6340
update the response data
AbdulAhadArain Mar 2, 2023
06beb33
Merge pull request #12 from AbdulAhadArain/develop
zikriya Mar 2, 2023
5f8a4e7
Remove ignored files cache
Mar 9, 2023
ca0d6eb
ethereumjs-util added to create the signature. Also contractAddress p…
Mar 9, 2023
a3cc116
Merge pull request #13 from zikriya/develop
zikriya Mar 9, 2023
7957120
getHealth api added to check health at loadbalancer. Also one bug fix…
Mar 14, 2023
b15b567
Merge pull request #14 from zikriya/develop
zikriya Mar 14, 2023
ac8d7ed
getTransactionReceipt called at on complete to get the latest reciept
Mar 14, 2023
f97a905
Merge pull request #15 from zikriya/develop
zikriya Mar 14, 2023
e774f0b
enable CI/CD
Mar 15, 2023
728216c
ECS CI/CD
Mar 15, 2023
b3725b9
change branch syntax
Mar 15, 2023
6e01eba
change workflow folder name
Mar 15, 2023
c314063
update ecs service
Mar 15, 2023
22603ac
test
Mar 15, 2023
4647952
update variable
Mar 15, 2023
ed9c24b
push images to ECR
Mar 15, 2023
7fa840d
Merge pull request #16 from sheraz-ferrum/develop
zikriya Mar 15, 2023
021c215
push images with latest label
Mar 17, 2023
17a7f2e
ecs deploy
Mar 17, 2023
8a3d43b
add build dependency
Mar 17, 2023
a460f23
Merge pull request #17 from sheraz-ferrum/develop
zikriya Mar 17, 2023
9abe9ca
Auth added in headers for gateway-backend api
Mar 21, 2023
4dbe197
Merge pull request #18 from ArslanKibria98/develop
zikriya Mar 21, 2023
ccdba6b
.env.example file updated
Mar 21, 2023
3f48a81
Merge pull request #19 from ArslanKibria98/develop
zikriya Mar 22, 2023
e66d5bc
signature for foundar asset
Mar 22, 2023
373b0fc
Merge pull request #20 from zikriya/develop
zikriya Mar 22, 2023
763dbb0
While creation of signature, sourceAmount is converted into destinati…
Mar 23, 2023
fe480bd
Merge pull request #21 from zikriya/develop
zikriya Mar 23, 2023
b8a1d4c
bug fixing while creating signature for refinary and ionic
Mar 23, 2023
9ed363c
Merge pull request #22 from zikriya/develop
zikriya Mar 23, 2023
268953c
Randmon key added as a backup for public key while creating authoriza…
Mar 24, 2023
2806ef6
Merge pull request #23 from zikriya/develop
zikriya Mar 24, 2023
abbfaf5
bridgeAmount added on body of job
Mar 24, 2023
753bfc6
Merge pull request #24 from zikriya/develop
zikriya Mar 24, 2023
3247bc0
update readme to view logs
Mar 28, 2023
4dd54da
Merge pull request #25 from sheraz-ferrum/develop
sheraz-ferrum Mar 28, 2023
2d6427b
update readme to view logs
Mar 28, 2023
697a3b6
Merge pull request #26 from sheraz-ferrum/develop
zikriya Mar 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
PORT=3000
MONGODB_URL=mongodb://127.0.0.1:27017/multiswap-node
QUEUE=Transaction
GATEWAY_BACKEND_URL=
GATEWAY_BACKEND_URL=https://api-leaderboard.dev.svcs.ferrumnetwork.io
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
PRIVATE_KEY=
PUBLIC_KEY=
69 changes: 69 additions & 0 deletions .github/workflows/deploy_dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Deploy to Amazon ECS

on:
push:
branches:
- develop

env:
AWS_REGION: us-east-2 # set this to your preferred AWS region, e.g. us-west-1
ECR_REPOSITORY: ferrum-dev-multiswap # set this to your Amazon ECR repository name
ECS_SERVICE: multiswap-node # set this to your Amazon ECS service name
ECS_CLUSTER: ferrum-dev-cluster # set this to your Amazon ECS cluster name
ECS_TASK_DEFINITION: multiswap-node # set this to the path to your Amazon ECS task definition
# file, e.g. .aws/task-definition.json
CONTAINER_NAME: multiswap-node # set this to the name of the container in the
# containerDefinitions section of your task definition

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: development

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest


deploy:
needs: build
name: Deploy
runs-on: ubuntu-latest
environment: development
steps:
- name: Deploy to ecs
id: deploy-image
env:
IMAGE_TAG: ${{ github.sha }}
run: |
docker run fabfuel/ecs-deploy:1.10.2 ecs deploy ${{ env.ECS_CLUSTER }} ${{ env.ECS_SERVICE }} --tag ${{ github.sha }} --region ${{ env.AWS_REGION }} --access-key-id ${{ secrets.AWS_ACCESS_KEY_ID }} --secret-access-key ${{ secrets.AWS_SECRET_ACCESS_KEY }}

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ yarn-error.log
!.env*.example

# Code coverage
coverage
coverage

# package lock
package-lock.json
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:18.12.1-alpine

WORKDIR /app

COPY . /app

RUN mv .env.example .env
RUN yarn install

EXPOSE 3000

CMD yarn dev
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Redis Version `v7.0.8`

Run the Redis Server in your machine by using `redis-server` command

Run this command `cp .env.example .env` to create .env file

Run `yarn` OR `yarn install` at the root of the repo

Run `yarn dev` to run Server
19 changes: 19 additions & 0 deletions devops/logs-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Install AWS CLI

https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions

# Configure SSO session

Use following document to configure your aws credentials via AWS SSO
https://docs.aws.amazon.com/cli/latest/userguide/sso-configure-profile-token.html


# View AWS service logs
aws logs tail --follow --region us-east-2 <log_group_name> --since <time>

example:
for past 5 minutes logs

aws logs tail --follow --region us-east-2 /ferrum/ecs/multiswap-node --since 5m


48 changes: 48 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: '3.8'
# networks:
# app-network:
# driver: bridge

services:
redis:
container_name: redis
image: 'redis:7.0.8'
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning
volumes:
- redis:/data
restart:
on-failure
# networks:
# - multiswap
expose:
- 6379
multiswap_app:
build:
context: ./
# target: development
container_name: multiswap_app
image: multiswap_app:latest
depends_on:
- redis
ports:
- 3000:3000
environment:
REDIS_HOST: redis
REDIS_PORT: 6379

links:
- redis
restart:
on-failure
# networks:
# - multiswap

# networks:
# multiswap:
# external:
# name: app
volumes:
redis:
driver: local
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@
},
"dependencies": {
"axios": "^1.2.6",
"big.js": "^6.2.1",
"bullmq": "^3.5.11",
"crypto-js": "^4.1.1",
"dotenv": "^16.0.3",
"ethereumjs-util": "^7.1.5",
"express": "^4.17.2",
"web3": "^1.8.1"
"web3": "^1.8.1",
"web3-utils": "^1.9.0"
}
}
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ app.use(express.json());
app.use(express.urlencoded({ extended: true }));

// v1 api routes
app.use('/', routes);
app.use('/api', routes);

// send back a 404 error for any unknown api request
app.use((req: Request, res: Response, next: NextFunction) => {
Expand Down
Loading