hyperledger-labs / perun-node

State channel node of the blockchain-agnostic state channels framework Perun.
https://labs.hyperledger.org/perun-doc/
Apache License 2.0
18 stars 12 forks source link

Implement a perunnode application in cmd/perunnode #121

Closed manoranjith closed 4 years ago

manoranjith commented 4 years ago

Description

Implement cmd/perunnode executable package

Category

Implementation Task

Relevant issue

Relates to #98. (2/3) PRs.

Testing

Steps to run the tests
  1. 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.
  2. Run ./perunnode help to see the help output.
  3. 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>)
  4. To test if the run command starts the node with a usable configuration: a. Start the ganache-cli node using below command:

    ganache-cli -b 1 --account="0x1fedd636dbc7e8d41a0622a2040b86fea8842cef9d4aa4c582aad00465b7acff,100000000000000000000" --account="0xb0309c60b4622d3071fad3e16c2ce4d0b1e7758316c187754f4dd0cfb44ceb33,100000000000000000000

    b. In another terminal, from the root directory of the project, start the perunnode using below command:

    ./perunnode run --loglevel "debug" --logfile "" --chainurl "ws://127.0.0.1:8545" --adjudicator "0x9daEdAcb21dce86Af8604Ba1A1D7F9BFE55ddd63" --asset "0x5992089d61cE79B6CF90506F70DD42B8E42FB21d" --chainconntimeout "10s" --onchaintxtimeout "10s" --responsetimeout "10s"

    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

manoranjith commented 4 years ago

This should be closed after #120.