Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ migrate:
.PHONY: new-migration
new-migration:
npx sequelize migration:generate --name "$(NAME)"

.PHONY: dev-migrate
dev-migrate:
@echo "Migrating dev db..."
nix develop . -c yarn run dev:db:migrate
46 changes: 46 additions & 0 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
services:
mysql:
restart: always
image: centos/mysql-80-centos7
container_name: mysql
ports:
- "3306:3306"
mem_limit: 512m
environment:
- MYSQL_DATABASE=wallet_service_local
- MYSQL_USER=wallet_service_user
- MYSQL_PASSWORD=password
- MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=mysql_native_password
networks:
- svc

redis:
image: redis:6.2
ports:
- 6379:6379
mem_limit: 96m
networks:
- svc

dbadmin:
restart: always
image: phpmyadmin/phpmyadmin
container_name: mariadb-phpmyadmin
ports:
- "8001:80"
mem_limit: 512m
depends_on:
- mysql
environment:
PMA_HOST: mysql
PMA_PORT: 3306
# MYSQL_USER: wallet_service_user
# MYSQL_PASSWORD: password
PMA_USER: wallet_service_user
PMA_PASSWORD: password
networks:
- svc

networks:
svc:
driver: bridge
68 changes: 68 additions & 0 deletions dev/envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Node Config

export APPLICATION_NAME=wallet-service-daemon
export CONSOLE_LEVEL=debug
export LOG_LEVEL=debug
export NODE_ENV=development
export STAGE=mainnet

# AWS Config

export AWS_SDK_LOAD_CONFIG=1
export AWS_VPC_DEFAULT_SG_ID=123
export AWS_SUBNET_ID_1=123
export AWS_SUBNET_ID_2=123
export AWS_SUBNET_ID_3=123
export AWS_REGION=eu-central-1

# DB Connection

export DB_ENDPOINT=localhost
export DB_PORT=3306
export DB_NAME=wallet_service_local
export DB_USER=wallet_service_user
export DB_PASS=password

export REDIS_URL=redis://localhost:6379
export REDIS_PASSWORD=""

# Hathor Config

export NETWORK=mainnet
export FULLNODE_HOST=node1.mainnet.hathor.network
export DEFAULT_SERVER=https://node1.mainnet.hathor.network/v1a/

# Application config

export NFT_AUTO_REVIEW_ENABLED=false
export AUTH_SECRET=123
export STREAM_ID=22d8238c-d92e-47ad-bf78-6de9a81e9e81
export FULLNODE_PEER_ID=6cbfb46459dff50e9b7546484af1fc8cf024024097588a568f9abf1a858c7105
export WS_DOMAIN=wss://node1.hathor.network/websocket
export WS_URL=ws://localhost:8083/v1a/event_ws
export USE_SSL=false
export BLOCK_REWARD_LOCK=10
export CONFIRM_FIRST_ADDRESS=true
export MAX_ADDRESS_GAP=20
export VOIDED_TX_OFFSET=20
export TX_HISTORY_MAX_COUNT=20
export WALLET_SERVICE_LAMBDA_ENDPOINT=abc
export PUSH_NOTIFICATION_ENABLED=false
export PUSH_ALLOWED_PROVIDERS=abc
export NEW_TX_SQS=abc
export ALERT_MANAGER_REGION=eu-central-1
export ALERT_MANAGER_TOPIC=abc
export ALERT_MANAGER_ACCOUNT_ID=abc
export ACCOUNT_ID=123

# Firebase config

export FIREBASE_PROJECT_ID=abc
export FIREBASE_PRIVATE_KEY_ID=abc
export FIREBASE_PRIVATE_KEY=abc
export FIREBASE_CLIENT_EMAIL=abc
export FIREBASE_CLIENT_ID=abc
export FIREBASE_AUTH_URI=abc
export FIREBASE_TOKEN_URI=abc
export FIREBASE_AUTH_PROVIDER_X509_CERT_URL=abc
export FIREBASE_CLIENT_X509_CERT_URL=abc
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"repository": "git@github.com:HathorNetwork/hathor-wallet-service.git",
"author": "André Abadesso <andre.abadesso@gmail.com>",
"private": true,
"scripts": {
"dev:db:migrate": "nix develop . -c bash -c \"source ./dev/envrc && sequelize db:migrate\""
},
"devDependencies": {
"@types/jest": "29.5.13",
"@typescript-eslint/eslint-plugin": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/types/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class TokenInfo {
this.symbol = symbol;
this.transactions = transactions || 0;

// XXX: get config from settings?
// XXX: currently we only support Hathor/HTR as the default token
const hathorConfig = constants.DEFAULT_NATIVE_TOKEN_CONFIG;

if (this.id === constants.NATIVE_TOKEN_UID) {
Expand Down