Add method to preemptively open payment channel
emschwartz opened this issue · comments
For my use case I'd like to ensure that a payment channel is opened to the receiver when the sender starts up (and I can get the receiver's address before I actually want to load content from them). It would be nice if there were an easy way to open a payment channel without actually paying the receiver.
There is a (hacky) way for doing this:
- Instantiate Machinomy object, setting
minimumChannelAmount
to an expected channel amount (https://github.com/machinomy/machinomy/blob/master/index.ts#L48 and https://github.com/machinomy/machinomy/blob/master/index.ts#L109). - Do
machinomy.buy
withprice
set to 0. (https://github.com/machinomy/machinomy/blob/master/index.ts#L21)
Would that fit the case?
Yup, that worked. Thanks!
Yay! Cool.