-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
47 lines (38 loc) · 1.05 KB
/
main.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
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Static port for now for indexer and supernova to find RPC of node
nodeServicePort := pulumi.Int(26657)
// Deploy gno.land node
_, _, err := NewNode(ctx)
if err != nil {
return err
}
// Set the namespace and service name as static values
// TODO dynamic update
namespace := pulumi.String("default")
serviceName := pulumi.String("node-service")
// Deploys the tx-indexer
_, _, err = NewIndexer(ctx, namespace, serviceName, nodeServicePort)
if err != nil {
return err
}
var sleepSeconds = pulumi.Int(10)
// Runs a Supernova job
_, err = NewSupernova(ctx, namespace, serviceName, nodeServicePort, sleepSeconds)
if err != nil {
return err
}
// Deploys gnoland-metrics
indexerPort := pulumi.Int(8545)
indexerServiceName := pulumi.String("tx-indexer-service")
_, _, err = NewMetrics(ctx, namespace, indexerServiceName, indexerPort)
if err != nil {
return err
}
return nil
})
}