From bea3419a6a3edfcf4ac8bb7b9e6fe7a0f3de68aa Mon Sep 17 00:00:00 2001 From: DevinZeng Date: Thu, 25 Apr 2024 19:30:04 +0800 Subject: [PATCH] add license header --- Makefile | 24 +++++++++++++++++++++++ artifact.go | 16 +++++++++++++++- cenotaph.go | 16 +++++++++++++++- common.go | 16 +++++++++++++++- common_test.go | 16 +++++++++++++++- doc.go | 46 +++++++++++++++++++++++++++++++++++++++++++++ edict.go | 16 +++++++++++++++- etching.go | 16 +++++++++++++++- etching_test.go | 16 +++++++++++++++- flag.go | 16 +++++++++++++++- flag_test.go | 16 +++++++++++++++- flaw.go | 16 +++++++++++++++- message.go | 16 +++++++++++++++- message_test.go | 16 +++++++++++++++- rune.go | 16 +++++++++++++++- rune_test.go | 16 +++++++++++++++- runeid.go | 16 +++++++++++++++- runeid_test.go | 16 +++++++++++++++- runstone.go | 16 +++++++++++++++- runstone_test.go | 16 +++++++++++++++- spaced_rune.go | 16 +++++++++++++++- spaced_rune_test.go | 16 +++++++++++++++- tag.go | 16 +++++++++++++++- tag_test.go | 16 +++++++++++++++- 24 files changed, 400 insertions(+), 22 deletions(-) create mode 100644 Makefile create mode 100644 doc.go diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6c1b73f --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +ALL_SRC := $(shell find . -name '*.go' -type f | sort) +install-tools: + @which golangci-lint > /dev/null || (echo 'install golangci-lint' && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3) + go install github.com/google/addlicense@latest + +add-license: + addlicense -c 'The BxELab studyzy Authors' $(ALL_SRC) + +check-license: + @ADD_LICENSE_OUT=`addlicense -check $(ALL_SRC) 2>&1`; \ + if [ "$$ADD_LICENSE_OUT" ]; then \ + echo "addlicense FAILED => add License errors:\n"; \ + echo "$$ADD_LICENSE_OUT\n"; \ + echo "Use 'make add-license' to fix this."; \ + exit 1; \ + else \ + echo "Check License finished successfully"; \ + fi +ut: + go test -v ./... + + +lint: + golangci-lint run ./... \ No newline at end of file diff --git a/artifact.go b/artifact.go index 1e2f403..471985b 100644 --- a/artifact.go +++ b/artifact.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone type Artifact struct { Cenotaph *Cenotaph diff --git a/cenotaph.go b/cenotaph.go index 1f0a165..b5b331c 100644 --- a/cenotaph.go +++ b/cenotaph.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone type Cenotaph struct { Etching *Rune diff --git a/common.go b/common.go index 0d13b90..3582055 100644 --- a/common.go +++ b/common.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/common_test.go b/common_test.go index c52a51b..39253fb 100644 --- a/common_test.go +++ b/common_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "math/big" diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..2ba5088 --- /dev/null +++ b/doc.go @@ -0,0 +1,46 @@ +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package runestone is an open-source implementation of the Bitcoin Rune protocol in Go. +// +// The runestone project aims to provide a robust, efficient, and easy-to-use library for developers +// to interact with the Rune protocol. It covers various aspects of the protocol, such as transaction +// handling, block validation, and network communication. +// +// Features: +// - Rune protocol implementation: This package contains a complete implementation of the Rune protocol, +// allowing developers to build and interact with Bitcoin Rune applications easily. +// - Modular design: The package is designed with modularity in mind, making it easy to extend and customize +// for specific use cases. +// - Efficient and performant: The Go language offers excellent performance and efficient memory usage, +// making this package suitable for use in high-performance applications. +// - Well-documented and tested: The package includes comprehensive documentation and test coverage, +// ensuring its reliability and ease of use. +// +// Getting started: +// To start using the runestone package, simply import it into your Go project: +// +// ``` +// go get github.com/bxelab/runestone +// ``` +// +// You can then use the various components provided by the package to interact with the Rune protocol, +// such as creating transactions, validating blocks, and communicating with other nodes on the network. +// +// For more information and examples, please refer to the package documentation and the project's +// GitHub repository. +// +// Contributions and feedback are welcome! If you encounter any issues or have suggestions for improvements, +// please open an issue on the project's GitHub repository or submit a pull request. +package runestone diff --git a/edict.go b/edict.go index b53e986..ffd8413 100644 --- a/edict.go +++ b/edict.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/etching.go b/etching.go index f60c646..3215278 100644 --- a/etching.go +++ b/etching.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "lukechampine.com/uint128" diff --git a/etching_test.go b/etching_test.go index 991b7fa..c39a883 100644 --- a/etching_test.go +++ b/etching_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "strings" diff --git a/flag.go b/flag.go index 8a36eef..c85b81c 100644 --- a/flag.go +++ b/flag.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import "lukechampine.com/uint128" diff --git a/flag_test.go b/flag_test.go index b52cbcd..63396f1 100644 --- a/flag_test.go +++ b/flag_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "testing" diff --git a/flaw.go b/flaw.go index 84ced04..74ce4cf 100644 --- a/flaw.go +++ b/flaw.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import "errors" diff --git a/message.go b/message.go index d43b210..e2ccc71 100644 --- a/message.go +++ b/message.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "github.com/btcsuite/btcd/wire" diff --git a/message_test.go b/message_test.go index d16aab5..994102a 100644 --- a/message_test.go +++ b/message_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "encoding/hex" diff --git a/rune.go b/rune.go index 717d114..df1cd50 100644 --- a/rune.go +++ b/rune.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/rune_test.go b/rune_test.go index fc1c737..b12b065 100644 --- a/rune_test.go +++ b/rune_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "math" diff --git a/runeid.go b/runeid.go index be96a62..3280aaf 100644 --- a/runeid.go +++ b/runeid.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/runeid_test.go b/runeid_test.go index a2f8573..9fbf8c5 100644 --- a/runeid_test.go +++ b/runeid_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "fmt" diff --git a/runstone.go b/runstone.go index 0ad4d22..4b032ad 100644 --- a/runstone.go +++ b/runstone.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/runstone_test.go b/runstone_test.go index 3de6979..08d79db 100644 --- a/runstone_test.go +++ b/runstone_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "encoding/hex" diff --git a/spaced_rune.go b/spaced_rune.go index 314dd38..d8d68c2 100644 --- a/spaced_rune.go +++ b/spaced_rune.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/spaced_rune_test.go b/spaced_rune_test.go index 04fb451..db09682 100644 --- a/spaced_rune_test.go +++ b/spaced_rune_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "testing" diff --git a/tag.go b/tag.go index 29ecef3..f89271d 100644 --- a/tag.go +++ b/tag.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "errors" diff --git a/tag_test.go b/tag_test.go index 16b57e3..d82dadf 100644 --- a/tag_test.go +++ b/tag_test.go @@ -1,4 +1,18 @@ -package go_runestone +// Copyright 2024 The BxELab studyzy Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runestone import ( "testing"