I can see three methods related to channel close or disconnect in the sdk.
Disconnect()
Leave()
Shutdown()
I am kind of confused between them. Which is among them is on-chain activity. As I understand shutdown should be on-chain activity, but when I call it, it responds almost instantly, Why?
Well it is @nduchak.chain who supports the SDK, my 2 cents:
Disconnect() - abruptply destroys the WebSocket connection. Participant just “disappears” from the other participant’s point of view
Leave() - handles the channels.leave method - in this case it is the expected way of temporarily closing the connection. Meaning “hey, I am going offline but I will be back”. docs
Shutdown() - handles channels.shutdown method. This is the on-chain final closing of the channel where tokens are redistributed between participants on-chain. This deletes the channel on-chain. docs
This strongly depends on your (local) setup. What response are you receiving?
Hey I got a transaction with type channelCloseMutual when I parse it on laboratory. I need to verify the transaction hash and the balances on the network. I will update here. The reason I was confused is, when I create channel, it takes time but shutdown is almost instant so I thought whether the mining happens or not. anyways thanks for pointing out those docs.
By the way this line is confusing
This can be done by either of the parties. The process is similar to the off-chain updates.
The phrase Off-chain was confusing to me because update is off chain activity whereas shutdown is on chain activity. so comparing the shutdown with update is what confusing. (this is just my personal opinion)
I am almost done with my work in payment channel, soon this feature will be integrated on the AE-Lab for people to play around with.