forked from ping-pub/faucet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.js
112 lines (106 loc) · 3.48 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { stringToPath } from '@cosmjs/crypto'
import fs from 'fs'
import { ethers } from 'ethers'
const HOME = ".faucet";
const mnemonic_path= `${HOME}/mnemonic.txt`
if (!fs.existsSync(mnemonic_path)) {
fs.mkdirSync(HOME, { recursive: true })
fs.writeFileSync(mnemonic_path, ethers.Wallet.createRandom().mnemonic.phrase)
}
const mnemonic = fs.readFileSync(mnemonic_path, 'utf8')
console.log("======================== faucet mnemonic =========================")
console.log(mnemonic)
console.log("==================================================================")
export default {
port: 8088, // http port
db: {
path: `${HOME}/history.db` // save request states
},
project: {
name: "Demo of Side Exchange",
logo: "https://side.one/favicon.ico",
deployer: `<a href="https://demo.side.exchange">Side Exchange</a>`
},
blockchains: [
{
name: "SIDE Testnet",
endpoint: {
// make sure that CORS is enabled in rpc section in config.toml
// cors_allowed_origins = ["*"]
rpc_endpoint: "https://testnet-rpc.side.one",
},
sender: {
mnemonic,
option: {
hdPaths: [stringToPath("m/44'/118'/0'/0/0")],
prefix: "side"
}
},
tx: {
amount: [{
denom: "uside",
amount: "100000000"
}],
fee: {
amount: [
{
amount: "5000",
denom: "uside"
}
],
gas: "200000"
},
},
limit: {
// how many times each wallet address is allowed in a window(24h)
address: 1,
// how many times each ip is allowed in a window(24h),
// if you use proxy, double check if the req.ip is return client's ip.
ip: 5
}
},
{
name: "SIDE devnet",
endpoint: {
// make sure that CORS is enabled in rpc section in config.toml
// cors_allowed_origins = ["*"]
rpc_endpoint: "https://devnet-rpc.side.one",
},
sender: {
mnemonic,
option: {
hdPaths: [stringToPath("m/44'/118'/0'/0/0")],
prefix: "side"
}
},
tx: {
amount: [{
denom: "uside",
amount: "1000000000"
//},{
// denom: "uusdt",
// amount: "1000000000"
//},{
// denom: "uusdc",
// amount: "1000000000"
}],
fee: {
amount: [
{
amount: "5000",
denom: "uside"
}
],
gas: "200000"
},
},
limit: {
// how many times each wallet address is allowed in a window(24h)
address: 10,
// how many times each ip is allowed in a window(24h),
// if you use proxy, double check if the req.ip is return client's ip.
ip: 10
}
},
]
}