Skip to content

Latest commit

 

History

History
158 lines (109 loc) · 3.36 KB

gcp-shell-tutorial.md

File metadata and controls

158 lines (109 loc) · 3.36 KB

Bitcoin in Action playground!!!

Benvenuto!!!

Avviando questo tutorial verrai guidato nei primi passi che ti consentiranno di

  • Scaricare ed installare la versione 0.21 di Bitcoin Core
  • Accendere due nodi Bitcoin e un blockchain explorer
  • Piovono bitcoinsss!!!
  • Connettere altri nodi Bitcoin

Scaricare ed installare la versione 0.21 di Bitcoin Core

Esegui il seguente snippet per scaricare Bitcoin Core 0.21

wget https://bitcoincore.org/bin/bitcoin-core-0.21.0/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz && \
tar xzvf bitcoin-0.21.0-x86_64-linux-gnu.tar.gz && \
mv bitcoin-0.21.0/* bitcoin-core && \
rm -Rf bitcoin-0.21.0 && \
rm -Rf bitcoin-0.21.0-x86_64-linux-gnu.tar.gz

Cambiare permessi della cartella utilizzata da MySQL

chmod -R 777 mempool.space/mysql/

Accendere due nodi Bitcoin e un blockchain explorer

docker-compose pull
docker-compose up

Attendere messaggio come descritto al seguente indirizzo

waiting-for-bitcoind-sync-to-finish

Block explorer

Click and change the preview port to 8094.

Click and change the preview port to 18080.

Bitcoin full node API

Click and change the preview port to 18443.

You'll got a 404

  • Change the last part of URL with /rest/chaininfo.json to see the blockchain state.
  • Change the last part of URL with /rest/mempool/info.json to see the mempool state.

Piovono bitcoinsss!!!

to open a new shell leaving docker-compose running

cd cloudshell_open/bitcoin-in-action-playground
docker exec -ti hansel bash
bitcoin-cli createwallet "il_mio_primo_wallet"
bitcoin-cli generatetoaddress 1 $(bitcoin-cli getnewaddress)

Verificare i fondi

bitcoin-cli getwalletinfo

Connettere altri nodi Bitcoin

Rendere raggiungibile il tuo nodo "hansel"

cd cloudshell_open/bitcoin-in-action-playground
./gcp-shell-install-ngrok.sh
ngrok start hansel_18444

Aggiungere altri nodi

cd cloudshell_open/bitcoin-in-action-playground
docker exec -ti hansel bash
bitcoin-cli addnode <DOMINIO:PORTA DEL NODO BITCOIN DA AGGIUNGERE> add
bitcoin-cli getaddednodeinfo

Generare un nuovo indirizzo e condividerlo in chat!

bitcoin-cli getnewaddress

Minare 100 blocchi

Altrimenti i fondi non sono maturi perche' provenienti tutti da coinbase

bitcoin-cli generatetoaddress 100 $(bitcoin-cli getnewaddress)
bitcoin-cli sendtoaddress <INDIRIZZO DEL DESTINATARIO> 5

We can verify the mempool is working

bitcoin-cli getmempoolinfo
bitcoin-cli getrawmempool

also from /rest/mempool/contents.json

mine one extra block to confirm the transaction that is in the mempool

bitcoin-cli generatetoaddress 1 $(bitcoin-cli getnewaddress)