Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.circleci/ | H | 13-Jul-2021 | - | 1,080 | 840 | |
account/ | H | 13-Jul-2021 | - | 3,520 | 3,091 | |
announce/ | H | 13-Jul-2021 | - | 3,569 | 2,529 | |
asset/ | H | 13-Jul-2021 | - | 376 | 243 | |
avl/ | H | 13-Jul-2021 | - | 1,474 | 1,137 | |
background/ | H | 13-Jul-2021 | - | 306 | 210 | |
block/ | H | 13-Jul-2021 | - | 1,644 | 1,182 | |
blockdigest/ | H | 13-Jul-2021 | - | 425 | 312 | |
blockheader/ | H | 13-Jul-2021 | - | 367 | 244 | |
blockrecord/ | H | 13-Jul-2021 | - | 1,074 | 781 | |
chain/ | H | 13-Jul-2021 | - | 39 | 16 | |
command/ | H | 13-Jul-2021 | - | 11,688 | 8,959 | |
configuration/ | H | 13-Jul-2021 | - | 124 | 67 | |
constants/ | H | 13-Jul-2021 | - | 46 | 18 | |
counter/ | H | 13-Jul-2021 | - | 98 | 52 | |
currency/ | H | 13-Jul-2021 | - | 2,224 | 1,709 | |
debian/ | H | 13-Jul-2021 | - | 1,267 | 735 | |
difficulty/ | H | 13-Jul-2021 | - | 691 | 490 | |
doc/ | H | 13-Jul-2021 | - | 234 | 177 | |
fault/ | H | 13-Jul-2021 | - | 293 | 236 | |
genesis/ | H | 13-Jul-2021 | - | 385 | 268 | |
hooks/ | H | 13-Jul-2021 | - | 80 | 45 | |
merkle/ | H | 13-Jul-2021 | - | 3,228 | 2,964 | |
messagebus/ | H | 13-Jul-2021 | - | 420 | 286 | |
mode/ | H | 13-Jul-2021 | - | 173 | 105 | |
ownership/ | H | 13-Jul-2021 | - | 1,041 | 705 | |
pay/ | H | 13-Jul-2021 | - | 120 | 75 | |
payment/ | H | 13-Jul-2021 | - | 2,187 | 1,647 | |
peer/ | H | 13-Jul-2021 | - | 3,712 | 2,758 | |
proof/ | H | 13-Jul-2021 | - | 1,108 | 804 | |
publish/ | H | 13-Jul-2021 | - | 284 | 185 | |
reservoir/ | H | 13-Jul-2021 | - | 4,649 | 3,312 | |
rpc/ | H | 13-Jul-2021 | - | 7,687 | 5,840 | |
scripts/ | H | 13-Jul-2021 | - | 664 | 550 | |
storage/ | H | 13-Jul-2021 | - | 3,158 | 2,230 | |
testing/ | H | 13-Jul-2021 | - | 3,610 | 2,738 | |
transactionrecord/ | H | 13-Jul-2021 | - | 5,270 | 3,835 | |
util/ | H | 13-Jul-2021 | - | 950 | 712 | |
vendor/ | H | 03-May-2022 | - | 873,019 | 683,495 | |
zmqutil/ | H | 13-Jul-2021 | - | 1,032 | 708 | |
.gitignore | H A D | 13-Jul-2021 | 340 | 27 | 20 | |
.gitmodules | H A D | 13-Jul-2021 | 2.2 KiB | 52 | 51 | |
LICENSE | H A D | 13-Jul-2021 | 732 | 14 | 11 | |
README.md | H A D | 13-Jul-2021 | 6.5 KiB | 227 | 160 | |
go.mod | H A D | 13-Jul-2021 | 1.3 KiB | 34 | 31 | |
go.sum | H A D | 13-Jul-2021 | 13.6 KiB | 145 | 144 | |
release-notes.md | H A D | 13-Jul-2021 | 3.3 KiB | 119 | 76 | |
sonar-project.properties | H A D | 13-Jul-2021 | 129 | 6 | 5 |
README.md
1# bitmarkd - Main program 2 3[![Made by](https://img.shields.io/badge/Made%20by-Bitmark%20Inc-lightgrey.svg)](https://bitmark.com) 4[![GoDoc](https://godoc.org/github.com/bitmark-inc/bitmarkd?status.svg)](https://godoc.org/github.com/bitmark-inc/bitmarkd) 5[![Go Report Card](https://goreportcard.com/badge/github.com/bitmark-inc/bitmarkd)](https://goreportcard.com/report/github.com/bitmark-inc/bitmarkd) 6[![CircleCI](https://circleci.com/gh/bitmark-inc/bitmarkd.svg?style=svg)](https://circleci.com/gh/bitmark-inc/bitmarkd) 7 8Prerequisites 9 10* Install the go language package for the system 11* Configure environment variables for go system 12* Install the ZMQ4 and Argon2 libraries 13 14# Operating system specific setup commands 15 16## FreeBSD 17 18~~~~~ 19pkg install libzmq4 libargon2 git 20~~~~~ 21 22## MacOSX 23 24(be sure that homebrew is installed correctly) 25~~~ 26brew install argon2 27brew install zeromq 28brew install git 29~~~ 30 31## Ubuntu 32(tested on version 18.04) 33 34Install following packages 35 36~~~ 37sudo apt install libargon2-0-dev uuid-dev libzmq3-dev git 38~~~ 39 40## Debian 41(tested on version 9) 42 43First we need to add access to testing package's repository as well as 44to our current version, in this case stable. 45 46~~~ 47root@debian-bitmarkd:/# cat /etc/apt/sources.list.d/stable.list 48deb http://ftp.de.debian.org/debian/ stable main contrib non-free 49deb-src http://ftp.de.debian.org/debian/ stable main contrib non-free 50deb http://security.debian.org/ stable/updates main contrib non-free 51 52root@debian-bitmarkd:/# cat /etc/apt/sources.list.d/testing.list 53deb http://ftp.de.debian.org/debian/ testing main contrib non-free 54deb-src http://ftp.de.debian.org/debian/ testing main contrib non-free 55deb http://security.debian.org/ testing/updates main contrib non-free 56~~~ 57 58Now install libargon2 using: 59``` 60apt-get -t testing install libargon2-dev libargon2-1 61``` 62 63For the other packages, install from stable or testing, both versions work: 64``` 65apt install uuid-dev libzmq3-dev 66apt install git 67``` 68 69# Compilation commands for all operating systems 70 71To compile use use the `git` command to clone the repository and the 72`go` command to compile all commands. The process requires that the 73Go installation be 1.12 or later as the build process uses Go Modules. 74 75~~~~~ 76git clone https://github.com/bitmark-inc/bitmarkd 77cd bitmarkd 78go install -v ./... 79~~~~~ 80 81# Set up for running a node 82 83Note: ensure that the `${HOME}/go/bin` directory is on the path before 84continuing. The commands below assume that a checked out and compiled 85version of the system exists in the `${HOME}/bitmarkd` directory. 86 87## Setup and run bitmarkd 88 89Create the configuration directory, copy sample configuration, edit it 90to set up IP addresses, ports and local bitcoin testnet connection. 91The sample configuration has some embedded instructions for quick 92setup and only a few items near the beginning of the file need to be 93set for basic use. 94 95~~~~~ 96mkdir -p ~/.config/bitmarkd 97cp ~/bitmarkd/command/bitmarkd/bitmarkd.conf.sample ~/.config/bitmarkd/bitmarkd.conf 98${EDITOR} ~/.config/bitmarkd/bitmarkd.conf 99~~~~~ 100 101To see the bitmarkd sub-commands: 102 103~~~~~ 104bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" help 105~~~~~ 106 107Generate key files and certificates. 108 109~~~~~ 110bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" gen-peer-identity "${HOME}/.config/bitmarkd/" 111bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" gen-rpc-cert "${HOME}/.config/bitmarkd/" 112bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" gen-proof-identity "${HOME}/.config/bitmarkd/" 113~~~~~ 114 115Start the program. 116 117~~~~~ 118bitmarkd --config-file="${HOME}/.config/bitmarkd/bitmarkd.conf" start 119~~~~~ 120 121 122## Setup and run recorderd (the mining program) 123 124This is similar to the bitmarkd steps above. For mining on the local 125bitmarkd the sample configuration should work without changes. 126 127~~~~~ 128mkdir -p ~/.config/recorderd 129cp ~/bitmarkd/command/recorderd/recorderd.conf.sample ~/.config/recorderd/recorderd.conf 130${EDITOR} ~/.config/recorderd/recorderd.conf 131~~~~~ 132 133To see the recorderd sub-commands: 134 135~~~~~ 136recorderd --config-file="${HOME}/.config/recorderd/recorderd.conf" help 137~~~~~ 138 139Generate key files and certificates. 140 141~~~~~ 142recorderd --config-file="${HOME}/.config/recorderd/recorderd.conf" generate-identity "${HOME}/.config/recorderd/ 143~~~~~ 144 145Start the program. 146 147~~~~~ 148recorderd --config-file="${HOME}/.config/recorderd/recorderd.conf" start 149~~~~~ 150 151 152## Setup and run bitmark-cli (command line program to send transactions) 153 154Initialise the bitmark-cli for live and test networks creating a new 155account on each network. This setup is presuming that live or test 156bitmarkd will be running on the same machine so thatthe loopback 157address can be used. 158 159~~~~~ 160mkdir -p ~/.config/bitmark-cli 161bitmark-cli -n bitmark -i mylive setup -c 127.0.0.1:2130 -d 'my first live account' -n 162bitmark-cli -n testing -i mytest setup -c 127.0.0.1:12130 -d 'my first testing account' -n 163~~~~~ 164 165To see the cli sub-commands: or details on a specific command e.g., "setup" 166 167~~~~~ 168bitmark-cli help 169bitmark-cli help setup 170~~~~~ 171 172Note: If you wish to add more connections or change the default 173connection created above then it is necessary to edit the JSON 174configuration files to modify the connections list. 175 176 177# Prebuilt Binary 178 179* FreeBSD 180 181**Install bitmarkd bitmark-cli and recorderd** 182~~~~~ 183pkg install bitmark 184~~~~~ 185 186**Alternatively select one or more individual packages** 187~~~~~ 188pkg install bitmark-daemon 189pkg install bitmark-recorder 190pkg install bitmark-cli 191~~~~~ 192 193* Flatpak 194 195 Please refer to [wiki](https://github.com/bitmark-inc/bitmarkd/wiki/Instruction-for-Flatpak-Prebuilt) 196 197* Docker 198 199 Please refer to [bitmark-node](https://github.com/bitmark-inc/bitmark-node) 200 201# Coding 202 203* setup git hooks 204 205 Link git hooks directory, run command `./scripts/setup-hook.sh` at root of bitmarkd 206 directory. Currently it provides checks for two stages: 207 208 1. Before commit (`pre-commit`) 209 210 Runs `go lint` for every modified file. It shows suggestions but not 211 necessary to follow. 212 213 2. Before push to remote (`pre-push`) 214 215 Runs `go test` for whole directory. It is mandatory to pass this 216 check because generally, new modifications must not break existing 217 logic/behaviour. 218 219 Other optional actions are `sonaqube` and `go tool vet`. These two are 220 optional to follow since static code analysis just provide some advice. 221 222* all variables are camel case with no underscores 223* labels are all lowercase with '_' between words 224* imports and one single block 225* all break/continue must have label 226* avoid break in switch and select 227