Skip to content

Commit

Permalink
merge main and resolve conflict in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ramin committed May 13, 2024
2 parents d728ac8 + 0c01987 commit a392daa
Show file tree
Hide file tree
Showing 30 changed files with 409 additions and 199 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "latest"

Expand All @@ -30,7 +30,7 @@ jobs:

- name: Deploy main
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./specs/book
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
go-version: ${{ inputs.go-version }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v5.1.0
uses: golangci/golangci-lint-action@v5.3.0
with:
args: --timeout 10m
version: v1.56
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
retention-days: 5

- name: upload coverage
uses: codecov/codecov-action@v4.1.0
uses: codecov/codecov-action@v4.3.1
with:
env_vars: OS
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ linters:
- whitespace
- nolintlint
- asciicheck
- dupword

issues:
exclude-rules:
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ else
endif
.PHONY: install

## install-global: Install the celestia-node binary (only for systems that support GNU coreutils, i.e. Linux).
install-global:
@echo "--> Installing Celestia"
@install -v ./build/* -t ${PREFIX}/bin/
@install -v ./build/* -t ${PREFIX}/bin
.PHONY: install-global

## go-install: Build and install the celestia-node binary into the GOBIN directory.
Expand Down Expand Up @@ -174,7 +175,7 @@ pb-gen:

## openrpc-gen: Generate OpenRPC spec for Celestia-Node's RPC api
openrpc-gen:
@go run ./cmd/docgen fraud header state share das p2p node blob da
@go run ${LDFLAGS} ./cmd/celestia docgen
.PHONY: openrpc-gen

## lint-imports: Lint only Go imports.
Expand Down
37 changes: 16 additions & 21 deletions cmd/docgen/openrpc.go → cmd/celestia/docgen.go
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
package main

import (
"context"
"encoding/json"
"os"

"github.com/spf13/cobra"

"github.com/celestiaorg/celestia-node/api/docgen"
"github.com/celestiaorg/celestia-node/api/rpc/client"
"github.com/celestiaorg/celestia-node/nodebuilder"
)

var rootCmd = &cobra.Command{
Use: "docgen [packages]",
Short: "docgen generates the openrpc documentation for Celestia Node packages",
RunE: func(_ *cobra.Command, moduleNames []string) error {
// 1. Open the respective nodebuilder/X/service.go files for AST parsing
var docgenCmd = &cobra.Command{
Use: "docgen",
Short: "docgen generates the openrpc documentation for all Celestia Node packages",
RunE: func(_ *cobra.Command, _ []string) error {
// 1. Collect all node's modules
moduleNames := make([]string, 0, len(client.Modules))
for module := range client.Modules {
moduleNames = append(moduleNames, module)
}

// 2. Open the respective nodebuilder/X/service.go files for AST parsing
nodeComments, permComments := docgen.ParseCommentsFromNodebuilderModules(moduleNames...)

// 2. Create an OpenRPC document from the map of comments + hardcoded metadata
// 3. Create an OpenRPC document from the map of comments + hardcoded metadata
doc := docgen.NewOpenRPCDocument(nodeComments, permComments)

// 3. Register the client wrapper interface on the document
// 4. Register the client wrapper interface on the document
for moduleName, module := range nodebuilder.PackageToAPI {
doc.RegisterReceiverName(moduleName, module)
}

// 4. Call doc.Discover()
// 5. Call doc.Discover()
d, err := doc.Discover()
if err != nil {
return err
}

// 5. Print to Stdout
// 6. Print to Stdout
jsonOut, err := json.MarshalIndent(d, "", " ")
if err != nil {
return err
Expand All @@ -42,14 +48,3 @@ var rootCmd = &cobra.Command{
return err
},
}

func main() {
err := run()
if err != nil {
os.Exit(1)
}
}

func run() error {
return rootCmd.ExecuteContext(context.Background())
}
1 change: 1 addition & 0 deletions cmd/celestia/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func init() {
bridgeCmd,
lightCmd,
fullCmd,
docgenCmd,
versionCmd,
)
rootCmd.SetHelpCommand(&cobra.Command{})
Expand Down
2 changes: 1 addition & 1 deletion core/eds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestTrulyEmptySquare(t *testing.T) {
require.True(t, eds.Equals(share.EmptyExtendedDataSquare()))
}

// TestNonZeroSquareSize tests that the DAH hash of a block with no transactions
// TestEmptySquareWithZeroTxs tests that the DAH hash of a block with no transactions
// is equal to the DAH hash for an empty root even if SquareSize is set to
// something non-zero. Technically, this block data is invalid because the
// construction of the square is deterministic, and the rules which dictate the
Expand Down
51 changes: 25 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ require (
github.com/BurntSushi/toml v1.3.2
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
github.com/benbjohnson/clock v1.3.5
github.com/celestiaorg/celestia-app v1.8.0
github.com/celestiaorg/celestia-app v1.9.0
github.com/celestiaorg/go-fraud v0.2.1
github.com/celestiaorg/go-header v0.6.1
github.com/celestiaorg/go-libp2p-messenger v0.2.0
github.com/celestiaorg/nmt v0.20.0
github.com/celestiaorg/rsmt2d v0.13.1
github.com/cosmos/cosmos-sdk v0.46.16
github.com/cosmos/cosmos-sdk/api v0.1.0
github.com/cristalhq/jwt v1.2.0
github.com/dgraph-io/badger/v4 v4.2.1-0.20240106094458-1c417aa3799c
github.com/etclabscore/go-openrpc-reflect v0.0.37
Expand Down Expand Up @@ -59,30 +58,30 @@ require (
github.com/stretchr/testify v1.9.0
github.com/tendermint/tendermint v0.34.29
go.opentelemetry.io/contrib/instrumentation/runtime v0.45.0
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0
go.opentelemetry.io/otel/metric v1.24.0
go.opentelemetry.io/otel/sdk v1.24.0
go.opentelemetry.io/otel/sdk/metric v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
go.opentelemetry.io/proto/otlp v1.1.0
go.opentelemetry.io/otel v1.26.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.26.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0
go.opentelemetry.io/otel/metric v1.26.0
go.opentelemetry.io/otel/sdk v1.26.0
go.opentelemetry.io/otel/sdk/metric v1.26.0
go.opentelemetry.io/otel/trace v1.26.0
go.opentelemetry.io/proto/otlp v1.2.0
go.uber.org/fx v1.21.1
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a
golang.org/x/sync v0.7.0
golang.org/x/text v0.14.0
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.32.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
)

require (
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand All @@ -103,7 +102,7 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/celestiaorg/merkletree v0.0.0-20230308153949-c33506a7aa26 // indirect
github.com/celestiaorg/quantum-gravity-bridge/v2 v2.1.2 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
Expand Down Expand Up @@ -165,7 +164,7 @@ require (
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
Expand All @@ -182,13 +181,13 @@ require (
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.0 // indirect
github.com/hashicorp/go-getter v1.7.4 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
Expand Down Expand Up @@ -310,27 +309,27 @@ require (
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/api v0.155.0 // indirect
google.golang.org/api v0.162.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit a392daa

Please sign in to comment.