You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

0 D铆as
7 Hrs
40 Min
28 Seg
Curso de Bitcoin Core y Script

Curso de Bitcoin Core y Script

Juan Sebasti谩n Marulanda

Juan Sebasti谩n Marulanda

Transacciones usando bitcoin-cli

12/19
Resources

Bitcoin-cli allows you to do everything you probably already know about Bitcoin and the Blockchain world. Explore transactions, create wallets, send and receive BTC through a transaction, among other functionalities.

Wallets and transactions with bitcoin-cli

A good first step to play with bitcoin-cli is to create a wallet and manage to receive or send value with it. Let's go step by step and learn more about how to use the bitcoin-cli.

Step 1: creating the wallet

To create your first wallet just run the command bitcoin-cli createwallet "". Note that the command may fail if you already have a wallet created on your computer.

To verify the existence of the wallet, use the command ls /.bitcoin/data/testnet3/wallets/.

Creaci贸n de billetera con bitcoin-cli

Remember that Bitcoin stores all kinds of serialized information in .dat files.

Step 2: create new address

After creating the wallet, you need to create an address inside the wallet in order to receive or send funds. The simple command bitcoin-cli getnewaddress -addresstype legacy will allow you to perform this action and you will see the address created in the console.

Creaci贸n de direcci贸n con bitcoin-cli

Step 3: Obtaining funds

If you already have your address, you will need a Bitcoin faucet to obtain test BTC. For that, it is necessary that your node is running on the tesnet. If you decided to run it on the mainnet, you will have to use real BTC.

There are several Bitcoin faucets you can use to get some BTC, you can explore some of them:

Note: some faucets are not stable and stop working over time or you have momentary problems. Try repeatedly until you find one that can give you some BTC to continue your testing.

Once you have located a faucet, copy the address obtained in the previous step, enter it and in a matter of minutes you will get some Satoshis.

Check your wallet balance with the bitcoin-cli getbalance command.

Verificaci贸n del balance de una wallet con bitcoin-cli

Step 4: Transaction confirmation

You can also confirm your transaction by checking how many blocks above the block containing your transaction. Many companies expect, for example, 5 or 10 blocks to be sure that their transactions have been successfully confirmed.

To do this, use the command bitcoin-cli getbalance "*" N, where N is the number of blocks you want to check to confirm your transaction.

Confirmaci贸n de transacciones con bitcoin-cli

Step 5: List of transactions

View all transactions related to your wallet with the bitcoin-cli listtransactions command. You will see all the information associated with each transaction.

To inspect a particular transaction, copy the txid and use the bitcoin-cli gettransaction <txid> command.

Get even more information about a transaction with the bitcoin-cli gettransaction <txid> false true command such as the input and output scripts.

Step 6: Send BTC

Having your wallet ready, an address and after you have requested test funds, you can create a transaction to send BTC to another address.

The command bitcoin-cli sendtoaddress <address> 0.0001 will allow you to send value to another wallet. Just make sure you have sufficient funds and enter the destination address correctly.

Env铆o de BTC a trav茅s de bitcoin-cli

This command will return the txid of the transaction which you can inspect as you have done in the previous step.

Conclusion

You have seen how easy it is to use bitcoin-cli to create a wallet, addresses, obtain and send bitcoins through a text interface.

Remember that these commands work through RPC over HTTP, so they are the basis for building any web or mobile application such as a bitcoin browser, wallet or other type of app for exchanging value between users.


Contributed by: Kevin Fiorentino (Platzi Contributor).

Contributions 5

Questions 0

Sort by:

Want to see more contributions, questions and answers from the community?

RESUMEN CLASE 12:
TRANSACCIONES USANDO
BIYCOIN-CLI

Creamos una nueva wallet

$ bitcoin-cli createwallet ""

Verificamos que se creo la billetera

$ ls /.bitcoin/data/testnet3/wallets/

Creamos nuestra direccion

$ bitcoin-cli getnewaddress -addresstype legacy

Algunos faucets destacados para obtener bitcoins

Verificamos nuestro balance

$ bitcoin-cli getunconfirmedbalance

Para conocer el balance de las transacciones iniciadas

$ bitcoin-cli getbalance

Este curso esta increible, es muy tecnico y a veces dure de entender pero la informacion que nos da el profe es muy valiosa.

Comenzando a entender, fue importante llevar primero el curso de Git y GitHub

Muy buena clase!
Es intuitivo utilizar el CLI y es la base para desarrollar cualquier tipo de aplicaci贸n web.

Tengo un macbook y se me dificulto seguir el repo del profe, usea aqu铆 una guia para quienes tienen mac. https://givan.se/build-test-deploy-bitcoin-on-monterey/