Giter Site home page Giter Site logo

touilleio / alephium-standalone Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 41 KB

Standalone, fast-sync (via snapshot from https://archives.alephium.org) Alephium full node pre-configured for the mainnet

Dockerfile 3.96% Shell 28.38% HCL 53.23% Smarty 14.43%
alephium blockchain fullnode layer1 mainnet

alephium-standalone's Introduction

Alephium standalone

This repository builds a container image of Alephium layer 1 blockchain full node based on the official alephium/alephium, wrapping the original entrypoint with entrypoint-wrapper.sh in order to add the features described below. The final images are available in Docker Hub under the name touilleio/alephium-standalone.

Features

A basic docker-compose.yml show how to quickly run the container.

Environment variables

Environment variable Default Description
ALEPHIUM_HOME /alephium-home/.alephium Path, inside the official alephium/alephium, there the full node stores its data. See the official Dockerfile.release for more details.
ALEPHIUM_NETWORK mainnet Which network to load the snapshots for. Possible values are mainnet and testnet. !! If you set your own user.conf, this value should match alephium.network.network-id in user.conf !! (mainnet = 0, testnet = 1)
ALEPHIUM_FORCE_RELOAD_SNAPSHOT 0 If set to 1, the database will be dropped at every reboot. Useful for testing, not recommended in working setups.
NODE_TYPE pruned Define which snapshot to load between the pruned or the full snapshots. Pruned snapshot decrease the resources rquirement to ~50GB of disk storage.

Using the standalone script

Loading the snapshot in a dedicated folder $ALEPHIUM_HOME can be done manually using the script snapshot-loader.sh as given below. Mind configuring ALEPHIUM_HOME and ALEPHIUM_NETWORK accordingly, and make sure ALEPHIUM_HOME is writable.

ALEPHIUM_HOME=/tmp
ALEPHIUM_NETWORK=testnet
curl -L https://github.com/touilleio/alephium-standalone/raw/main/snapshot-loader.sh | env ALEPHIUM_HOME=${ALEPHIUM_HOME} ALEPHIUM_NETWORK=${ALEPHIUM_NETWORK} sh

If the script completes, the snapshot has been successfully downloaded and is available in ${ALEPHIUM_HOME}/${ALEPHIUM_NETWORK}. You might need to change ownership of the files depending on what you'll do next.

chown nobody:nogroup -R "${ALEPHIUM_HOME}/${ALEPHIUM_NETWORK}"

For more details about Alephium Archives and snapshot loading, go to the official snapshot loading documentation

One liner to launch the container

Mostly given as a reference, this one liner allows launching an Alephium full node in one line (if docker is installed):

ALEPHIUM_HOME=/tmp
ALEPHIUM_NETWORK=testnet
docker run -p 39973:39973 -p 127.0.0.1:12973:12973 \
  -v ${ALEPHIUM_HOME}:/alephium-home/.alephium \
  -e ALEPHIUM_NETWORK=${ALEPHIUM_NETWORK} touilleio/alephium-standalone:latest

This command is not production ready and extra care must be taken for running a productive full node.

Wrapper script details

The wrapper script contains lots of comments to make it understandable of what and how it is wrapping the official entrypoint.sh script.

Troubleshooting

Restarting from scratch

If you want to restart from scratch and re-download the database, delete all what is inside your alephium data folder, i.e. if you're using the provided docker-compose.yml:

rm -r alephium-data/*

Terraform setup

A terraform setup is provided for your convenience in the terraform folder. Launch an AWS instance sync'ed to the chain withing ~30 minutes by simply doing:

terraform apply

Please refer to the official terraform doc if needed.

alephium-standalone's People

Contributors

killerwhile avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.