humanize

package
v0.0.0-...-44e067b Latest Latest
Warning

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

Go to latest
Published: May 21, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package humanize contains funcs that will turn raw data from bitcoind into human readable data

Package humanize contains funcs that will turn raw data from bitcoind into human readable data

Package humanize contains funcs that will turn raw data from bitcoind into human readable data

Index

Constants

View Source
const (
	// NODE_NONE mens that the node does not offer any services.
	NODE_NONE uint64 = 0

	// NODE_NETWORK means that the node is capable of serving the block chain. It is currently
	// set by all Bitcoin Core nodes, and is unset by SPV clients or other peers that just want
	// network services but don't provide them.
	NODE_NETWORK uint64 = 1 << 0

	// NODE_GETUTXO means the node is capable of responding to the getutxo protocol request.
	// Bitcoin Core does not support this but a patch set called Bitcoin XT does.
	// See BIP 64 for details on how this is implemented.
	NODE_GETUTXO uint64 = 1 << 1

	// NODE_BLOOM means the node is capable and willing to handle bloom-filtered connections.
	// Bitcoin Core nodes used to support this by default, without advertising this bit,
	// but no longer do as of protocol version 70011 (= NO_BLOOM_VERSION)
	NODE_BLOOM uint64 = 1 << 2

	// NODE_WITNESS indicates that a node can be asked for blocks and transactions including
	// witness data.
	NODE_WITNESS uint64 = 1 << 3

	// NODE_XTHIN means the node supports Xtreme Thinblocks
	// If this is turned off then the node will not service nor make xthin requests
	NODE_XTHIN uint64 = 1 << 4
)

* The MIT License (MIT) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE.

Variables

This section is empty.

Functions

func HasServiceFlag

func HasServiceFlag(services string, flag uint64) bool

HasServiceFlag checks the services flag sent by a peer and determines if a certain flag is set.

func Hostname

func Hostname(ipaddress string) string

Hostname fetches the hostname associated to the peer's IP Address. If the IP Address has multiple hostnames, the first one will be returned. This method, because hostname resolving is a long operation, also caches the found hostname.

func Ping

func Ping(ms float64) string

Ping will convert the value, which is in seconds, into a format that's better recognized by humans (or at least me).

func ServiceFlag

func ServiceFlag(flag string) []string

ServiceFlag will take the flag returned by the daemon and check which bits are set. Each bit that is set represents a service offered by the peer.

func ServiceFlagJoin

func ServiceFlagJoin(flag string) string

ServiceFlagJoin is a helper func to display the service flags in a single line.

func Uptime

func Uptime(seconds time.Duration) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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