Browse Source

book/testnet: Notes on token minting.

parazyd 3 years ago
parent
commit
6c5266c6a6
2 changed files with 43 additions and 8 deletions
  1. 40 5
      doc/src/testnet/airdrop.md
  2. 3 3
      doc/src/testnet/payment.md

+ 40 - 5
doc/src/testnet/airdrop.md

@@ -2,15 +2,12 @@
 
 
 Now you have your wallet set up. Let's proceed with getting some
 Now you have your wallet set up. Let's proceed with getting some
 tokens from the faucet. The testnet has a running faucet which is
 tokens from the faucet. The testnet has a running faucet which is
-able to airdrop arbitrary tokens. For example purposes, we'll use
-the tokens called `DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq` and
-`BobvfQrDaf32VNhVtX6Adyi3WGfPpPYZPJBn6rnrxHKm`
+able to airdrop native network tokens. 
 
 
 So let's airdrop some of these into our wallet:
 So let's airdrop some of these into our wallet:
 
 
 ```
 ```
-$ ./drk airdrop 42.69 DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq
-$ ./drk airdrop 13.37 BobvfQrDaf32VNhVtX6Adyi3WGfPpPYZPJBn6rnrxHKm
+$ ./drk airdrop 42.69
 ```
 ```
 
 
 There is a limit of 100 for testnet airdrops currently.
 There is a limit of 100 for testnet airdrops currently.
@@ -33,3 +30,41 @@ You can check your wallet balance using `drk`:
 $ ./drk wallet --balance
 $ ./drk wallet --balance
 ```
 ```
 
 
+# Minting tokens
+
+On the DarkFi network, we're also able to mint custom tokens with
+some supply. To do this, we need to generate a mint authority keypair,
+and derive a token ID from it. We can simply do this by executing the
+following command:
+
+```
+$ ./drk token generate-mint
+```
+
+This will generate a new token mint authority and will tell you what
+your new token ID is. For tutorial purposes, let's assume the tokens
+we will be minting are `DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq`
+and `AcABG4fnmBuT5vuXV8TLdEV8panhk5SdtBZxCCLqQxyL`.
+
+You can also list your mint authorities with:
+
+```
+$ ./drk token list
+```
+
+Now let's mint some tokens to ourself. First grab your wallet address,
+and then create the token mint transaction, and finally - broadcast it:
+
+```
+$ ./drk wallet --address
+$ ./drk token mint DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq 42.69 YOUR_ADDRESS > mint_tx
+$ ./drk broadcast < mint_tx
+
+$ ./drk token mint AcABG4fnmBuT5vuXV8TLdEV8panhk5SdtBZxCCLqQxyL 20.0 YOUR_ADDRESS > mint_tx
+$ ./drk broadcast < mint_tx
+```
+
+Now the transaction should be published to the network. If you have
+an active block subscription (which you can do with `drk subscribe`),
+then when the transaction is finalized, your wallet should have your
+new tokens listed when you request to see the balance.

+ 3 - 3
doc/src/testnet/payment.md

@@ -1,8 +1,8 @@
 # Payments
 # Payments
 
 
-Using the tokens we got, we can make payments to other addresses. Let's
-try to send some `DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq` tokens
-to `8sRwB7AwBTKEkyTW6oMyRoJWZhJwtqGTf7nyHwuJ74pj`:
+Using the tokens we minted, we can make payments to other addresses.
+Let's try to send some `DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq`
+tokens to `8sRwB7AwBTKEkyTW6oMyRoJWZhJwtqGTf7nyHwuJ74pj`:
 
 
 ```
 ```
 $ ./drk transfer 2.69 DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq \
 $ ./drk transfer 2.69 DARKfZX1utGbz8ZpnvtCH6i46nSDZEEGa5fMnhoubWPq \