Begin writing debora

This commit is contained in:
Jae Kwon
2015-04-14 04:14:18 -07:00
parent bcfe33f15c
commit 89e05168d5
10 changed files with 97 additions and 14 deletions
+1 -10
View File
@@ -16,6 +16,7 @@ import (
acm "github.com/tendermint/tendermint/account"
"github.com/tendermint/tendermint/binary"
. "github.com/tendermint/tendermint/cmd/barak/types"
. "github.com/tendermint/tendermint/common"
pcm "github.com/tendermint/tendermint/process"
"github.com/tendermint/tendermint/rpc"
@@ -169,9 +170,6 @@ type CommandRunProcess struct {
func (_ CommandRunProcess) TypeByte() byte { return typeByteRunProcess }
type ResponseRunProcess struct {
}
func RunProcess(wait bool, label string, execPath string, args []string, input string) (*ResponseRunProcess, error) {
barak.mtx.Lock()
@@ -204,9 +202,6 @@ type CommandStopProcess struct {
func (_ CommandStopProcess) TypeByte() byte { return typeByteStopProcess }
type ResponseStopProcess struct {
}
func StopProcess(label string, kill bool) (*ResponseStopProcess, error) {
barak.mtx.Lock()
proc := barak.processes[label]
@@ -226,10 +221,6 @@ type CommandListProcesses struct{}
func (_ CommandListProcesses) TypeByte() byte { return typeByteListProcesses }
type ResponseListProcesses struct {
Processes []*pcm.Process
}
func ListProcesses() (*ResponseListProcesses, error) {
var procs = []*pcm.Process{}
barak.mtx.Lock()
+15
View File
@@ -0,0 +1,15 @@
package types
import (
pcm "github.com/tendermint/tendermint/process"
)
type ResponseRunProcess struct {
}
type ResponseStopProcess struct {
}
type ResponseListProcesses struct {
Processes []*pcm.Process
}
+7
View File
@@ -0,0 +1,7 @@
package main
import (
"github.com/tendermint/tendermint/logger"
)
var log = logger.New("module", "main")
+16
View File
@@ -0,0 +1,16 @@
package main
import (
"fmt"
btypes "github.com/tendermint/tendermint/cmd/barak/types"
. "github.com/tendermint/tendermint/common"
"github.com/tendermint/tendermint/rpc"
// ctypes "github.com/tendermint/tendermint/rpc/core/types"
)
func main() {
response := []btypes.ResponseListProcesses{}
response2, err := rpc.Call("http://127.0.0.1:8082", "list_processes", Arr(), &response)
fmt.Printf("%v\n", response)
fmt.Printf("%v (error: %v)\n", response2, err)
}