|
| 1 | +--- |
| 2 | +title: Address book operations |
| 3 | +description: Storing your blockchain contacts for future use |
| 4 | +--- |
| 5 | + |
| 6 | +# `addressbook` |
| 7 | + |
| 8 | +If you repeatedly transfer tokens to the same recipients or if you just want to |
| 9 | +store an arbitrary address for future use, you can use the `addressbook` |
| 10 | +command to **name the address and store it in your address book**. Entries |
| 11 | +in your address book are behaving similarly to the |
| 12 | +[accounts stored in your wallet][wallet], for example when checking the balance |
| 13 | +of the account or sending tokens to. Of course, you cannot sign any |
| 14 | +transactions with the address stored in your address book since you do not |
| 15 | +possess the private key of that account. Both the Oasis native and the |
| 16 | + |
| 17 | +:::info |
| 18 | + |
| 19 | +The name of the address book entry may not clash with any of the account names |
| 20 | +in your wallet. The Oasis CLI will prevent you from doing so. |
| 21 | + |
| 22 | +::: |
| 23 | + |
| 24 | +[wallet]: wallet.md |
| 25 | + |
| 26 | +## Add entry |
| 27 | + |
| 28 | +Use `addressbook add <name> <address>` to name the address and store it in your |
| 29 | +address book. |
| 30 | + |
| 31 | +``` |
| 32 | +$ oasis addressbook add mike oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw |
| 33 | +$ oasis addressbook add meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 34 | +``` |
| 35 | + |
| 36 | +Then, you can for example use the entry name in you address book to send the |
| 37 | +tokens to. In this case, we're sending `2.5 TEST` to `meghan` on Sapphire |
| 38 | +Testnet: |
| 39 | + |
| 40 | +``` |
| 41 | +$ oasis account transfer 2.5 meghan |
| 42 | +Unlock your account. |
| 43 | +? Passphrase: |
| 44 | +You are about to sign the following transaction: |
| 45 | +Format: plain |
| 46 | +Method: accounts.Transfer |
| 47 | +Body: |
| 48 | + To: meghan (oasis1qrjzcve7y6qp3nqs3n7ghavw68vkdh3epcv64ega) |
| 49 | + Amount: 2.5 TEST |
| 50 | +Authorized signer(s): |
| 51 | + 1. ArEjDxsPfDvfeLlity4mjGzy8E/nI4umiC8vYQh+eh/c (secp256k1eth) |
| 52 | + Nonce: 0 |
| 53 | +Fee: |
| 54 | + Amount: 0.5002316 TEST |
| 55 | + Gas limit: 5002316 |
| 56 | + (gas price: 0.0000001 TEST per gas unit) |
| 57 | +
|
| 58 | +Network: testnet |
| 59 | +ParaTime: sapphire |
| 60 | +Account: eugene |
| 61 | +``` |
| 62 | + |
| 63 | +## List entries |
| 64 | + |
| 65 | +You can list all entries in your address book by invoking `addressbook list`. |
| 66 | + |
| 67 | +``` |
| 68 | +$ oasis addressbook list |
| 69 | +NAME ADDRESS |
| 70 | +meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 71 | +mike oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw |
| 72 | +``` |
| 73 | + |
| 74 | +## Show entry |
| 75 | + |
| 76 | +You can check the details such as the native Oasis address of the Ethereum |
| 77 | +account or simply check, if an entry exists in the address book, by running |
| 78 | +`addressbook show <name>`: |
| 79 | + |
| 80 | +``` |
| 81 | +$ oasis addressbook show meghan |
| 82 | +Name: meghan |
| 83 | +Ethereum address: 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 84 | +Native address: oasis1qrjzcve7y6qp3nqs3n7ghavw68vkdh3epcv64ega |
| 85 | +
|
| 86 | +$ oasis addressbook show mike |
| 87 | +Name: mike |
| 88 | +Native address: oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw |
| 89 | +``` |
| 90 | + |
| 91 | +## Rename entry |
| 92 | + |
| 93 | +You can always rename the entry in your address book by using |
| 94 | +`addressbook rename <old_name> <new_name>`: |
| 95 | + |
| 96 | +``` |
| 97 | +$ oasis addressbook list |
| 98 | +NAME ADDRESS |
| 99 | +meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 100 | +mike oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw |
| 101 | +
|
| 102 | +$ oasis addressbook rename mike mark |
| 103 | +
|
| 104 | +$ oasis addressbook list |
| 105 | +NAME ADDRESS |
| 106 | +mark oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw |
| 107 | +meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 108 | +``` |
| 109 | + |
| 110 | +## Remove entry |
| 111 | + |
| 112 | +To delete an entry from your address book use `addressbook remove <name>`. |
| 113 | + |
| 114 | +``` |
| 115 | +$ oasis addressbook list |
| 116 | +NAME ADDRESS |
| 117 | +meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 118 | +mike oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw |
| 119 | +
|
| 120 | +$ oasis addressbook remove mike |
| 121 | +
|
| 122 | +$ oasis addressbook list |
| 123 | +NAME ADDRESS |
| 124 | +meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1 |
| 125 | +``` |
0 commit comments