Skip to content

O1ahmad/container-file-lotus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCI logo

lotus logo

Container File 🌸 🔗 Lotus

GitHub release (latest by date) Build Status Docker Pulls License: MIT

Table of Contents

Container file that installs, configures and launches Lotus: an implementation of the Filecoin distributed storage network protocol written in Go.

Supported Platforms:
* Redhat(CentOS/Fedora)
* Debian
* Ubuntu

Requirements

None

Environment Variables

Variables are available and organized according to the following software & machine provisioning stages:

  • install
  • config
  • launch

Install

The following variables can be customized to control aspects of the installation process for both the Lotus client and storage miner involving where operational artifacts are stored.

$LOTUS_PATH: (default: /root/.lotus/)

  • path within container the lotus service should establish as its runtime configuration and data directory

$LOTUS_STORAGE_PATH: (default: /root/.lotusstorage/)

  • path within container the lotus-storage-miner service should establish as its runtime and data storage directory.

Config

Configuration of the lotus client can be expressed in a config file written in TOML, a minimal markup language. Note: This file can be found under the directory specified by the LOTUS_PATH (for the lotus client/service) or LOTUS_STORAGE_PATH (for the lotus miner) environment variables. For an idea of the available configuration options, reference this example (installed by default).

The following variables can be customized to manage the content of this TOML configuration:

$CONFIG_<section-keyword>_<section-property> = <property-value (string)> default: None

  • Any configuration setting/value key-pair supported by lotus should be expressible within each CONFIG_* environment variable and properly rendered within the associated TOML config. Note: <section-keyword> along with the other property specifications should be written as expected to be rendered within the associated TOML config (e.g. Libp2p).

Furthermore, configuration is not constrained by hardcoded author defined defaults or limited by pre-baked templating. Only configurations specified by the operator are rendered within the configuration file. Also if the config section, setting and value are recognized by the lotus tool, 👍 to define within an environnment variable according to the following syntax.

<section-keyword> -- represents TOML config sections:

# [TOML Section 'Metrics']
CONFIG_Metrics_<section-property>=<property-value>

<section-property> -- represents a specific TOML config section property to configure:

# [TOML Section 'Metrics']
# Property: PubsubTracing
CONFIG_Metrics_PubsubTracing=<property-value>

<property-value> -- represents property value to configure:

# [TOML Section 'Metrics']
# Property: PubsubTracing
# Value: true
CONFIG_Metrics_PubsubTracing=true # enable publish-subscription tracing for performance monitoring/troubleshooting

Launch

Running of the lotus client and API server as well as the lotus-storage-miner service is accomplished using official Lotus binaries, obtained from Filecoin's Lotus github site.

The following variables can be customized to manage the Lotus client and Lotus Storage miner execution profiles/policies:

$MANAGED_SERVICES = <lotus|lotus-storage-miner> (default: )

  • list of Lotus services to manage and launch

$EXTRA_ARGS: <lotus-cli-options> (default: NONE)

  • list of lotus daemon commandline arguments to pass to the binary at runtime for customizing launch

See here for an example of the lotus daemon's cli.

$EXTRA_MINER_ARGS: <lotus-storage-miner-cli-options> (default: NONE)

  • list of lotus-storage-miner run commandline arguments to pass to the binary at runtime for customizing launch.

See here for an example of the lotus-storage-miner run's cli.

Dependencies

None

Example Run

default example:

podman run 0labs/0x01.lotus:0.2.10_ubuntu-19.10

only manage launch of the lotus client and API server:

podman run --env MANAGED_SERVICES=lotus 0labs/0x01.lotus:0.2.10_ubuntu-19.10

expose lotus API/JSON-RPC server on non-loopback (wildcard/*) address

podman run --env CONFIG_API_ListenAddress= /ip4/0.0.0.0/tcp/1234/http \
           --env CONFIG_Libp2p_ListenAddress=/ip4/0.0.0.0/tcp/1234/http \
           0labs/0x01.lotus:0.2.10_fedora-31

launch lotus service and lotus-storage-miner agents with custom runtime/storage paths and launch options:

podman run --env MANAGED_SERVICES="lotus lotus-storage-miner" \
           --env LOTUS_PATH=/mnt/lotus \
           --env LOTUS_STORAGE_PATH=/mnt/lotus/miner \
           --env CONFIG_Metrics_Nickname=example_miner \
           --env EXTRA_ARGS=--bootstrap \
           --env EXTRA_MINER_ARGS=--nosync \
           0labs/0x01.lotus:0.2.10_debian-10

License

MIT

Author Information

This Containerfile was created in 2020 by O1.IO.

About

Containerfiles for Lotus: an implementation of the Filecoin distributed storage network protocol written in Go

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors