Переглянути джерело

localnet/darkfid: Swaps guide.

parazyd 3 роки тому
батько
коміт
67644fd402
1 змінених файлів з 27 додано та 1 видалено
  1. 27 1
      contrib/localnet/darkfid/README.md

+ 27 - 1
contrib/localnet/darkfid/README.md

@@ -95,4 +95,30 @@ subscribers so you'll see the balance changes.
 
 ## Swaps
 
-TODO
+We can also try to swap some coins between `darkfid1` and `darkfid2`.
+
+First `darkfid1` will initiate the 1st half of the swap, and send it
+to `darkfid2`:
+
+```
+$ ./drk -e tcp://127.0.0.1:8440 otc init \
+    -v 14.24:66.41 \
+    -t A7f1RKsCUUHrSXA7a9ogmwg8p3bs6F47ggsW826HD4yd:BNBZ9YprWvEGMYHW4dFvbLuLfHnN9Bs64zuTFQAbw9Dy \
+    > half_swap
+```
+
+Then `darkfid2` can create the second half and send it back to
+`darkfid1`:
+
+```
+$ ./drk -e tcp://127.0.0.1:8540 otc join < half_swap > full_swap
+```
+
+And finally `darkfid1` can sign and broadcast it:
+
+```
+$ ./drk -e tcp://127.0.0.1:8440 otc sign < full_swap > signed_swap
+$ ./drk -e tcp://127.0.0.1:8440 broadcast < signed_swap
+```
+
+After finalization, the balances should update.