zeus

package
v0.0.0-...-bd38ea7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright © 2022 Michael Rosset <mike.rosset@gmail.com>

This file is part of Zeus

Zeus is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zeus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright © 2022 Michael Rosset <mike.rosset@gmail.com>

This file is part of Zeus

Zeus is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zeus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright © 2022 Michael Rosset <mike.rosset@gmail.com>

This file is part of Zeus

Zeus is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zeus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Copyright © 2022 Michael Rosset <mike.rosset@gmail.com>

This file is part of Zeus

Zeus is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zeus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	BITCOIN_VERSION = "23.0"
	LND_VERSION     = "0.15.3-beta"

	BITCOIN_URI = "https://bitcoincore.org/bin/bitcoin-core-%s"
	LND_URI     = "https://github.com/lightningnetwork/lnd/releases/download/v%s"
	LAN_URI     = "http://devel"
)
View Source
const (
	ShortName = "zeus"
)

Variables

View Source
var DefaultProgram = Program{ShortName, TitledName()}

The default program struct

Functions

func Exists

func Exists(path string) bool

Returns TRUE if PATH exists

func Extract

func Extract(dir, path string) error

Extracts tarball FILE to DIR. Returns error

func Fetch

func Fetch(dir, uri string) error

Download URI to DIR path. Returns downloaded file path

func NewBitcoind

func NewBitcoind(prefix string) *exec.Cmd

Creates a new bitcoind Cmd with binary from prefix

func ParseProgram

func ParseProgram(input string) (out string)

Returns the template INPUT as a strings

func Sha256sum

func Sha256sum(file string) (hash string, err error)

Open FILE path and returns it's sha256sum

func Size

func Size(path string) (int64, error)

Returns the size of PATH file

func TarIndex

func TarIndex(path string) (string, error)

Returns index Directory of a Tarball

func TitledName

func TitledName() string

Returns a Titled string for ShortName

func Verify

func Verify(path, hash string) bool

Verify the HASH for PATH. Returns true if verification passes. False if it does not pass

Types

type BitcoindInstaller

type BitcoindInstaller Installer

func NewBitcoinInstaller

func NewBitcoinInstaller(arch, os, prefix string, release MirrorType) BitcoindInstaller

func (BitcoindInstaller) Config

func (i BitcoindInstaller) Config() string

Returns the full path of the bitcoind config file.

func (BitcoindInstaller) PostInstall

func (i BitcoindInstaller) PostInstall() error

type Config

type Config struct {
	Server   int    `ini:"server"`
	NoListen int    `ini:"nolisten"`
	DBCache  int    `ini:"dbcache"`
	TXIndex  int    `ini:"txindex"`
	DataDir  string `ini:"datadir"`
	Regtest  int    `ini:"regtest"`
}

func NewDefaultConfig

func NewDefaultConfig(prefix string) *Config

Returns a new default *Config with PREFIX substitution

func ReadConfig

func ReadConfig(path string) (*Config, error)

Reads *Config from INI PATH

func (*Config) Write

func (c *Config) Write(path string) error

Writes *Config to INI PATH

type InstallType

type InstallType int
const (
	BITCOIN InstallType = iota
	LIGHTING
)

type Installer

type Installer struct {
	Description string
	// contains filtered or unexported fields
}

func NewLNDInstaller

func NewLNDInstaller(arch, os, prefix string, release MirrorType) Installer

func (*Installer) Extract

func (i *Installer) Extract() error

func (*Installer) Fetch

func (i *Installer) Fetch() error

func (*Installer) GzDir

func (i *Installer) GzDir() string

func (*Installer) GzPath

func (i *Installer) GzPath() string

func (*Installer) Install

func (i *Installer) Install() error

func (*Installer) UnInstall

func (i *Installer) UnInstall() error

func (*Installer) Verify

func (i *Installer) Verify() error

type MirrorType

type MirrorType int
const (
	LAN MirrorType = iota
	WEB
)

type Program

type Program struct {
	ShortName  string
	TitledName string
}

type Tarball

type Tarball struct {
	Hash string
	File string
}

type UpstreamFiles

type UpstreamFiles map[string]map[string]Tarball

func (UpstreamFiles) Entry

func (u UpstreamFiles) Entry(arch, os string) (Tarball, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL