-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.ts
143 lines (141 loc) · 5.17 KB
/
config.ts
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import { ProjectConfigOptions, StackSetupMode } from '@devphase/service';
const config : ProjectConfigOptions = {
/*
* Project directories
*/
directories: {
artifacts: 'artifacts',
contracts: 'contracts',
logs: 'logs',
scripts: 'scripts',
stacks: 'stacks',
tests: 'tests',
typings: 'typings'
},
/*
* Stack configuration
* {
* [componentName : string]: {
* binary: string, // path to binary
* workingDir: string, // working directory as above
* evns: {
* [name: string]: string,
* },
* args: {
* [name: string]: string,
* },
* timeout: number // start up timeout
* }
* }
*/
stack: {
version: 'latest', // version which you want to pull from official repository (tag name) or "latest" one
blockTime: 6000, // default block time for direct stack running (may be overriden in testing mode)
setupOptions: {
mode: StackSetupMode.None,
workerUrl: 'http://localhost:{{stack.pruntime.port}}'
},
node: {
port: 9944, // ws port
binary: '{{directories.stacks}}/{{stack.version}}/phala-node',
workingDir: '{{directories.stacks}}/.data/node',
dataDir: '{{directories.stacks}}/.data/node',
envs: {},
args: {
'--dev': true,
'--rpc-methods': 'Unsafe',
'--rpc-port': '{{stack.node.port}}',
'--block-millisecs': '{{stack.blockTime}}', // override at runtime
},
timeout: 10000,
},
pruntime: {
port: 8000, // server port
binary: '{{directories.stacks}}/{{stack.version}}/pruntime',
workingDir: '{{directories.stacks}}/.data/pruntime',
dataDir: '{{directories.stacks}}/.data/pruntime',
envs: {},
args: {
'--allow-cors': true,
'--cores': 0,
'--port': '{{stack.pruntime.port}}'
},
timeout: 2000,
},
pherry: {
gkMnemonic: '//Alice', // gate keeper mnemonic
binary: '{{directories.stacks}}/{{stack.version}}/pherry',
workingDir: '{{directories.stacks}}/.data/pherry',
dataDir: '{{directories.stacks}}/.data/pherry',
envs: {},
args: {
'--no-wait': true,
'--mnemonic': '{{stack.pherry.gkMnemonic}}',
'--inject-key': '0000000000000000000000000000000000000000000000000000000000000001',
'--substrate-ws-endpoint': 'ws://localhost:{{stack.node.port}}',
'--pruntime-endpoint': 'http://localhost:{{stack.pruntime.port}}',
'--dev-wait-block-ms': '{{stack.blockTime}}', // override at runtime
},
timeout: 2000,
}
},
/**
* Testing configuration
*/
testing: {
mocha: {}, // custom mocha configuration
blockTime: 100, // block time override for spawning local testnet
stackSetupConfig: { // environment setup
setup: {
custom: undefined, // custom setup procedure callback; (devPhase) => Promise<void>
timeout: 60 * 1000,
},
teardown: {
custom: undefined, // custom teardown procedure callback ; (devPhase) => Promise<void>
timeout: 10 * 1000,
}
},
stackLogOutput: false, // display stack output in console
},
/**
* Networks configuration
* Default network is local and it can be changed using CLI argument
*/
networks: {
local: {
nodeUrl: 'ws://localhost:{{stack.node.port}}',
nodeApiOptions: {},
workerUrl: 'http://localhost:{{stack.pruntime.port}}',
defaultClusterId: '0x0000000000000000000000000000000000000000000000000000000000000000', // set default cluster ID for further actions
blockTime: 6000, // network block time (may be overriden in testing mode)
},
phala: {
nodeUrl: 'wss://api.phala.network/ws',
workerUrl: 'https://phat-cluster-ca.phala.network/pruntime/0x4e4e139e',
defaultClusterId: '0x0000000000000000000000000000000000000000000000000000000000000001',
blockTime: 14_000,
},
poc6: {
nodeUrl: 'wss://poc6.phala.network/ws',
workerUrl: 'https://poc6.phala.network/pruntime/0x923462b4',
defaultClusterId: '0x0000000000000000000000000000000000000000000000000000000000000001',
blockTime: 3_000,
}
},
/**
* Accounts fallback configuration
* It is overriden by values saved in ./accounts.json
*/
accountsConfig: {
keyrings: {
alice: '//Alice', // string (in case of mnemonic) or account keyring JSON
bob: '//Bob',
charlie: '//Charlie',
dave: '//Dave',
eve: '//Eve',
ferdie: '//Ferdie'
},
suAccount: 'alice'
}
};
export default config;