Node.js + express + typescript toy project
Create eth wallet & send transaction tutoria l
ethers.js: https://docs.ethers.org/v6/
- create mnemonic and master address
- create child address
- send transaction
- get balance
- get fee data
- get nonce
- checksum address
Sign up for Infura and get an API key.
Infura: https://app.infura.io/
And get testnet Ether(sepolia)
https://www.infura.io/faucet/sepolia
- nvm 0.39.7
- node v20.12.
- npm 10.5.0
- express 4.19.2
- typescript 5.4.5
- eslint 8.57.0
- prettier 3.2.5
- ethers.js 6.12.1
git clone https://github.com/mine-kim/eth-dapp-starter.git
cd ./eth-dapp-starter
npm install
//create env file
vi .env.develop & .env.production
PORT=<PORT>
ETH_NETWORK=sepolia
INFURA_API_KEY=<YOUR_API_KEY>
PRIVATE_KEY=<YOUR_WALLET_PRIVATE_KEY>
//development(swagger & nodemon)
npm run dev
//production(pm2)
npm run start
//dev
docker build . -t eth-dapp:latest --target=dev
docker run -it -p 3001:3001 eth-dapp
//prod
docker build . -t eth-dapp:latest --target=prod
docker run -it -p 3002:3002 eth-dapp
//prod
docker-compose up -d
http://localhost:3001/api-docs/
npm run api-docs
├──📂 build
│ └── swagger.yaml
├──📂 dist
│ ├── common
│ ├── middleware
│ ├── router
│ ├── service
│ └── server.js
├──📂 src
│ ├──📂 common
│ │ ├── common.ts
│ │ └── type.ts
│ ├──📂 middleware
│ │ ├── commonError.ts
│ │ ├── commonLog.ts
│ │ └── responseFilter.ts
│ ├──📂 router
│ │ └── eth.ts
│ ├──📂 service
│ │ └── eth.ts
│ └── server.ts
├──📂 node_modules
│ └── .....
├──📂 swagger
│ ├── eth.yaml
│ └── openapi.yaml
├── .dockerignore
├── .env
├── .gitignore
├── .prettierrc.json
├── compose.yaml
├── Dockerfile
├── eslint.config.mjs
├── index.ts
├── package-lock.json
├── package.json
├── README.Docker.md
├── README.md
└── tsconfig.json