pegnet / pegnetd

The pegnet daemon to track txs, conversions, etc
Other
13 stars 14 forks source link

Add FCT burn command #67

Closed WhoSoup closed 5 years ago

WhoSoup commented 5 years ago

closes: #47

This PR adds the ability to burn FCT / convert FCT to pFCT to the pegnetd binary. Since the FAT library has very limited support for Transactions, I'm using @Emyrk's Transaction struct in order to manually build the transaction. (Thank you every much @Emyrk for including all the various marshaling functions).

Usage: burn <FA-SOURCE> <AMOUNT>

Requires the wallet to retrieve private key of fa-source and submits the transaction to factomd.

I successfully created a test FCT->pFCT conversion:

$ go run . burn FA3debugfUqPcG9ZbQAkjU8BSSJTGJDC6bAQMBYe3zTB4BktZxko 0.01
Successfully submitted the transaction
Transaction ID: 3bfb79454d6ec8f6053d5670c1f17a88c3ecebf5b1e13655f64689fb4c2da32b

https://explorer.factoid.org/transaction?txid=3bfb79454d6ec8f6053d5670c1f17a88c3ecebf5b1e13655f64689fb4c2da32b

Emyrk commented 5 years ago

Yea, that library needs to really have some tx building functions and submissions. But until then, this is good