Git Product home page Git Product logo

go-perun_archived's People

Contributors

anagha-ks avatar cryptphil avatar ggwpez avatar manoranjith avatar matthiasgeihs avatar rmbrt avatar sebastianst avatar tinnendo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-perun_archived's Issues

[init/db] db.ChanIterator & Co design

Current State  The db.ChanIterator is a pair of channels: One for db.Item values and one for errors. It is used as a simpler representation of an iterator. db.IteratorChanWrapper seems to be a default implementation of the interface. It is created using db.AsChanIterator(Iterator).

Problem  The name is awkward, as ChanIterator suggests that the type itself is an iterator (which it is not, it is a pair of channels). It also suggests that it iterates over a list of channels, which it is not, either. Additionally, IteratorChanWrapper is inconsistently named with ChanIterator. AsChanIterator feels awkward.

Improvement Proposal  I suggest that the interface be named more descriptive of what it is, i.e. "Response", "ItemChannel", "Items". I also suggest that IteratorChanWrapper be named Default* or *Impl (where * is one of the previous names), as it seems to me that it is simply a default implementation of the interface. Default*/*Impl seems more descriptive to me than *Wrapper, because it actually wraps around the db.Iterator type, not around the IteratorChan type. I suggest AsChanIterator be made a member of the Iterator interface, and be renamed to To* or As* (i.e., ToItemChannel, ToItems). This coupling makes sense to me, as it is easier to read when used, and I think it is the predominant way in which the Iterator interface is read from anyway.

[init/wallet] common.Address design

Current state  Currently, the type common.Address is just a generic implementation using a byte array, and utilities for conversion to/from hex strings.

Problem  This may prove insufficient, as not every byte array is necessarily a valid address for a given cryptocurrency, and some cryptocurrencies might display addresses in base58 or similar, which would lead to confusion if perun didn't support that representation.

Improvement Proposal  I propose that we use a more differentiated interface, which allows individual cryptocurrencies to have a better-fitting data model. Additionally, I suggest we provide a default generic implementation, which is similar to the current one, so that lazy developers can use addresses without implementation overhead.
I suggest the common.Address interface contains:

  • ToString() string: Human-readable string (as employed by the cryptocurrency it belongs to, might be hex, base58, …).
  • FromString(string) (*Address, error): Parsing of a human-readable representation.
  • FromBytes([]byte) (*Address, error): Simple raw deserialisation.
  • ToBytes() []byte: Simple raw serialisation.

Additionally, it might be of interest to additionally store which domain/blockchain an address belongs to, in order to make debugging and error checking easier.
I suggest the default implementation be named common.GenericAddress, and consist of a byte array, and represents addresses as hex strings.

CI-Pipeline

Testing & CI/CD is an integral part of our workflow.

Current state  We do not have any ci-pipeline.

Improvement Proposal
For setting up a pipeline we need the following things (sorted by importance):

  • Repo on the cac gitlab
  • CI-Server on our cluster
  • A name for our cluster (I would propose Entoron)
  • A Makefile for our code
  • A gitlab-yaml file with the configuration
  • A code-coverage tool
  • rules for pushing/merging PRs
  • GoReport Card

CI: Fix CI / Travis-ci.org will be shutting down / Move to GitHub Actions?

The Travis CI is currently in a failure state. This should be fixed.

Furthermore, travis-ci.org has a banner that the service will shut down in a few weeks and accounts will be moved to travis-ci.com. This will probably cause us to reconfigure the Travis CI script. On this occasion, we could just switch to using GitHub Actions for CI. Or is there an argument against that?

[init/make]Makefile issues

There are several issues with the Makefile, probably related to the fact that this is a go module.

go list

go list github.com/perun-network/go-perun, which is called by the Makefile at the beginning, returns

can't load package: package github.com/perun-network/go-perun: unknown import path "github.com/perun-network/go-perun": cannot find module providing package github.com/perun-network/go-perun

make dep

AFAIK go get is not required any more with modules

make build

We don't have any binary yet to build. Probably the test target, which runs go test, is sufficient for the foreseeable future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.