The package is implemented using spf13/cobra library.
Added run, version and help commands in the perunnode app.
The run command can take either
a config file or
a config file with a few flags to override the config file or
complete config in flags by specifying all flags
(if all flags are specified, configfile will be ignored.)
The version command prints version of perunnode, go-perun. Added a
Makefile to set the version using linker flags during build.
help command the message autogenerated by the library.
Added a ListenAndServe function is [api/grpc] to start the grpc
channel API server and use it in the executable package.
Category
Implementation Task
Relevant issue
Relates to #98. (2/3) PRs.
Testing
Steps to run the tests
To build test the building of binary and proper version is assigned, run make command from project root. The perunnode binary should be created in the root folder.
Run ./perunnode help to see the help output.
Run the ./perunnode version to the the version of software in this format.
<version:tag if it is present, else short form of commit id" Git revision: <commit-if of current version> (go-perun version: <go-perun version as in go.mod file>)
To test if the run command starts the node with a usable configuration:
a. Start the ganache-cli node using below command:
c. Comment out line no 85 in api/grpc/server_integ_test.go containing this function call "StartServer()". Save the file and run the test from root folder of the project using below command:
go test -tags=integration -count=1 -cover ./api/grpc -v
The test should complete without any errors by connecting the running perunnode instead of starting its own. In the terminal where perunnode was started, the logs would be printed at debug level.
d. Stop the perunnode and ganache-cli by pressing Ctrl+C.
Checklist
[x] Name is added to the NOTICE file, if it is not present already.
Description
Implement cmd/perunnode executable package
The package is implemented using spf13/cobra library.
Added run, version and help commands in the perunnode app.
Added a ListenAndServe function is [api/grpc] to start the grpc channel API server and use it in the executable package.
Category
Implementation Task
Relevant issue
Relates to #98. (2/3) PRs.
Testing
Steps to run the tests
make
command from project root. Theperunnode
binary should be created in the root folder../perunnode help
to see the help output../perunnode version
to the the version of software in this format.To test if the run command starts the node with a usable configuration: a. Start the ganache-cli node using below command:
b. In another terminal, from the root directory of the project, start the perunnode using below command:
c. Comment out line no 85 in api/grpc/server_integ_test.go containing this function call "StartServer()". Save the file and run the test from root folder of the project using below command:
The test should complete without any errors by connecting the running perunnode instead of starting its own. In the terminal where perunnode was started, the logs would be printed at debug level.
d. Stop the perunnode and ganache-cli by pressing Ctrl+C.
Checklist