Skip to content

Conversation

@manoranjith
Copy link

Description

Category
Relevant issue

Testing

Steps to run the tests

Needs to be tested along with an embedded implementation, which will use this API.
This will be documented separately.

Checklist

  • Name is added to the NOTICE file, if it is not present already.
  • Changes are rebased onto the target branch.

choeppler and others added 30 commits March 15, 2023 09:49
- fix links to Hyperledger chat
- remove duplicate "Emeritus Maintainers"-section introduced in
  8526c80.

Signed-off-by: Chris Hoeppler <christian.hoeppler@de.bosch.com>
Signed-off-by: Jason Stallings <142006+octalmage@users.noreply.github.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Also update the path for perun generic library packages to from
  "perun.network/go-perun/pkg/sync" to "polycry.pt/poly-go/sync" as
  this library was moved in the newer version of go-perun.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Use LatestSignerForChainID instead of NewEIP155Signer.

- Use channel.Asset type instead of wallet.Address in relevant places.

- Use Update instead of UpdateBy with new signature for updater func.

- Rename wallet.Address.(Equals -> Equal)

- Update all mocks with latest version of mockery (separate this
  change).

- Use updated signature for NewBus and pass the serializer explicitly.

- Use updated signature for listner.Accept and pass the serializer
  explicitly.

- Replace usage of Bytes method on Address with MarshalBinary.

- Adapt to rename of some of the data types.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Also, update the syntax for protoc command, as the compiler for grpc
  bindings has now been separated from the one for protobuf bindings.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Because, the older version is not compatible with go version 1.19.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Because the syntax for configuring this linter has changed.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Because the rules for newer version of gofumpt has been updated.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Run goimports with "-local github.com/hyperledger-labs/perun-node"
  option.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Because the updated version of linter requires doc comments for main
  packages as well.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Because package has been depricated since go 1.17.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- These errors were not detected by older version of revive.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- go1.19 introduced new formatting directives have been for comments.

- The new syntax is "//toolname:directive".

- For more details, see the syntax section in this page -
  "https://go.dev/doc/comment".

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- For tests using ganache-cli, parallelism should be set to 1 to ensure
  the correct incrementation of nonce used in creating transactions.

Signed-off-by: manoranjith <ponraj.manoranjitha@in.bosch.com>
- In preparation for adding new apis - funding and watching.

- Split "api.proto" file into three smaller parts, so that they can be
  extended later and move them to a separate directory.

- Also, split the related files in api/grpc accordingly.

- Move the file with "go generate" directory to project root.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Use the following syntax consistently:
  1. From<type> for funcs that convert from perun to protobuf types.
  2. To<type> for funcs that convert from protobuf types to perun.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- As these functions are closely coupled to protobuf bindings and do not
  implement any application logic, they fit better in "pb" package.

- Also, move the tests on types in generated go bindings to "pb"
  package.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Include all methods defined by the Funder interface.

- Also, update the command for generating protobufs.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Because the client initialization itself is not specific to ethereum
  blockchain or payments application.

- Instead, the funder, adjudicator and wallet instances are passed as
  abstract interfaces and it is in the higher layer APIs, the
  functionality is limited to payments.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- However, only local is supported now.

- Also, add a nolint:funlen directive for session.New function.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Common types used across the perun-node project (including errors) are
  defined in perun-node package.

- Hence, these definitions fit better in the perun package.

- Trigger for this change:
  - to implement client side logic for grpc funder (in session package),
    the grpc/pb package is needed, which creates an import cycle.
  - because grpc/pb package imports payments package, which inturn
    imports sessions package.
  - and payment package is importing session package only for using the
    error constants.
  - hence moving these error constants breaks the import cycle by
    removing the need for payments package to import sessions package.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Manoranjith added 23 commits August 17, 2023 13:31
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Also, move the grpcFunder to a separate file.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- The filesToMove array was not populated. Hence, the directories were
  empty. To fix, populate this array properly.

- The idProvider.yml include only the own alias. To fix, modify the
  logic to include everything except own alias.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Change build command to install. This installs the binaries in $GOBIN
  directory.

- Add generate command that generates the artefacts for demo.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- Previously, the nested map was not initialized. This caused a panic
  when Register was invoked.

- Initializing the map fixes this it.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- ETH asset is registered by default already during the initialization
  fo the funder.

Signed-off-by: manoranjith <ponraj.manoranjitha@in.bosch.com>
- The key can be used for initializing pre-funded accounts in
  ganache-cli or for initializing the same keys for tests in alternate
  clients (like rust implementation).

Signed-off-by: manoranjith <ponraj.manoranjitha@in.bosch.com>
- Add a flag to run command to specify the service to run.
- Split the serve function in gprc package.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- This is a temporary workaround to enable the existing version of
  perunnode-cli to connect with the API in fundwatch only mode to
  generate a session-id by opening a session.

- Once, the perunnode-cli is updated, this can be undone.

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- The extracted handlers use in golang standard context, protobuf
  request/response messages.

- Hence, these can be shared between grpc and other upcoming
  implementations (like peruniotcp server).

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
- The extracted handlers use in golang standard context, protobuf
  request/response messages.

- Hence, these can be shared between grpc and other upcoming
  implementations (like peruniotcp server).

Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
@manoranjith manoranjith force-pushed the perunio-api branch 2 times, most recently from 6899640 to 4946237 Compare December 14, 2023 16:04
manoranjith added 2 commits December 14, 2023 17:07
- Define a api_messages.proto as a enum of all the funding and watching
  services.

- This is needed, for parsing of the request, because unlike grpc, tcp
  adapter using perunio's custom messaging scheme does not have an
  in-built routing mechanism.

Signed-off-by: manoranjith <ponraj.manoranjitha@in.bosch.com>
- Also combine the commands for watching and funding service, because
  the api_messages.proto depends on both of these definitions.

Signed-off-by: manoranjith <ponraj.manoranjitha@in.bosch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants