For Flutter newbie, who confuses about the template, libraries should use for an initial project

I use this template to set up the initial project. It uses necessary dependencies to start and something you should consider:

  • The app icon had been checked for distribution to stores.
  • Application clean structure
  • I18n had been set up and sample
  • App env approach tested with CI
  • Compatible with, (just use appcenter/bitrise for ci, it’ll recognize automatically)
  • Example of how to use rest API
  • Example of how to use provider
  • Example…

Preparing source

  • Clone pancake-swap-core
git clone
cd pancake-swap-core
git checkout -b factory 3b214306770e86bc3a64e67c2b5bdb566b4e94a7
yarn install
yarn compile
git clone
cd pancake-swap-periphery
git checkout -b router d769a6d136b74fde82502ec2f9334acc1afc0732
yarn install
yarn add @uniswap/v2-core@"file:../pancake-swap-core"
yarn compile
git clone
cd pancake-swap-interface-v1
git checkout -b v1 0257017f2daaae2f67c24ded70b5829f74a01b3c
yarn install


Install contract merger:

npm install sol-merger -g

Prepare PancakeFactory and PancakeRouter

sol-merger pancake-swap-core/contracts/PancakeFactory.sol ./build
sol-merger pancake-swap-core/contracts/PancakePair.sol ./build
sol-merger pancake-swap-periphery/contracts/PancakeRouter01.sol ./build
sol-merger pancake-swap-periphery/contracts/PancakeRouter.sol ./build

Config Server

nano /etc/zabbix/zabbix_server.conf===>Update DB information
nano /etc/zabbix/web/zabbix.conf.php
# Update DB information, must be matched with server config above
# Integrate with server
ZBX_SERVER = '**your zabbix ip address or name**';
ZBX_SERVER_PORT = '10051';
ZBX_SERVER_NAME = '**your zabbix hostname**';
$ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
sudo systemctl restart zabbix-server
sudo systemctl status zabbix-server
ps -ef | grep zabbix

Setup Agent

  • Access to vps agent -> Install zabbix-agent
dpkg -i zabbix-release_5.4-1+ubuntu20.04_all.deb
apt update
apt install zabbix-agent
# If you enable firewall -> open ufw port…

  • There are 2 limits to practicality: gas costs and the block gas limit.


Create 5k5 players, read one time

Max Gas Limit is 28,500,000 at May 12, 2021 = 0.22BNB ~ $145

  • [READ] Can not get all 5600 players (1600 is ok)
call to TestPlayerRead.getPlayers
call to TestPlayerRead.getPlayers errored: Error: Internal JSON-RPC error. { "code": -32000, "message": "out of gas" }

Setup MongoDB

* Check linux version: lsb_release -a
sudo apt install wget
wget -qO - | sudo apt-key add -

* Debian 10 "Buster"
echo "deb buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

* Ubuntu 20.04 (Focal)
echo "deb [ arch=amd64,arm64 ] focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt update
sudo apt install -y build-essential
sudo apt install -y mongodb-org
sudo systemctl enable mongod
sudo service mongod start
- Start: sudo service mongod start
- Verify status: sudo cat /var/log/mongodb/mongod.log …

Make sure your application is stateless: share database/cache, cronjob

Create ecosystem.config.js at root

// # Start all applications
// pm2 start ecosystem.config.js
// # Stop all
// pm2 stop ecosystem.config.js
// # Restart all
// pm2 restart ecosystem.config.js
// # Reload all
// pm2 reload ecosystem.config.js
// # Delete all
// pm2 delete ecosystem.config.js
module.exports = {
apps: [{
name: "nestjs-prod",
script: "./dist/main.js",


Simple config: nginx.conf

sudo nano /etc/nginx/sites-available/

# start of file
# http {
upstream ncluster {
server weight=3;

server {


Get started


Download jmeter -> extract


  • open terminal run GUI ./bin/jmeter
  • Create new Test Plan
  • Right click on “Test Plan” -> Add -> Threads -> Thread Group -> Update Thread Properties
  • Right click on “Thread Group” -> Add -> Sampler -> HTTP request -> Update web server and request info
  • Right click on “Thread Group” -> Add -> Assertions -> Response Assertion -> Add 200 as Response code to Patterns to Test
  • Right click on “Thread Group” -> Add -> Listener -> View Results in Table
  • Save config
  • Click green play button


  • After prepared Test Plan, we got .jmx file
  • Run command line…



mongodump --username DB_USERNAME --password DB_PASSWORD --db DB_NAME --out /var/backups/mongobackups/`date +"%m-%d-%y"`


sudo systemctl stop mongodb
sudo apt-get purge mongodb-*


wget -qO - | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl start mongod
sudo systemctl status mongod


ubuntu@ip-172-31-1-68:~/myubi-wallet-service$ mongod --version
db version v4.4.4
Build Info: {
"version": "4.4.4",
"gitVersion": "8db30a63db1a9d84bdcad0c83369623f708e0397",
"openSSLVersion": "OpenSSL 1.1.1 11 Sep 2018",
"modules": [],
"allocator": "tcmalloc",
"environment": {
"distmod": "ubuntu1804",
"distarch": "x86_64",
"target_arch": "x86_64"

Add user role

ubuntu:~$ mongo
> use admin;
> db.createUser({
user: "admin"…

The Stack event begins with fixed pool size and stacking time. How to deal with fairy things?
- (1) The reward should be fixed at stacking time and maybe grow…

Nhan Cao

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store