forked from FactomProject/walletapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
height.go
44 lines (35 loc) · 1002 Bytes
/
height.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
// Copyright 2015 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/FactomProject/factom"
)
/************************************************************
* Height
************************************************************/
type Height struct {
}
var _ ICommand = (*Height)(nil)
// Height transactions <address list>
func (Height) Execute(state IState, args []string) (err error) {
h, err := factom.GetDBlockHeight()
if err != nil {
return fmt.Errorf("Failed to contact the Factom Network")
} else {
fmt.Printf("DirectoryBlockHeight=%d\n", h)
}
return nil
}
func (Height) Name() string {
return "Height"
}
func (Height) ShortHelp() string {
return "Height -- Returns the number of completed Directory Blocks in Factom."
}
func (Height) LongHelp() string {
return `
Height Returns the number of completed Directory Blocks in Factom.
cd`
}