Skip to content

Commit e6e482e

Browse files
committed
Started the golang cli widget which will pull and push blocks across two separates chains
1 parent 5b86523 commit e6e482e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+158
-0
lines changed

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.DEFAULT_GOAL := build
2+
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
3+
PACKAGES = $(shell find ./ -type d -not -path "./vendor" -not -path "./vendor/*" -not -path "./.git" -not -path "./.git/*" -not -path "./config/files")
4+
SHELL=/bin/bash
5+
6+
clean:
7+
@rm -f cli-tool
8+
9+
#test:
10+
# @go test ./... -v
11+
12+
format:
13+
@gofmt -s -w ${GOFILES_NOVENDOR}
14+
15+
coverage:
16+
echo "mode: count" > coverage-all.out
17+
$(foreach pkg,$(PACKAGES),\
18+
go test -coverprofile=coverage.out -covermode=count $(pkg);\
19+
tail -n +2 coverage.out >> coverage-all.out;)
20+
go tool cover -html=coverage-all.out
21+
22+
run:
23+
@go build -o cli-tool .
24+
25+
check:
26+
@if [ -n "$(shell gofmt -l ${GOFILES_NOVENDOR})" ]; then \
27+
echo 1>&2 'The following files need to be formatted:'; \
28+
gofmt -l .; \
29+
exit 1; \
30+
fi
31+
32+
vet:
33+
@go vet ${GOFILES_NOVENDOR}
34+
35+
lint:
36+
@golint ${GOFILES_NOVENDOR}

cli/cli.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright (c) 2018 Clearmatics Technologies Ltd
2+
3+
package cli
4+
5+
import (
6+
// "strings"
7+
8+
"github.com/abiosoft/ishell"
9+
// "gitlab.clearmatics.net/dev/boe-poc/src/api"
10+
// "gitlab.clearmatics.net/dev/boe-poc/src/config"
11+
)
12+
13+
func Launch() {
14+
// by default, new shell includes 'exit', 'help' and 'clear' commands.
15+
shell := ishell.New()
16+
17+
// display welcome info.
18+
shell.Println("Block Validation CLI Tool")
19+
20+
// display specific account balance
21+
shell.AddCmd(&ishell.Cmd{
22+
Name: "getBlock",
23+
Help: "get an ethereum block from a chain",
24+
Func: func(c *ishell.Context) {
25+
c.Println("===============================================================")
26+
c.Println("Get block:")
27+
if len(c.Args) > 1 {
28+
c.Println("Too many arguments entered.")
29+
} else {
30+
c.Println(c.Args[0])
31+
}
32+
c.Println("===============================================================")
33+
},
34+
})
35+
36+
// run shell
37+
shell.Run()
38+
}

main.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2018 Clearmatics Technologies Ltd
2+
3+
package main
4+
5+
import (
6+
"fmt"
7+
"os"
8+
9+
"github.com/validation/cli"
10+
)
11+
12+
func main() {
13+
argsWithoutProg := os.Args[1:]
14+
fmt.Println(argsWithoutProg)
15+
// setup, photon := config.ParseParameters(argsWithoutProg)
16+
17+
// auth, acc := api.Init(setup)
18+
19+
cli.Launch()
20+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

poa-network/node1/geth/LOCK

Whitespace-only changes.
988 Bytes
Binary file not shown.
186 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MANIFEST-000004

0 commit comments

Comments
 (0)