Closed vsbogd closed 5 years ago
There is a problem.
Which ethereum identity will be used? snet-cli identity or identity of this instance of the daemon?
Now I can ask the main question. Who will be the treasurer server (who will sign the transactions): snet-cli or the instance of the daemon?
Because if it will be the daemon, then it kind of break all logic of snet-cli as owner of identity.
I would argue that in the beta, it would be better to make snet-cli the treasurer server (only snet-cli will actually send transactions). It will allow as to solve the following issues in one place:
Because if we send transaction in snet-cli and in the daemon we need to solve these issue in two places.
https://github.com/singnet/snet-cli/issues/111 and https://github.com/singnet/snet-cli/issues/67 can be solved in daemon code base as well.
Results of offline discussion with @astroseger:
StartClaim()
Claim.Finish()
Claim.Payment()
ListClaims()
snet-cli
to implement claim
commandsnet-cli
can manage Ethereum transactions internally like it does it now for Registry or MPE contractssnet-cli
interface for Ethereum transaction management could be improved further; in general it could be aligned with common approach used in existing Ethereum based DAppssnet-cli
, more natural is to use separate service like treasurer to control transactions automatically and make snet-cli
to be console to this service.@raamb So the questions is: who will do it in the daemon?
@astroseger the Bangalore team will pick this up.
Discussed with @astroseger about this. We have a functional way of claiming funds for now, we will evaluate if this is absolutely required for Beta or not. As Sergey pointed out if Daemon is unable to support hardware wallets etc we will have to get this done. Initial estimates indicate that it would be 2-3 man days worth of work.
This is required for the beta, of course. Unless I'm missing something, there is no reason the daemon should even know about hardware wallets, etc. The daemon is a server-side deployment component, it should not be the component signing these mainnet transactions. The cli is a "service owner admin" component, it makes far more sense for any signing of "real money" transactions to be done there.
One of the reasons for the Arbiter contract design was to prevent having to give the daemon private keys to a meaningfully funded wallet. That's still a requirement.
The way it is implemented right now means that daemon doesn't need access to the private key to collect and validate the payments. But to implement collecting payments as soon as possible we have implemented separate console tool which reuses daemon code to claim the payments. This tool can be used separately from daemon and its configuration. I agree that it makes sense to move payment management cli into snet-cli
tool, but it requires additional development.
@pennachin
In the current implementation "snet-daemon" has two completely separated components "the daemon" and "the treasurer server".
But in the current implementation "the treasurer server" is very "thin". It is actually a command line tool.
It makes a lot of sense to move "the treasurer server" functionality to snet-cli. It will make snet-cli only one owner of Ethereum identity. And, as I understand, it is very easy to do (see description from @vsbogd ).
And in the future I would suggest to build the real " treasurer server" around snet-cli, in order to have single Ethereum identity manager.
@astroseger this makes a lot of sense to me.
@astroseger agreed; much more elegant
I guess my comment "Daemon is unable to support hardware wallets etc" was the cause of some confusion, my apologies. I was referring to the treasurer component of the daemon by this statement not the Daemon itself.
was closed with #162
At the moment channel claiming is implemented within
snet-daemon
throughsnet-daemon claim
interface. This command should be moved into thesnet-cli
tool.Possible way to implement it is to add additional gRPC interface to the daemon to:
This interface will be implemented by separate daemon instance: treasurer server.
Use this interface to implement
snet-cli claim
command.See https://github.com/singnet/snet-cli/issues/134#issuecomment-443182697 for more detailed description