/
create_default_configs.go
61 lines (50 loc) · 1.22 KB
/
create_default_configs.go
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
package main
import (
"io/ioutil"
"path"
"gopkg.in/yaml.v2"
"github.com/insolar/assured-ledger/ledger-core/application/bootstrap"
"github.com/insolar/assured-ledger/ledger-core/configuration"
)
func writePulsarConfig(outputDir string) {
pcfg := configuration.NewPulsarConfiguration()
raw, err := yaml.Marshal(pcfg)
if err != nil {
panic(err)
}
err = ioutil.WriteFile(path.Join(outputDir, "pulsar_default.yaml"), raw, 0644)
if err != nil {
panic(err)
}
}
func writeBootstrapConfig(outputDir string) {
raw, err := yaml.Marshal(bootstrap.Config{})
if err != nil {
panic(err)
}
err = ioutil.WriteFile(path.Join(outputDir, "bootstrap_default.yaml"), raw, 0644)
if err != nil {
panic(err)
}
}
func writeNodeConfig(outputDir string) {
cfg := configuration.NewConfiguration()
raw, err := yaml.Marshal(cfg)
if err != nil {
panic(err)
}
err = ioutil.WriteFile(path.Join(outputDir, "node_default.yaml"), raw, 0644)
if err != nil {
panic(err)
}
}
func writePulseWatcher(outputDir string) {
raw, err := yaml.Marshal(configuration.NewPulseWatcherConfiguration())
if err != nil {
panic(err)
}
err = ioutil.WriteFile(path.Join(outputDir, "pulsewatcher_default.yaml"), raw, 0644)
if err != nil {
panic(err)
}
}