lalibreriadesatoshi
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Como instalar un nodo completo de Bitcoin en red testnet con linux Ubuntu ###### tags: `talleres_mln` **Tabla de contenido** [TOC] ## Autores Twitter para correcciones, comentarios o sugerencias a: [@bitao36](https://twitter.com/bitao36) [@decentralizedb](https://twitter.com/@decentralizedb) [@dulce](https://twitter.com/dulce) El presente tutorial fue elaborado para el [Seminario socrático de Mastering Lightning](https://libreriadesatoshi.com/) a través de [@libreriadesatoshi](https://twitter.com/libdesatoshi). ## Cómo empezar Si eres totalmente nuevo en Bitcoin te recomendamos leer: * [Lectura sobre nodos](https://dinerosinreglas.com/nodos/) * [Six reasons you should run bitcoin node](https://bitcoinmagazine.com/culture/six-reasons-you-should-run-bitcoin-node ) * [Podcast sobre que me aporta tener un nodo de Bitcoin ](https://dinerosinreglas.com/que-me-aporta-el-tener-un-nodo-de-bitcoin/) ## Tipos de instalación Hay cuatro formas de instalar un nodo de Bitcoin, voy a enumerarlas empezando de la más fácil a la más difícil: 1. Con software plug & play como [Umbrel](https://getumbrel.com), [RaspiBlitz](https://raspiblitz.org), [Runcitadel](https://runcitadel.space) o similares. Estos programas tienen instaladores para Raspberry Pi y también pueden correr en pcs con sistema Linux. En el caso de Umbrel y Runcitadel instala un contenedor Docker con Bitcoin Core y la implementación LND de Lightning network por defecto usando Tor. Lo cual le da facilidad a usuarios no técnicos de correr un nodo de forma muy simple y con privacidad por defecto. 2. Instalar a partir de contenedores Docker. La cual requiere algún conocimiento más técnico. 3. Instalación a partir de binarios ya compilados. En bitcoin.org hay instaladores binarios para varios sistemas operativos, es cuestión de descargarlos y seguir las instrucciones. 4. Bajar el código fuente, compilarlo e instalar. En este tutorial vamos a desarrollar el punto 4, que puede ser retador para personas no técnicas. Si eres un usuario técnico o no tan técnico pero con muchos deseos de aprender entonces este tutorial es para ti. Como requisito para este tutorial, debes haber instalado previamente una versión de Linux, en nuestro caso nos vamos a basar en Ubuntu, por ser una distribución ampliamente usada por la comunidad de desarrolladores de Bitcoin y tener una base bastante extendida de información y tutoriales basados en esta distro. ## Instalar programas, librerías y dependencias **Programas que necesitamos** Vamos a instalar estos dos programas que los necesitaremos más adelante: ```shell sudo apt-get install git curl ``` **Librerías y dependencias** Ahora necesitamos instalar algunas librerias. Al instalar librerias, a veces se puede enumerar muchas en un solo comando y separarlas con un solo espacio. En este tutorial, los dividí en grupos similares a la documentación de compilación en [Github para Debian/Ubuntu](https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md) Ejecuta los siguientes comandos para instalar todas las librerías que ayudarán a compilar el código de bitcoind y que también servirán en caso de que quieras usar herramientas para aprender a desarrollar. ```shell sudo apt-get install build-essential autoconf libtool autotools-dev \ automake pkg-config bsdmainutils python3 sudo apt-get install libevent-dev libboost-dev sudo apt-get install libsqlite3-dev sudo apt-get install libminiupnpc-dev libnatpmp-dev sudo apt-get install libzmq3-dev ``` En caso de que quieras usar GUI (interfaz gráfica) para administrar bitcoind debes instalar estas librerías, si solo vas a usar la línea de comando no es necesario. ```shell sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev \ qttools5-dev-tools ``` ## Compilar e instalar bitcoind Verificamos que estamos en el home del usuario actual: ```shell cd ~ ``` Y ejecutamos este comando para bajar el código del repositorio de Bitcoin: ```shell git clone https://github.com/bitcoin/bitcoin.git ``` Una vez terminada la descarga, nos cambiamos a la carpeta `bitcoin` que se acaba de crear ejecutando el comando: ```shell cd bitcoin ``` Miramos los tags para ver las versiones disponibles con este comando: ```shell git tag ``` También puedes mirar la versión del último release en esta URL: [https://github.com/bitcoin/bitcoin/releases](https://github.com/bitcoin/bitcoin/releases) ![bitcoin_core_26](https://hackmd.io/_uploads/SkhOTy1tC.png) En este caso vamos a ir a la última versión que es la v26.2 para eso ejecutamos este comando: ```shell git checkout v26.2 ``` **Instalamos la Berkeley Database** Esta es una base de datos que aún se necesita para poder compilar, posiblemente no se necesite en el futuro. Instalamos la base de datos Berkeley con este comando (recuerda que debemos estar en el directorio bitcoin): ```shell ./contrib/install_db4.sh `pwd` ``` Con el siguiente comando exportamos la ruta donde quedó la base de datos en una variable de entorno BDB_PREFIX, esta variable la necesitamos más adelante (recuerda debes reemplazar el usuario ***admon*** por tu usuario). ```shell export BDB_PREFIX="/home/admon/bitcoin/db4" ``` **Empezamos el proceso de compilación** Ahora vamos a prepar el entorno para compilar el sofware de refrencia de Bitcoin Core, para ello ejecutamos el siguiente comando: ```shell ./autogen.sh ``` El anterior comando creó el script configure. A este script se le puedan pasar varios parámetros para ajustar a la medida de nuestras necesidades. En este caso sólo le vamos a pasar los parámetros para configurar la base de datos Berkeley que ya instalamos en un paso previo. ```shell! ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_FLAGS="-I${BDB_PREFIX}/include" ``` Con esta configuración vas a usar GUI (Interfaz gráfica) y requieres las librerías QT. En caso de que no quieras usar la GUI podemos pasarle el parámetro `--with-gui=no` y quedaría así: ```shell! ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_FLAGS="-I${BDB_PREFIX}/include" --with-gui=no ``` Si todo estuvo bien, se deben haber creado los scripts para compilar bitcoind. En caso de que no, mira qué librerías faltaron, las instalas e intenta de nuevo. Ahora si, vamos a compilar, para ello ejecutamos el comando: ```shell make -j$(nproc) ``` `make` puede ejecutarse sin parámetros y usa un sólo núcleo el procesador, pero si usamos el parámetro `-j$(nproc)` usaremos todos los núcleos que tenemos en el procesador para que la compilación se haga en paralelo y tarde menos tiempo. Este proceso puede tardar entre una hora o hora y media, dependiendo de los núcleos que tenga tu pc y la memoria disponible. Te recomiendo que no tengas muchas aplicaciones abiertas. Al finalizar podemos ver una imagen similar a esta: ![](https://i.imgur.com/hoWDt7o.png) Si no hubo ningún problema, se habrá creado el compilado, por lo que ahora vamos a proceder con la instalación, ejecutando el comando: ```shell sudo make install ``` La instalación dejará una salida por consola como la que se ve en la siguiente imagen: ![](https://i.imgur.com/C2e6jbR.png) Esto debe instalar el binario bitcoind en la ruta: `/usr/local/bin/bitcoind` al igual que `/usr/local/bin/bitcoin-cli` y `/usr/local/bin/bitcoin-qt` en caso de que hayas decidido instalar Bitcoin Core con la interfaz gráfica (GUI). ## Configurar el archivo bitcoin.conf Cuando se ejecuta bitcoind por primera vez se crea un directorio `.bitcoin` en el home del usuario que contiene el archivo `bitcoin.conf`. Como aun no hemos ejecutado `bitcoind` vamos a crear el directorio de manera previa, para ello ejecutamos estos comandos que nos van a ayudar creando el directorio `.bitcoin` y cambiaremos al directorio creado: ```shell mkdir ~/.bitcoin cd ~/.bitcoin ``` Ahora creamos el archivo de configuración con cualquier editor de texto voy a usar nano por simplicidad: ```shell nano bitcoin.conf ``` Vamos a usar una configuración para instalar un nodo que contiene la historia completa de los bloques, ya que aunque se podría un nodo podado (un nodo que no contiene toda la historia de los bloques), es altamente recomendable hacerlo con un nodo que tenga toda la historia y así no penalizar el rendimiento y el consumo de recursos del nodo. En el archivo de configuración se pueden añadir muchos parámetros, pero para simplificar las cosas solamente vamos a introducir un par de líneas que va indicar que vamos a usar la red de testnet. ```shell= testnet=1 txindex=1 ``` Antes de ejecutar `bitcoind` en segundo plano, ten en cuenta que se empezará a bajar la blockchain de testnet que al momento de crear este tutorial pesa 50Gigas aproximadamente lo que demorará algunos minutos. ## Ejecutar bitcoind y descargar la blockchain Ahora ejecuta `bitcoind` como un demonio para que se ejecute en segundo plano y empiece a bajar la blockchain: ```shell bitcoind -daemon ``` Para chequear el progreso usar este comando: ```shell bitcoin-cli getblockchaininfo ``` Si comprobamos muy rápido es probable que Bitcoin aún esté cargando y verificando el índice, por lo que podríamos obtener un mensaje de error como el siguiente: ![](https://i.imgur.com/YFDr3Dd.png) No hay que preocuparse, espera unos segundos más tendrás un resultado como el siguiente: ![](https://i.imgur.com/BxPiGQq.png) El parámetro **verificationprogress** te indicará el porcentaje del progreso, cuando llegue a 0.99 ya ha descargado la blockchain completa. Si has llegado hasta aquí felicitaciones, ahora tienes un nodo de Bitcoin listo para usar. Este es el primer pilar para empezar a construir tu soberanía monetaria.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully