Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlTheProgrammer committed Mar 8, 2022
0 parents commit 434cb32
Show file tree
Hide file tree
Showing 39 changed files with 31,802 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

*.exe
*.test
*.prof
*.log
*.env
tmp
dist
.vscode/
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
BUILD_DATE = `date +%FT%T%z`
BUILD_USER = $(USER)@`hostname`
VERSION = `git describe --tags`

# command to build and run on the local OS.
GO_BUILD = go build

# command to compiling the distributable. Specify GOOS and GOARCH for the target OS.
GO_DIST = CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO_BUILD) -a -tags netgo -ldflags "-w -X main.buildVersion=$(VERSION) -X main.buildDate=$(BUILD_DATE) -X main.buildUser=$(BUILD_USER)"

BINARY=bitcoin_reader

.PHONY: build

dist:
$(GO_DIST) -o dist/$(BINARY) cmd/node/main.go

run:
go run cmd/node/main.go

run-race:
go run -race cmd/node/main.go

deps:
go get -t ./...

test:
go test -coverprofile=tmp/coverage.out ./...

test-race:
go test -race ./...

test-all:
go clean -testcache
go test ./...

lint: golint vet goimports

vet:
ret=0 && test -z "$$(go vet ./... | tee /dev/stderr)" || ret=1 ; exit $$ret

golint:
ret=0 && test -z "$$(golint . | tee /dev/stderr)" || ret=1 ; exit $$ret

goimports:
ret=0 && test -z "$$(goimports -l . | tee /dev/stderr)" || ret=1 ; exit $$ret

tools:
[ -f $(GOPATH)/bin/goimports ] || go get golang.org/x/tools/cmd/goimports
[ -f $(GOPATH)/bin/golint ] || go get github.com/golang/lint/golint

clean:
rm -rf dist
go clean -testcache
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Bitcoin Reader

Bitcoin reader finds peers in the Bitcoin P2P network and listens to them. It always collects all
headers with valid proof of work. If a tx processor is provided then all txs are run through it as
they are seen on the network. If a block manager is provided then all blocks are fed through it.
Loading

0 comments on commit 434cb32

Please sign in to comment.