-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
36 lines (30 loc) · 917 Bytes
/
main.go
File metadata and controls
36 lines (30 loc) · 917 Bytes
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
package main
import (
"fmt"
"github.com/aakash4dev/vrfcall/chain"
"github.com/aakash4dev/vrfcall/config"
)
func main() {
client, account, addr, ctx, sAPI, registery := config.SettlementLayer()
_ = account
_ = sAPI
// pubKey:=account.Record.PubKey.Value
// fmt.Println("admin public key:",pubKey)
// check admin balance
isBalance, amount, err := chain.CheckBalance(ctx, addr, client)
if err != nil {
fmt.Println("Error in checking balance", err)
return
}
// call faucet (if balance is 0)
if amount < 3 || !isBalance {
fmt.Println("admin currently don't have faucet, requesting faucet from this address:", addr)
return
} else {
fmt.Println("admin have", amount, "tokens")
chain.PostGeneratePsudoRandomNumber(client, ctx, account, addr, registery)
chain.GetPsudoRandomNumber(sAPI)
chain.GetVerifyRandomNumber(sAPI, addr)
//chain.VrfCall(client, ctx, account, addr, registery)
}
}