• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H13-Jul-2021-1,080840

account/H13-Jul-2021-3,5203,091

announce/H13-Jul-2021-3,5692,529

asset/H13-Jul-2021-376243

avl/H13-Jul-2021-1,4741,137

background/H13-Jul-2021-306210

block/H13-Jul-2021-1,6441,182

blockdigest/H13-Jul-2021-425312

blockheader/H13-Jul-2021-367244

blockrecord/H13-Jul-2021-1,074781

chain/H13-Jul-2021-3916

command/H13-Jul-2021-11,6888,959

configuration/H13-Jul-2021-12467

constants/H13-Jul-2021-4618

counter/H13-Jul-2021-9852

currency/H13-Jul-2021-2,2241,709

debian/H13-Jul-2021-1,267735

difficulty/H13-Jul-2021-691490

doc/H13-Jul-2021-234177

fault/H13-Jul-2021-293236

genesis/H13-Jul-2021-385268

hooks/H13-Jul-2021-8045

merkle/H13-Jul-2021-3,2282,964

messagebus/H13-Jul-2021-420286

mode/H13-Jul-2021-173105

ownership/H13-Jul-2021-1,041705

pay/H13-Jul-2021-12075

payment/H13-Jul-2021-2,1871,647

peer/H13-Jul-2021-3,7122,758

proof/H13-Jul-2021-1,108804

publish/H13-Jul-2021-284185

reservoir/H13-Jul-2021-4,6493,312

rpc/H13-Jul-2021-7,6875,840

scripts/H13-Jul-2021-664550

storage/H13-Jul-2021-3,1582,230

testing/H13-Jul-2021-3,6102,738

transactionrecord/H13-Jul-2021-5,2703,835

util/H13-Jul-2021-950712

vendor/H03-May-2022-873,019683,495

zmqutil/H13-Jul-2021-1,032708

.gitignoreH A D13-Jul-2021340 2720

.gitmodulesH A D13-Jul-20212.2 KiB5251

LICENSEH A D13-Jul-2021732 1411

README.mdH A D13-Jul-20216.5 KiB227160

go.modH A D13-Jul-20211.3 KiB3431

go.sumH A D13-Jul-202113.6 KiB145144

release-notes.mdH A D13-Jul-20213.3 KiB11976

sonar-project.propertiesH A D13-Jul-2021129 65

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