Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 992 Bytes

DEVELOPMENT.md

File metadata and controls

47 lines (32 loc) · 992 Bytes

Development.

Tinychain development uses continuous integration. There are multiple workflows on submission of a PR:

  • build: builds the Go package.
  • test: runs the test suite.
  • format - checks the Go code for formatting.
  • vet - a specialised Go tool which functions like a linter, catching potential errors in code.

Generating API documentation.

go install golang.org/x/tools/cmd/godoc@latest
godoc -http=:6060

Running tests.

Individual.

go test -v -run TestStartPeerHeartbeat ./...

# ignore test cache.
go test -v -count=1 -run TestStartPeerHeartbeat ./...

The entire test suite.

go test -v -run ./... > test.log

Benchmarking.

Go will run your function multiple times and find the median for a benchmark:

go test -v -bench=1 -run TestBenchmarkTxOpsPerDay

Analysing binary size.

go install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest
gsa --web  build/tinychain-darwin-arm64