|
| 1 | +--- |
| 2 | +title: "Get a signature" |
| 3 | +lead: "Getting a signature from the network is the primary purpose of Entropy. This page walks you through the different ways in which you can get a signature." |
| 4 | +--- |
| 5 | + |
| 6 | +{{< callout "info" >}} |
| 7 | +**Prepare your account**: The account you are using must be [registered]({{< relref "../guides/register-an-account.md" >}}) and have [funds]({{< relref "../guides/get-funds.md" >}}) in order to get a signature. |
| 8 | +{{< /callout >}} |
| 9 | + |
| 10 | +## Text-based interface |
| 11 | + |
| 12 | +An easy-to-understand way to get a signature is by using the text-based interface (TUI) within the [Entropy CLI]({{< relref "../reference/command-line-interface.md" >}}). |
| 13 | + |
| 14 | +1. Ensure that you have the CLI installed and start it up: |
| 15 | + |
| 16 | + ```shell |
| 17 | + entropy |
| 18 | + ``` |
| 19 | + |
| 20 | + ```output |
| 21 | + @@@@@@@@@@ @@@@@@@@@@ @@@@@ @@@@@@@@@@@ @@@@@@@@@ @@@@@@@@@@ @@@@@ @@@@@ |
| 22 | + @@@@@@@@@@ @@@@@@@@@@ @@@@@ @@@@@@@@@@@ @@@@@@@@@ @@@@@@@@@@ @@@@@ @@@@@ |
| 23 | + @@@@@@@@@@ @@@@@@@@@@ @@@@@@@ @@@@@@@@@@@ @@@@@@@@@ @@@@@@@@@@ @@@@@ @@@@@ |
| 24 | + @@@@@ @@@@ @@@@@ @@@@ @@@@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 25 | + @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 26 | + @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 27 | + @@@@@@@@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 28 | + @@@@@@@@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 29 | + @@@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 30 | + @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 31 | + @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 32 | + @@@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ @@@@@ @@@@@ |
| 33 | + @@@@@@@@@@ @@@@@ @@@@ @@@@@@@ @@@@@ @@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@ |
| 34 | + @@@@@@@@@@ @@@@@ @@@@ @@@@@@@ @@@@@ @@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@ |
| 35 | + @@@@@@ TEST |
| 36 | + @@@@@@ *NET |
| 37 | + @@@@@@ ENTROPY-CLI |
| 38 | + @@@@@@ COREv0.1.0 |
| 39 | +
|
| 40 | + ? Select Action |
| 41 | + Manage Accounts |
| 42 | + Balance |
| 43 | + Register |
| 44 | + Sign |
| 45 | + Transfer |
| 46 | + Deploy Program |
| 47 | + User Programs |
| 48 | + ❯ Exit |
| 49 | + ``` |
| 50 | + |
| 51 | +1. Select the account you want to get a signature for by going to **Manage Accounts** and **Select Account**. |
| 52 | +1. Return to the main menu and select **Sign**. |
| 53 | +1. Select **Sign With Adapter**. |
| 54 | +1. The TUI needs to use an existing text editor on your computer to create the message. Select **Text Input** and press `ENTER` again to launch the default text editor in your terminal. |
| 55 | +1. Enter the message you want to get a signature for into the text editor. Save and quit the text editor once you have entered your message. |
| 56 | +1. The TUI will output your message along with the verifying key used and the signature for that message: |
| 57 | + |
| 58 | + ```output |
| 59 | + verifying key: 0x023a21cf07207ed70da47f5a035a1b756ecb6a9eaeb5a1757a64b283fc53c98b3e |
| 60 | + signature: 0x75285f9e1f13b60629c83a8c9f184137b332cf7cd1cc2b02229cb59dc00e68946814fb4585a678a90c324ecdda347e24cf8a2a802ea72d6c1cbae17daa94339200 |
| 61 | + ``` |
| 62 | + |
| 63 | +1. The **signature** value is _the_ signature generated by the signing committee for your chosen message. |
| 64 | + |
| 65 | +## Command-line interface |
| 66 | + |
| 67 | +You can get a signature programmatically by using the CLI directly through your terminal. |
| 68 | + |
| 69 | +1. Ensure that you have the CLI installed: |
| 70 | + |
| 71 | + ```shell |
| 72 | + entropy --help |
| 73 | + ``` |
| 74 | + |
| 75 | + ```output |
| 76 | + CLI interface for interacting with entropy.xyz. Running without commands starts an interactive ui |
| 77 | +
|
| 78 | + Options: |
| 79 | + -e, --endpoint <endpoint> |
| 80 | +
|
| 81 | + ... |
| 82 | + ``` |
| 83 | + |
| 84 | +1. Request a signature by using the `sign` command with the address you want to use, and the message you want to sign: |
| 85 | + |
| 86 | + ```shell |
| 87 | + entropy sign <address> <message> |
| 88 | + ``` |
| 89 | + |
| 90 | + For example: |
| 91 | + |
| 92 | + ```shell |
| 93 | + entropy sign '5CrFp9txcb5UECpNKsD6DTBsG4cj1z58DA43YikSVeeJqXJR' 'This is a message.' |
| 94 | + ``` |
| 95 | + |
| 96 | +1. Assuming your account has been registered and has enough funds, the network will return your signature: |
| 97 | + |
| 98 | + ```output |
| 99 | + { |
| 100 | + "0": 117, |
| 101 | + "1": 89, |
| 102 | + "2": 128, |
| 103 | +
|
| 104 | + ... |
| 105 | +
|
| 106 | + "62": 196, |
| 107 | + "63": 124, |
| 108 | + "64": 0 |
| 109 | + } |
| 110 | + ``` |
| 111 | + |
| 112 | +Take a look at the [CLI reference page]({{< relref "../reference/command-line-interface.md" >}}) for more information on how to use the Entropy CLI programmatically. |
0 commit comments