TOPO⚡
  • Glosario
  • Consejos
  • ¿Como crear un pool?
    • Preparando el servidor
    • 👉Instalación y actualización
    • Configuración de un nodo
    • Ejecutar como un servicio
    • Keys y certificado del pool
    • Direcciones de payment y stake
    • Registrar pool
  • Mantenimiento del pool
    • Renovar KES keys
    • Retirar un pool
  • Novedades
    • Conectar wallet a nodo de TOPO⚡
    • Migrar pledge a Ledger Nano
    • Votar en Catalyst con wallet de pledge (deprecado)
Con tecnología de GitBook
En esta página
  • Archivo env
  • Archivo de servicio
  • Administrar nuestro servicio

¿Te fue útil?

  1. ¿Como crear un pool?

Ejecutar como un servicio

A continuación creamos los servicios para que nuestros nodos puedan ejecutarse de forma automática.

Archivo env

Creamos un shell script que luego utilizaremos para arrancar el nodo usando systemctl.

~/cardano-node/relay/env
TOPOLOGY=/home/ubuntu/cardano-node/relay/topology.json
DATABASE_PATH=/home/ubuntu/cardano-node/relay/db
SOCKET_PATH=/home/ubuntu/cardano-node/relay/db/socket
HOST_ADDR=0.0.0.0
PORT=3001
CONFIG=/home/ubuntu/cardano-node/relay/config.json
~/cardano-node/block/env
TOPOLOGY=/home/ubuntu/cardano-node/block/topology.json
DATABASE_PATH=/home/ubuntu/cardano-node/block/db
SOCKET_PATH=/home/ubuntu/cardano-node/block/db/socket
HOST_ADDR=0.0.0.0
PORT=3000
CONFIG=/home/ubuntu/cardano-node/block/config.json
SHELLEY_KES_KEY=/home/ubuntu/cardano-node/block/BP.kes.skey
SHELLEY_VRF_KEY=/home/ubuntu/cardano-node/block/BP.vrf.skey
SHELLEY_OPCERT=/home/ubuntu/cardano-node/block/BP.node.opcert

Archivo de servicio

Creamos un archivo de servicio para poder programar y administrar el servicio usando systemctl. Debes iniciar tu editor de texto con sudo para poder guardar los cambios a estos archivos.

No usar el servicio para iniciar nuestro BP hasta después de haber generado nuestras llaves y registrado el pool. Hasta entonces se debe iniciar el nodo como un relay normal. Se incluye un un script "TEMP" como ejemplo.

/etc/systemd/system/RELAY.service
[Unit]
Description=Cardano Haskell Node - RELAY
After=syslog.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=5
User=ubuntu
LimitNOFILE=131072
WorkingDirectory=/home/ubuntu/cardano-node/relay
EnvironmentFile=/home/ubuntu/cardano-node/relay/env
ExecStart=/home/ubuntu/.local/bin/cardano-node \
  +RTS -N -RTS run \
  --topology ${TOPOLOGY} \
  --database-path ${DATABASE_PATH} \
  --socket-path ${SOCKET_PATH} \
  --host-addr ${HOST_ADDR} \
  --port ${PORT} \
  --config ${CONFIG}
KillSignal=SIGINT
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=RELAY

[Install]
WantedBy=multi-user.target
/etc/systemd/system/BLOCK.service
[Unit]
Description=Cardano Haskell Node - BLOCK
After=syslog.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=5
User=ubuntu
LimitNOFILE=131072
WorkingDirectory=/home/ubuntu/cardano-node/block
EnvironmentFile=/home/ubuntu/cardano-node/block/env
ExecStart=/home/ubuntu/.local/bin/cardano-node \
  +RTS -N -RTS run \
  --topology ${TOPOLOGY} \
  --database-path ${DATABASE_PATH} \
  --socket-path ${SOCKET_PATH} \
  --host-addr ${HOST_ADDR} \
  --port ${PORT} \
  --config ${CONFIG} \
  --shelley-kes-key ${SHELLEY_KES_KEY} \
  --shelley-vrf-key ${SHELLEY_VRF_KEY} \
  --shelley-operational-certificate ${SHELLEY_OPCERT}
KillSignal=SIGINT
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=BLOCK

[Install]
WantedBy=multi-user.target
/etc/systemd/system/BLOCK.service
[Unit]
Description=Cardano Haskell Node - BLOCK
After=syslog.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=5
User=ubuntu
LimitNOFILE=131072
WorkingDirectory=/home/ubuntu/cardano-node/block
EnvironmentFile=/home/ubuntu/cardano-node/block/env
ExecStart=/home/ubuntu/.local/bin/cardano-node \
  +RTS -N -RTS run \
  --topology ${TOPOLOGY} \
  --database-path ${DATABASE_PATH} \
  --socket-path ${SOCKET_PATH} \
  --host-addr ${HOST_ADDR} \
  --port ${PORT} \
  --config ${CONFIG}
KillSignal=SIGINT
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=BLOCK

[Install]
WantedBy=multi-user.target

Administrar nuestro servicio

Podemos usar los siguientes comandos para administrar nuestro servicio de cardano-node.

# Habilitar arranque automatico del nodo al encender el servidor 
sudo systemctl enable RELAY

# Habilitar arranque automatico e iniciar servicio inmediatamente (opcional)
sudo systemctl enable --now RELAY

# Iniciar servicio
sudo systemctl start RELAY

# Detener servicio
sudo systemctl stop RELAY

# Ver estado del servicio
sudo systemctl status RELAY
# Habilitar arranque automatico del nodo al encender el servidor 
sudo systemctl enable BLOCK

# Habilitar arranque automatico e iniciar servicio inmediatamente (opcional)
sudo systemctl enable --now BLOCK

# Iniciar servicio
sudo systemctl start BLOCK

# Detener servicio
sudo systemctl stop BLOCK

# Ver estado del servicio
sudo systemctl status BLOCK
AnteriorConfiguración de un nodoSiguienteKeys y certificado del pool

Última actualización hace 3 años

¿Te fue útil?