diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..7580a49 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,27 @@ +# Make sure to check the documentation at http://goreleaser.com +# --------------------------- +# GENERAL +# --------------------------- +before: + hooks: + - make all +snapshot: + name_template: "{{ .Tag }}" +changelog: + sort: asc + filters: + exclude: + - '^.github:' + - '^test:' + +# --------------------------- +# BUILDER +# --------------------------- +build: + skip: true +# --------------------------- +# Github Release +# --------------------------- +release: + prerelease: true + name_template: "Release v{{.Version}}" \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..abd6f1c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +# Fast runner (trick from @y0ssar1an) (out-dated) +sudo: false + +# Language of deployment +language: go + +# Version +go: + - 1.15.x + +# Environment variables +env: + - GO111MODULE=on + +# Only clone the most recent commit +git: + depth: 1 + +# Notifications off +notifications: + email: false + +# Run all scripts +script: + - make test-travis + +# After build success +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..be4bcd0 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,52 @@ +# Code of Merit + +1. The project creators, lead developers, core team, constitute +the managing members of the project and have final say in every decision +of the project, technical or otherwise, including overruling previous decisions. +There are no limitations to this decisional power. + +2. Contributions are an expected result of your membership on the project. +Don't expect others to do your work or help you with your work forever. + +3. All members have the same opportunities to seek any challenge they want +within the project. + +4. Authority or position in the project will be proportional +to the accrued contribution. Seniority must be earned. + +5. Software is evolutive: the better implementations must supersede lesser +implementations. Technical advantage is the primary evaluation metric. + +6. This is a space for technical prowess; topics outside of the project +will not be tolerated. + +7. Non technical conflicts will be discussed in a separate space. Disruption +of the project will not be allowed. + +8. Individual characteristics, including but not limited to, +body, sex, sexual preference, race, language, religion, nationality, +or political preferences are irrelevant in the scope of the project and +will not be taken into account concerning your value or that of your contribution +to the project. + +9. Discuss or debate the idea, not the person. + +10. There is no room for ambiguity: Ambiguity will be met with questioning; +further ambiguity will be met with silence. It is the responsibility +of the originator to provide requested context. + +11. If something is illegal outside the scope of the project, it is illegal +in the scope of the project. This Code of Merit does not take precedence over +governing law. + +12. This Code of Merit governs the technical procedures of the project not the +activities outside of it. + +13. Participation on the project equates to agreement of this Code of Merit. + +14. No objectives beyond the stated objectives of this project are relevant +to the project. Any intent to deviate the project from its original purpose +of existence will constitute grounds for remedial action which may include +expulsion from the project. + +This document is the Code of Merit (`http://code-of-merit.org`), version 1.0. \ No newline at end of file diff --git a/CODE_STANDARDS.md b/CODE_STANDARDS.md new file mode 100644 index 0000000..6d34d16 --- /dev/null +++ b/CODE_STANDARDS.md @@ -0,0 +1,37 @@ +# Code Standards + +This project uses the following code standards and specifications from: +- [effective go](https://golang.org/doc/effective_go.html) +- [go tests](https://golang.org/pkg/testing/) +- [go examples](https://golang.org/pkg/testing/#hdr-Examples) +- [go benchmarks](https://golang.org/pkg/testing/#hdr-Benchmarks) +- [gofmt](https://golang.org/cmd/gofmt/) +- [golint](https://github.com/golang/lint) +- [godoc](https://godoc.org/golang.org/x/tools/cmd/godoc) +- [vet](https://golang.org/cmd/vet/) +- [report card](https://goreportcard.com/) + +### *effective go* standards +View the [effective go](https://golang.org/doc/effective_go.html) standards documentation. + +### *golint* specifications +The package [golint](https://github.com/golang/lint) differs from [gofmt](https://golang.org/cmd/gofmt/). The package [gofmt](https://golang.org/cmd/gofmt/) formats Go source code, whereas [golint](https://github.com/golang/lint) prints out style mistakes. The package [golint](https://github.com/golang/lint) differs from [vet](https://golang.org/cmd/vet/). The package [vet](https://golang.org/cmd/vet/) is concerned with correctness, whereas [golint](https://github.com/golang/lint) is concerned with coding style. The package [golint](https://github.com/golang/lint) is in use at Google, and it seeks to match the accepted style of the open source [Go project](https://golang.org/). + +How to install [golint](https://github.com/golang/lint): +```shell script +go get -u golang.org/x/lint/golint +cd ../go-bitcoin +golint +``` + +### *go vet* specifications +[Vet](https://golang.org/cmd/vet/) examines Go source code and reports suspicious constructs. [Vet](https://golang.org/cmd/vet/) uses heuristics that do not guarantee all reports are genuine problems, but it can find errors not caught by the compilers. + +How to run [vet](https://golang.org/cmd/vet/): +```shell script +cd ../go-bitcoin +go vet -v +``` + +### *godoc* specifications +All code is written with documentation in mind. Follow the best practices with naming, examples and function descriptions. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7c5276b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# How to contribute + +Please send a GitHub Pull Request to with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). The more tests the merrier. Please follow the coding conventions (below) and make sure all of your commits are atomic (one feature per commit). + +## Testing + +All tests follow the standard Go testing pattern. +- [Go Tests](https://golang.org/pkg/testing/) +- [Go Examples](https://golang.org/pkg/testing/#hdr-Examples) +- [Go Benchmarks](https://golang.org/pkg/testing/#hdr-Benchmarks) + +## Coding conventions + +This project follows [effective Go standards](https://golang.org/doc/effective_go.html) and uses additional convention tools: +- [godoc](https://godoc.org/golang.org/x/tools/cmd/godoc) +- [golint](https://github.com/golang/lint) +- [vet](https://golang.org/cmd/vet/) +- [GoReportCard.com](https://goreportcard.com/report/github.com/rohenaz/go-bitcoin) \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9709db4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 @rohenaz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file