-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from sotatek-dev/develop
Develop
- Loading branch information
Showing
54 changed files
with
1,126 additions
and
721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,4 @@ postgresData | |
|
||
#Docker mounted volumes | ||
/dumpData/* | ||
.scannerwork/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
services: | ||
api: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run migration:run-dist && npm run start:prod;" | ||
tty: true | ||
restart: always | ||
ports: | ||
- ${PORT}:${PORT} | ||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
crawl-bridge-evm: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run console crawl-eth-bridge-contract" | ||
tty: true | ||
restart: always | ||
|
||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
sender-evm: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run console sender-eth-bridge-unlock" | ||
tty: true | ||
restart: always | ||
|
||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
crawl-bridge-mina: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run console crawl-mina-bridge-contract" | ||
tty: true | ||
restart: always | ||
|
||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
crawl-token-mina: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run console crawl-mina-token-contract" | ||
tty: true | ||
restart: always | ||
|
||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
sender-mina: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run console sender-mina-bridge-unlock" | ||
tty: true | ||
restart: always | ||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
get-price-token: | ||
image: mina-bridge:1.0.0 | ||
command: > | ||
sh -c "npm run console get-price-token" | ||
tty: true | ||
restart: always | ||
depends_on: | ||
- postgres | ||
networks: | ||
- myNetwork | ||
user: node | ||
postgres: | ||
container_name: mina-bridge-${NODE_ENV}-postgres | ||
image: postgres:15.3-alpine3.18 | ||
ports: | ||
- ${DB_PORT}:${DB_PORT} | ||
volumes: | ||
- postgresData:/var/lib/postgresql/data | ||
command: -p ${DB_PORT} | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: mina-bridge | ||
networks: | ||
myNetwork: | ||
|
||
|
||
volumes: | ||
postgresData: | ||
networks: | ||
myNetwork: | ||
name: minaBridgeNetwork${NODE_ENV} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ConfigService } from '@nestjs/config'; | ||
|
||
import { ENetworkName } from '@constants/blockchain.constant'; | ||
import { EEnvKey } from '@constants/env.constant'; | ||
|
||
import { RpcFactory } from '@shared/modules/web3/web3.module'; | ||
import { ETHBridgeContract } from '@shared/modules/web3/web3.service'; | ||
|
||
async function createRpcService(configService: ConfigService) { | ||
return await RpcFactory(configService); | ||
} | ||
|
||
async function createRpcEthService(configService: ConfigService) { | ||
return await RpcFactory(configService, ENetworkName.ETH); | ||
} | ||
function getEthBridgeAddress(configService: ConfigService) { | ||
return configService.get<string>(EEnvKey.ETH_BRIDGE_CONTRACT_ADDRESS); | ||
} | ||
|
||
function getEthBridgeStartBlock(configService: ConfigService) { | ||
return +configService.get<number>(EEnvKey.ETH_BRIDGE_START_BLOCK); | ||
} | ||
|
||
async function initializeEthContract(configService: ConfigService) { | ||
const [rpcEthService, address, _startBlock] = await Promise.all([ | ||
createRpcEthService(configService), | ||
getEthBridgeAddress(configService), | ||
getEthBridgeStartBlock(configService), | ||
]); | ||
|
||
// Instantiate the ETHBridgeContract with the resolved dependencies | ||
return new ETHBridgeContract(rpcEthService, address, _startBlock); | ||
} | ||
export { createRpcService, createRpcEthService, getEthBridgeAddress, getEthBridgeStartBlock, initializeEthContract }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
export const COMMOM_CONFIG_TIP = 0.5; | ||
export const COMMON__CONFIG_DAILY_QUOTA = 500; | ||
|
||
export enum EDirection { | ||
ASC = 'ASC', | ||
DESC = 'DESC', | ||
} | ||
|
||
export enum ERole { | ||
MINA_ADMIN = 'Mina Admin', | ||
EVM_ADMIN = 'EVM Admin', | ||
} | ||
|
||
export enum EAsset { | ||
ETH = 'ETH', | ||
MINA = 'MINA', | ||
WETH = 'WETH', | ||
} | ||
|
||
export const JWT_TOKEN_EXPIRE_DURATION = '1d'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
export const RPC_SERVICE_INJECT = 'RPC_SERVICE'; | ||
export const RPC_ETH_SERVICE_INJECT = 'RPC_ETH_SERVICE'; | ||
export const ETH_BRIDGE_ADDRESS_INJECT = 'ETH_BRIDGE_ADDRESS_INJECT'; | ||
export const ETH_BRIDGE_START_BLOCK_INJECT = 'ETH_BRIDGE_START_BLOCK_INJECT'; | ||
export const ASYNC_CONNECTION = 'ASYNC_CONNECTION'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.