bitmarkd

command module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2016 License: ISC Imports: 31 Imported by: 0

README

bitmarkd - Main program

GoDoc

Prerequisites

  • Install the go language package for your system
  • Configure environment variables for go system
  • install the ZMQ4 library

For shell add the following to the shell's profile (remark the export CC=clang if you wish to use gcc)

# check for go installation
GOPATH="${HOME}/gocode"
if [ -d "${GOPATH}" ]
then
  gobin="${GOPATH}/bin"
  export GOPATH
  export PATH="${PATH}:${gobin}"
  # needed for FreeBSD 10 and later
  export CC=clang
else
  unset GOPATH
fi
unset gobin

OnFreeBSD/PC-BSD

pkg install libzmq4

On a Debian like system (as of Ubuntu 14.04 this only has V3, so need to search for PPA)

apt-get install libzmq4-dev

To compile simply:

go get github.com/bitmark-inc/bitmarkd
go install -v github.com/bitmark-inc/bitmarkd

Set up

Create the configuration directory, copy sample configuration, edit it to set up IPs, ports and local bitcoin testnet connection.

mkdir -p ~/.config/bitmarkd
cp bitmarkd.conf-sample  ~/.config/bitmarkd/bitmarkd.conf
${EDITDOR}   ~/.config/bitmarkd/bitmarkd.conf

Generate key files and certificates.

bitmarkd generate-identity
bitmarkd generate-rpc-cert
bitmarkd generate-mine-cert

Start the program.

bitmarkd

Documentation

Overview

bitmarkd main program

Directories

Path Synopsis
maintain a memory pools for network announcements
maintain a memory pools for network announcements
Simple skeleton for background processes
Simple skeleton for background processes
simple module to list the supported chains
simple module to list the supported chains
thread safe counter
thread safe counter
Implement the Bitcoin difficulty value and its various encodings
Implement the Bitcoin difficulty value and its various encodings
error instances Provides a single instance of errors to allow easy comparison
error instances Provides a single instance of errors to allow easy comparison
a specialised timestamp to index data collections consists of: seconds (int64) -> the UTC unix time nano seconds (int) -> fractional time [0 ..
a specialised timestamp to index data collections consists of: seconds (int64) -> the UTC unix time nano seconds (int) -> fractional time [0 ..
this is a limited size set items may only be added or check for existance items are automatically removed on a first-in first-out basis
this is a limited size set items may only be added or check for existance items are automatically removed on a first-in first-out basis
a queue system to transfer transactions
a queue system to transfer transactions
stratum mining JSON: http://mining.bitcoin.cz/stratum-mining/ subscribe: {"id": 1, "method": "mining.subscribe", "params": []} -> subscribe to notifications {"id": 1, "result": [ [["mining.set_difficulty", "b4b6693b72a50c7116db18d6497cac52"], -> subscription id to cancel this type of notification ["mining.notify", "ae6812eb4cd7735a302a8a9dd95cf71f"]], -> subscription id to cancel this type of notification "08000002", -> Extranonce1 -> Hex-encoded, per-connection unique string which will be used for coinbase serialization later 4], -> Extranonce2_size -> Represents expected length of extranonce2 which will be generated by the miner "error": null} authenticate: (for each miner thread) {"id": 2, "method": "mining.authorize", "params": ["slush.miner1", "password"]} -> miner authenticate {"id": 2, "error": null, "result": true} notification: new block to mine {"id": null, "method": "mining.notify", "params": [ "bf", -> job_id "4d16b6f85af6e2198f44ae2a6de67f78487ae5611b77c6c0440b921e00000000", "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff20020862062f503253482f04b8864e5008", "072f736c7573682f000000000100f2052a010000001976a914d23fcdf86f7e756a64a7a9688ef9903327048ed988ac00000000", [], -> merkle_branch "00000002", -> version "1c2ac4af", -> nbits "504e86b9", -> ntime false]} -> clean_jobs job_id - ID of the job.
stratum mining JSON: http://mining.bitcoin.cz/stratum-mining/ subscribe: {"id": 1, "method": "mining.subscribe", "params": []} -> subscribe to notifications {"id": 1, "result": [ [["mining.set_difficulty", "b4b6693b72a50c7116db18d6497cac52"], -> subscription id to cancel this type of notification ["mining.notify", "ae6812eb4cd7735a302a8a9dd95cf71f"]], -> subscription id to cancel this type of notification "08000002", -> Extranonce1 -> Hex-encoded, per-connection unique string which will be used for coinbase serialization later 4], -> Extranonce2_size -> Represents expected length of extranonce2 which will be generated by the miner "error": null} authenticate: (for each miner thread) {"id": 2, "method": "mining.authorize", "params": ["slush.miner1", "password"]} -> miner authenticate {"id": 2, "error": null, "result": true} notification: new block to mine {"id": null, "method": "mining.notify", "params": [ "bf", -> job_id "4d16b6f85af6e2198f44ae2a6de67f78487ae5611b77c6c0440b921e00000000", "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff20020862062f503253482f04b8864e5008", "072f736c7573682f000000000100f2052a010000001976a914d23fcdf86f7e756a64a7a9688ef9903327048ed988ac00000000", [], -> merkle_branch "00000002", -> version "1c2ac4af", -> nbits "504e86b9", -> ntime false]} -> clean_jobs job_id - ID of the job.
simple module to record the global running mode
simple module to record the global running mode
access to payment functions
access to payment functions
P2P client/server system for bitmarkd This used RPC to send message to connected peers using the bilateralrpc module.
P2P client/server system for bitmarkd This used RPC to send message to connected peers using the bilateralrpc module.
maintain severa pools of a number of elements in key->value form This maintains a LevelDB database split into a series of tables.
maintain severa pools of a number of elements in key->value form This maintains a LevelDB database split into a series of tables.
transaction record handling contains types for each of the possible transaction records and methods to Pack and Unpack them for storage/transfer.
transaction record handling contains types for each of the possible transaction records and methods to Pack and Unpack them for storage/transfer.
the version number so that other modules can access it
the version number so that other modules can access it

Jump to

Keyboard shortcuts

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