Setting up addresses
Once you have the self node running, you will need to set up your wallet and transactions. You do not need to create a wallet manually because you can use addresses generated by the JCLI for testing purposes. All interaction with your wallet needs to be done using the JCLI because there is no integration with Daedalus in this phase of the testnet rollout.
You do need several UTXO addresses so that you can create transactions. To generate these addresses, follow these steps:
- Generate the private key, for example, Ed25519:
> jcli key generate --type=Ed25519To see other options, run jcli key generate --help
- Extract the associated public key:
>echo ed25519_sk1cvac48ddf2rpk9na94nv2zqhj74j0j8a99q33gsqdvalkrz6ar9srnhvmt | jcli key to-public
- Alternatively, save your private key to file and run this command:
>jcli key to-public --input secret.key
Create your address based on the public key:
jcli address account --prefix addr --testing
To create a transaction, follow these steps:
- Create a staging area for the new transaction.
- Add the input for the transaction.
- Add the output for the transaction.
- Next, you need to add the fee and change address.
- Create the witness to sign the transaction.
- Add the witness to the transaction.
- Send the transaction using the rest API.
- Check the node logs to see if the transaction was accepted successfully. The output from this process is a transaction hash and one of the following block statuses:
- InABlock: the transaction has been added to a block; includes the date on which the transaction was accepted.
- Pending: the transaction was received, but has yet to be added to the blockchain.
- Rejected: the transaction was not accepted; a message is attached to outline the reason for rejection.