เราจะต้องสร้าง Wallet (Address + Private Key) เพื่อเอาไว้ใช้สำหรับเก็บ/เข้าถึง Token บน Blockchain ขึ้นมาก่อน โดยให้ Create Directory เปล่า ๆ ขึ้นมาดังนี้
$ mkdir iwallet
$ cd iwallet
$ docker run --rm -v $PWD:/iwallet ghcr.io/jittagornp/iwallet wallet-gen -p <YOUR_WALLET_PASSWORD> -n <NETWORK>
แบบไม่กำหนด Network (Default Network เป็น BSC)
$ docker run --rm -v $PWD:/iwallet ghcr.io/jittagornp/iwallet wallet-gen -p 123456
Generating wallet and config...
Output wallet file "0x144625b77d8e2d09a11c8a4729acc9bab5c89dc9.wallet.json"
Output config file "0x144625b77d8e2d09a11c8a4729acc9bab5c89dc9.config.json"
$ ls -l
-rw------- 1 root root 626 Jul 26 15:19 0x144625b77d8e2d09a11c8a4729acc9bab5c89dc9.config.json
-r-------- 1 root root 491 Jul 26 15:19 0x144625b77d8e2d09a11c8a4729acc9bab5c89dc9.wallet.json
$ cat 0x144625b77d8e2d09a11c8a4729acc9bab5c89dc9.config.json
{
"walletFile" : "0x779fba7799adf15c8476bdbf4dac3770945a2cd4.wallet.json",
"walletPassword" : "123456",
"network" : "BSC_MAINNET",
"tokenA" : "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c", //BTCB
"tokenB" : "0xe9e7cea3dedca5984780bafc599bd69add087d56", //BUSD
"minimumGasBalance" : 0.005,
"fillGasTokenBAmount" : 3,
"swapRouter" : "0x10ED43C718714eb63d5aA57B78B54704E256024E", //PancakeSwap Router
"gasSwapRouter" : "0x10ED43C718714eb63d5aA57B78B54704E256024E", //PancakeSwap Router
"defaultSwapSlippage" : 0.5,
"defaultSwapDeadlineMinutes" : 10,
"tokenAutoApproveMultiplier" : 3.0,
"differenceAtLeastPercent" : 9.0,
"swapPercent" : 50.0,
"swapAtLeastValue" : 1,
"recipientWhitelist" : []
}
$ docker run --rm -v $PWD:/iwallet ghcr.io/jittagornp/iwallet wallet-gen -p 123456 -n POLYGON_MAINNET
Generating wallet and config...
Output wallet file "0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.wallet.json"
Output config file "0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.config.json"
$ cat 0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.config.json
{
"walletFile" : "0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.wallet.json",
"walletPassword" : "123456",
"network" : "POLYGON_MAINNET",
"tokenA" : "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", //WMATIC
"tokenB" : "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", //USDC
"minimumGasBalance" : 0.005,
"fillGasTokenBAmount" : 3,
"swapRouter" : "0xa5e0829caced8ffdd4de3c43696c57f7d7a678ff", //Quickswap Router
"gasSwapRouter" : "0xa5e0829caced8ffdd4de3c43696c57f7d7a678ff", //Quickswap Router
"defaultSwapSlippage" : 0.5,
"defaultSwapDeadlineMinutes" : 10,
"tokenAutoApproveMultiplier" : 3.0,
"differenceAtLeastPercent" : 9.0,
"swapPercent" : 50.0,
"swapAtLeastValue" : 1,
"recipientWhitelist" : []
}
0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.config.json
WMATIC_USDC_0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.config.json
$ mv 0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.config.json WMATIC_USDC_0x7fe5999fd513deae43d19dd0ab3cce8491ed6440.config.json