bitmarkd

module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: ISC

README

bitmarkd - Main program

GoDoc

Prerequisites

  • Install the go language package for your system
  • Configure environment variables for go system
  • install the ZMQ4 and Argon2 libraries

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

On FreeBSD

pkg install libzmq4 libargon2

On MacOSX (be sure that homebrew is installed correctly)

brew install argon2

brew tap bitmark-inc/bitmark
brew install zeromq41

On Ubuntu (tested dor distribution 18.04)

Install following packages sudo apt install libargon2-0-dev uuid-dev libzmq3-dev

To compile simply:

go get github.com/bitmark-inc/bitmarkd
go install -v github.com/bitmark-inc/bitmarkd/command/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 command/bitmarkd/bitmarkd.conf.sample  ~/.config/bitmarkd/bitmarkd.conf
${EDITOR}   ~/.config/bitmarkd/bitmarkd.conf

To see the bitmarkd sub-commands:

bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" help

Generate key files and certificates.

bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" gen-peer-identity
bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" gen-rpc-cert
bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" gen-proof-identity

Start the program.

bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" start

Note that a similar process is needed for the prooferd (mining subsystem)

Prebuilt Binary

Coding

  • setup git hooks

    Link git hooks directory, run command ./scripts/setup-hook.sh at root of bitmarkd directory. Currently it provides checkings for two stages:

    1. Before commit (pre-commt)

    Runs go lint for every modified file(s). It shows suggestions but not necessary to follow.

    1. Before push to remote (pre-push)

    Runs go test for whole directory except vendor one. It is mandatory to pass this check because generally, new modifications should not break existing logic/behavior.

    Other optional actions are sonaqube and go tool vet. These two are optional to follow since static code analysis just provide some advice.

  • all variables are camel case i.e. no underscores

  • labels are all lowercase with '_' between words

  • imports and one single block

  • all break/continue must have label

  • avoid break in switch and select

Directories

Path Synopsis
types and functions for converting Bitmark accounts (the public key) and their signatures
types and functions for converting Bitmark accounts (the public key) and their signatures
network announcements
network announcements
Cache for assets temporary store assets just received until they are: a.
Cache for assets temporary store assets just received until they are: a.
an AVL balanced tree with the addition of parent pointers to allow iteration through the nodes Note: an individual tree is not thread safe, so either access only in a single go routine or use mutex/rwmutex to restrict access.
an AVL balanced tree with the addition of parent pointers to allow iteration through the nodes Note: an individual tree is not thread safe, so either access only in a single go routine or use mutex/rwmutex to restrict access.
Simple skeleton for background processes
Simple skeleton for background processes
current block data
current block data
implementation block header hashing using a memory intensive argon2-d algorithm
implementation block header hashing using a memory intensive argon2-d algorithm
current block header data
current block header data
the structure of the block header includes functions to pack/unpack []byte form
the structure of the block header includes functions to pack/unpack []byte form
uses crc64 of recent blocks to produce a deterministic number for the issue hashing verification system
uses crc64 of recent blocks to produce a deterministic number for the issue hashing verification system
simple module to list the supported chains
simple module to list the supported chains
command
bitmark-cli
to issue basic commands to a bitmarkd
to issue basic commands to a bitmarkd
bitmark-cli/rpccalls
Bitmark rpccalls
Bitmark rpccalls
bitmark-dumpdb
Bitmark bitmark-dumpdb
Bitmark bitmark-dumpdb
bitmark-info
Bitmark bitmark-info
Bitmark bitmark-info
bitmarkd
bitmarkd main program
bitmarkd main program
recorderd
Proof-of-work program for bitmark system This program subscribes to potential blocks stream on a bitmarkd and determines an argon2 hash value that meets the current network difficulty value.
Proof-of-work program for bitmark system This program subscribes to potential blocks stream on a bitmarkd and determines an argon2 hash value that meets the current network difficulty value.
parse a Lua configuration file most of base Lua is available such as reading files to set key data and getenv to extract environment supplied items.
parse a Lua configuration file most of base Lua is available such as reading files to set key data and getenv to extract environment supplied items.
constants that could be tuned
constants that could be tuned
thread safe counter
thread safe counter
types and functions for converting currencies to/from enumeration values
types and functions for converting currencies to/from enumeration values
bitcoin
to validate bitcoin addresses
to validate bitcoin addresses
litecoin
to validate litecoin addresses
to validate litecoin addresses
satoshi
to convert satoshi values to integers
to convert satoshi values to integers
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 without having to resort to partial string matches
error instances Provides a single instance of errors to allow easy comparison without having to resort to partial string matches
live and test genesis blocks
live and test genesis blocks
Bitmark keypair
Bitmark keypair
merkle tree manipulation routines
merkle tree manipulation routines
a queue system to transfer transactions
a queue system to transfer transactions
simple module to record the global running mode
simple module to record the global running mode
this handles low-level access to the ownership data in storage pool
this handles low-level access to the ownership data in storage pool
miscellaneous type for payment
miscellaneous type for payment
control of payment verification
control of payment verification
this module handles the peer to peer network server-side: * upstream sending of block, transactions * listener for RPC requests e.g.
this module handles the peer to peer network server-side: * upstream sending of block, transactions * listener for RPC requests e.g.
upstream
maintain REQ/REP connection to clients this allow for push of blocks, transactions...
maintain REQ/REP connection to clients this allow for push of blocks, transactions...
prepare blocks for prooferd
prepare blocks for prooferd
this module handles publishing of events for add-on services e.g.
this module handles publishing of events for add-on services e.g.
storage for: 1.
storage for: 1.
this is to setup and handle all of the incoming JSON RPC requests from clients requiring bitmarkd services standard golang RPC services can be used on the client side to access these services
this is to setup and handle all of the incoming JSON RPC requests from clients requiring bitmarkd services standard golang RPC services can be used on the client side to access these services
maintain the on-disk data store maintain separate pools of a number of elements in key->value form This maintains a LevelDB database split into a series of tables.
maintain the on-disk data store maintain separate pools of a number of elements in key->value form This maintains a LevelDB database split into a series of tables.
the structure of the transaction records includes functions to pack/unpack []byte form
the structure of the transaction records includes functions to pack/unpack []byte form
miscellaneous small routines
miscellaneous small routines
various comm ZMq routines shared be all commands
various comm ZMq routines shared be all commands

Jump to

Keyboard shortcuts

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