Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
47c34e4
update maintainers file
choeppler Oct 17, 2022
bcea685
docs: Correct link to perunnodeui README.md
octalmage Jun 7, 2023
dbb07fa
Update go version to 1.19 in go.mod, circleci
Jun 12, 2023
2086469
Update go-perun to v0.9.0 in go.(mod|sum)
Jun 12, 2023
bc722e1
Adapt according to update go-perun v0.9.0
Jun 12, 2023
941d6dd
Update testdata for persistence tests
Jun 12, 2023
5dc96ae
Update proto and grpc compilers to latest versions
Jun 18, 2023
af6ca0d
Upgrade golangci-lint to latest (1.53.3)
Jun 12, 2023
d297861
Update linter config - remove depricated linters
Jun 18, 2023
32b20ec
Fix linter config - depgaurd
Jun 18, 2023
7887f40
Fix linter error - gofumpt
Jun 12, 2023
b1fc130
Fix linter error - goimports
Jun 18, 2023
6b2b830
Fix linter error - doc for main pkg
Jun 18, 2023
d510a7c
Fix linter error - replace usage of ioutil pkg
Jun 18, 2023
ea8ac55
Fix linter error - unused
Jun 18, 2023
b60871e
Fix linter error - nolint
Jun 18, 2023
34e6afa
Update go version, test command in Readme
Jun 21, 2023
35b124c
Reorganize protobuf definitions
Jun 18, 2023
5403a17
Refactor pb<->perun conversion funcs
Jun 19, 2023
bb80e21
Move pb<->perun conversion funcs to pkg pb
Jun 19, 2023
dac7204
Add proto defs for Funding_service
Jun 18, 2023
11ec2c9
Add funding methods to sessionAPI & update mocks
Jun 18, 2023
ceb7251
Impl funding methods for session type
Jun 18, 2023
f3f0839
Implement service side for grpc funding methods
Jun 18, 2023
8b5a62b
Rename newEthereumPaymentClient -> newChClient
Jun 18, 2023
b475f1e
Add configuration option for funder
Jun 18, 2023
0fdd27d
Move errors constants from session to perun pkg
Jul 23, 2023
07e03f5
Impl & use client side for grpc funding methods
Jul 23, 2023
19a584e
Generate session config for funding API instance
Sep 4, 2022
6dbcd5b
Refactor generateSessionConfig
Jul 23, 2023
46812b9
Add proto defs for grpc adjudicator
Jul 24, 2023
24517af
Add adjudicator to sessionAPI & update mocks
Jul 24, 2023
b537e48
Impl adjudicator method for session type
Jul 24, 2023
c3b944c
Impl grpc server side logic for adjudicator
Jul 24, 2023
078c921
Impl & use grpc client logic for adj
Jul 30, 2023
31fd172
Properly handle errors for grpc client
Aug 17, 2023
346e27f
Fix linter errors
Aug 17, 2023
69d2b1a
Reorg watcher init to make it configurable
Sep 4, 2022
d35c5ec
Add proto defs for grpc watcher
Jul 30, 2023
3220037
Add watcher interface to session API & regen mocks
Sep 5, 2022
6c8819a
Add watching to session API
Jul 30, 2023
e99c09c
Impl grpc server side logic for watcher
Jul 30, 2023
6c292dd
Impl & use grpc client logic for watcher
Jul 30, 2023
16e1aa2
Fix variable naming error
Aug 17, 2023
cefbb4e
Add test for session config generation function
Aug 17, 2023
5ba6193
Fix bug in generateSessionConfig
Aug 17, 2023
ee18207
In Makefile: rm build; add install, generate cmds
Aug 17, 2023
f57b6c8
Add demo directory to .gitignore
Aug 17, 2023
118ecdb
Fix parsing of blocktimeout
Sep 14, 2023
bd75dbe
Initialize and check for entries in subscribes map
Sep 14, 2023
6da6dfb
Register asset only if not ETH
Dec 10, 2023
7a3b3b3
Add a test for printing test private keys & addrs
Dec 10, 2023
427889b
Option for choosing payment or fundwatch mode
Sep 14, 2023
23d16c5
Serve payment API even in fundwatch only mode
Sep 22, 2023
e1cd682
Extract handlers for funding server to a pkg
Sep 22, 2023
1a608c7
Extract handlers for watching server to a pkg
Sep 24, 2023
aa7a078
Add perunio-tcp api server
Dec 10, 2023
2083387
Add api_messages.proto to go generate command
Dec 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
executors:
perun-node-executor:
docker:
- image: cimg/go:1.16.4-node
- image: cimg/go:1.19.10-node
environment:
RESULTS: /tmp/results
ARTIFACTS: /tmp/artifacts
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- make-results-artifacts-dir
- run:
name: Install linter
command: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.1
command: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3
- install-txt-to-html-coverter-aha
- run:
name: Run linter
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*~
app/payment/perun.log
demo
15 changes: 7 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ linters:
# restrict dependencies
- depguard
# detect unused, duplicate code
- deadcode
- dupl
- goconst
- structcheck
- unconvert
- unparam
- unused
- varcheck
# check code complexity
- funlen
- gocognit
Expand All @@ -61,11 +58,13 @@ linters-settings:
check-blank: true

depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message:
- github.com/ethereum/go-ethereum: "It contains code licensed under LGPL, import is allowed only inside perun-node/blockchain/ethereum"
- perun.network/go-perun/backend/ethereum: "It uses code licensed under LGPL, import is allowed only inside perun-node/blockchain/ethereum"
rules:
main:
deny:
- pkg: "github.com/ethereum/go-ethereum"
desc: It contains code licensed under LGPL, import is allowed only inside perun-node/blockchain/ethereum
- pkg: "perun.network/go-perun/backend/ethereum"
desc: It uses code licensed under LGPL, import is allowed only inside perun-node/blockchain/ethereum"

dupl:
# tokens count to trigger issue, 150 by default
Expand Down
24 changes: 9 additions & 15 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,21 @@ single approval from a non-author maintainer for pull requests to be merged.

<!-- Please keep this sorted alphabetically by github -->

| Name | GitHub | [Chat][_chat-url] |
| ---------------- | ----------------------------------------------- | ----------------- |
| Chris Hoeppler | [choeppler](https://github.com/choeppler) | choeppler |
| Daniel Kunz | [danielksan81](https://github.com/danielksan81) | danielksan81 |
| Manoranjith | [manoranjith](https://github.com/manoranjith) | mano-ranjith |
| Name | GitHub | [Discord][_chat-url] |
| ---------------- | ----------------------------------------------- | -------------------- |
| Chris Hoeppler | [choeppler](https://github.com/choeppler) | choeppler#8002 |
| Daniel Kunz | [danielksan81](https://github.com/danielksan81) | danielksan81#1327 |
| Manoranjith | [manoranjith](https://github.com/manoranjith) | manoranjith#8124 |

## Emeritus Maintainers

<!-- Please keep this sorted alphabetically by github -->

| Name | GitHub | [Chat][_chat-url] |
| ---------------- | ----------------------------------------------- | ----------------- |
| Anagha Sukumaran | [anagha-ks](https://github.com/anagha-ks) | anagha-ks |
| Name | GitHub | [Discord][_chat-url] |
| ---------------- | ----------------------------------------------- | -------------------- |
| Anagha Sukumaran | [anagha-ks](https://github.com/anagha-ks) | |

[_chat-url]: https://chat.hyperledger.org/channel/perun

## Emeritus Maintainers

| Name | GitHub | Chat | Email |
| ------ | ------ | ---- | ----- |
| &nbsp; | | | |
[_chat-url]: https://discord.com/channels/905194001349627914/955484679635632148

---
This work is licensed under a [Creative Commons Attribution 4.0 International
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ CLI_BIN := perunnodecli
TUI_PKG := ./cmd/perunnodetui
TUI_BIN := perunnodetui

DEMO_DIR := demo

LDFLAGS=-ldflags "-X 'main.version=$(VERSION)' -X 'main.gitCommitID=$(GIT_COMMIT_ID)' -X 'main.goperunVersion=$(GOPERUN_VERSION)'"

build:
go build $(LDFLAGS) $(NODE_PKG)
go build $(CLI_PKG)
go build $(TUI_PKG)
install:
go install $(LDFLAGS) $(NODE_PKG)
go install $(CLI_PKG)
go install $(TUI_PKG)

generate: install
@mkdir $(DEMO_DIR)
@cd $(DEMO_DIR) && $(NODE_BIN) generate
@echo "Configuration files for demo generated in ./$(DEMO_DIR)"

clean:
rm -rf $(NODE_BIN) $(CLI_BIN) $(TUI_BIN) node.yaml alice bob
rm -rf demo
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ For a tutorial on using perun-node with `perunnodecli`, see the
on the project documentation website.

For a tutorial on using perun-node with `perunnodetui`, see
[this section](cmd/perunnodetui/Readme.md). A talk on overview of perun,
[this section](cmd/perunnodetui/README.md). A talk on overview of perun,
including a hands-on demo of using the perunnode with `perunnodetui` can be
found [here](https://youtu.be/sASYSJm3QKw?t=916).

## Getting Started

Install the following pre-requisites.

1. Go (v1.14 or later).
1. Go (v1.19 or later).
2. ganache-cli (v6.9.1 or later).

Clone the project and sync the dependencies:
Expand Down Expand Up @@ -114,7 +114,7 @@ Run the linter and tests from the project root directory:
golangci-lint run ./...

# Test
go test -tags=integration -count=1 ./...
go test -tags=integration -count=1 -p=1 ./...

# Build perunnode and perunnodecli binaries
make
Expand Down
82 changes: 82 additions & 0 deletions api/grpc/funding.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright (c) 2023 - for information on the respective copyright owner
// see the NOTICE file and/or the repository at
// https://github.com/hyperledger-labs/perun-node
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package grpc

import (
"context"

"github.com/hyperledger-labs/perun-node/api/grpc/pb"
"github.com/hyperledger-labs/perun-node/api/handlers"
)

// fundingServer represents a grpc server that can serve funding API.
type fundingServer struct {
pb.UnimplementedFunding_APIServer
*handlers.FundingHandler
}

// Fund wraps session.Fund.
func (a *fundingServer) Fund(ctx context.Context, req *pb.FundReq) (*pb.FundResp, error) {
return a.FundingHandler.Fund(ctx, req)
}

// RegisterAssetERC20 is a stub that always returns false. Because, the remote
// funder does not support use of assets other than the default ERC20 asset.
//
// TODO: Make actual implementation.
func (a *fundingServer) RegisterAssetERC20(ctx context.Context, req *pb.RegisterAssetERC20Req) (
*pb.RegisterAssetERC20Resp, error,
) {
return a.FundingHandler.RegisterAssetERC20(ctx, req)
}

// IsAssetRegistered wraps session.IsAssetRegistered.
func (a *fundingServer) IsAssetRegistered(ctx context.Context, req *pb.IsAssetRegisteredReq) (
*pb.IsAssetRegisteredResp,
error,
) {
return a.FundingHandler.IsAssetRegistered(ctx, req)
}

// Register wraps session.Register.
func (a *fundingServer) Register(ctx context.Context, req *pb.RegisterReq) (*pb.RegisterResp, error) {
return a.FundingHandler.Register(ctx, req)
}

// Withdraw wraps session.Withdraw.
func (a *fundingServer) Withdraw(ctx context.Context, req *pb.WithdrawReq) (*pb.WithdrawResp, error) {
return a.FundingHandler.Withdraw(ctx, req)
}

// Progress wraps session.Progress.
func (a *fundingServer) Progress(ctx context.Context, req *pb.ProgressReq) (*pb.ProgressResp, error) {
return a.FundingHandler.Progress(ctx, req)
}

// Subscribe wraps session.Subscribe.

func (a *fundingServer) Subscribe(req *pb.SubscribeReq, stream pb.Funding_API_SubscribeServer) error {
notify := func(notif *pb.SubscribeResp) error {
return stream.Send(notif)
}

return a.FundingHandler.Subscribe(req, notify)
}

func (a *fundingServer) Unsubscribe(ctx context.Context, req *pb.UnsubscribeReq) (*pb.UnsubscribeResp, error) {
return a.FundingHandler.Unsubscribe(ctx, req)
}
Loading