-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
74 lines (70 loc) · 2.45 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
import { stringToPath } from '@cosmjs/crypto'
import fs from 'fs'
// import { ethers } from 'ethers'
import { Wallet, utils } from 'ethers';
import dotenv from 'dotenv';
dotenv.config();
// Load environment variables from process.env with defaults if not set
var mnemonic = process.env.mnemonic;
var rpcEndpoint = process.env.rpcEndpoint || "https://testnet-validated-validator-rpc.poktroll.com";
var txAmount = process.env.txAmount || 10000000;
var txFeeAmount = process.env.txFeeAmount || 10000;
var txGasLimit = process.env.txGasLimit || 100000;
const HOME = ".faucet";
const mnemonic_path= `${HOME}/mnemonic.txt`
if (!fs.existsSync(mnemonic_path)) {
fs.mkdirSync(HOME, { recursive: true })
fs.writeFileSync(mnemonic_path, Wallet.fromMnemonic(
utils.entropyToMnemonic(utils.randomBytes(32))
).mnemonic.phrase)
}
if(!process.env.mnemonic)
mnemonic = fs.readFileSync(mnemonic_path, 'utf8')
export default {
port: 8088, // http port
db: {
path: `${HOME}/history.db` // save request states
},
project: {
name: "Get Testnet POKT",
longName: 'Pocket Testnet',
logo: "https://assets-global.website-files.com/651fe0a9a906d151784935f8/65834aed8fd922fc4829817f_Logo-wordm-white.svg",
deployer: `<a href="https://faucet.pokt.network">Testnet POKT</a>`
},
blockchains: [
{
name: "poktroll",
endpoint: {
// make sure that CORS is enabled in rpc section in config.toml
// cors_allowed_origins = ["*"]
rpc_endpoint: rpcEndpoint,
},
sender: {
mnemonic,
option: {
hdPaths: [stringToPath("m/44'/118'/0'/0/0")],
prefix: "pokt" // human readable address prefix
}
},
tx: {
amount: [
{
denom: "upokt",
amount: txAmount
},
],
fee: {
amount: [],
gas: txGasLimit
},
},
limit: {
// how many times each wallet address is allowed in a window(24h)
address: 2,
// 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
}
},
]
}