Git Product home page Git Product logo

btfsautohostprice's Introduction

btfsautohostprice

BTFS auto host price automatically set BTFS host BTT price from coinmarketcap and a fixed USD amount everyday

build

Simply go build -ldflags "-s -w" the project.

install

  • Copy the btfsautohostprice binary from build to /usr/local/bin/btfsautohostprice
  • Copy systemd/btfsautohostprice.service to /etc/systemd/system/btfsautohostprice.service
    • Make sure your btfs daemon is started by a unit called btfs.service or edit After= and Requires= in btfsautohostprice.service
  • Copy systemd/btfsautohostprice.timer to /etc/systemd/system/btfsautohostprice.timer
  • Copy systemd/btfsautohostprice.env to /etc/default/btfsautohostprice
  • Edit /etc/default/btfsautohostprice with valid values
  • Set perms with:
useradd --home-dir /var/lib/btfsautohostprice --create-home --system --shell /usr/sbin/nologin btfsautohostprice
chown root:btfsautohostprice /usr/local/bin/btfsautohostprice /etc/default/btfsautohostprice
chmod 750 /usr/local/bin/btfsautohostprice
chmod 640 /etc/default/btfsautohostprice
  • Activate systemd with:
systemctl daemon-reload
systemctl enable --now btfsautohostprice.timer
  • Check status with:
systemctl list-timers
systemctl status btfsautohostprice.timer
journalctl -u btfsautohostprice.service
  • Force run with:
systemctl start btfsautohostprice.service

run example

journalctl -u btfsautohostprice.service

Apr 11 08:33:57 serverhostname systemd[1]: Starting BTFS automatic host price update...
Apr 11 08:33:58 serverhostname btfsautohostprice[123483]: 10.00 USD is worth 1233.937434 BTT at 2021-04-11 08:33:07 +0000 UTC: with the 3x network redundancy, a host price must be 411.312478 BTT for a user to store 1TB/month on the network at this price
Apr 11 08:33:58 serverhostname btfsautohostprice[123483]: host pricing updated
Apr 11 08:33:58 serverhostname systemd[1]: btfsautohostprice.service: Succeeded.
Apr 11 08:33:58 serverhostname systemd[1]: Finished BTFS automatic host price update.

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.