diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 722bae65f..1f6aedb53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,15 +27,15 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish-buf: - name: Publish buf.build proto - runs-on: self-hosted - needs: release - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: bufbuild/buf-setup-action@v1 - with: - buf_token: ${{ secrets.BUF_TOKEN }} - input: "proto" + # publish-buf: + # name: Publish buf.build proto + # runs-on: self-hosted + # needs: release + # steps: + # - uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - uses: bufbuild/buf-setup-action@v1 + # with: + # buf_token: ${{ secrets.BUF_TOKEN }} + # input: "proto" diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8931b52f3..2d03f5d68 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,18 +1,8 @@ # Project information. project_name: sonrd - -env: - - CGO_ENABLED=1 - - WASMVM_URL=https://github.com/CosmWasm/wasmvm/releases/download - - COSMWASM_VERSION=v1.2.4 builds: # Build - Linux (amd64) - id: sonrd-linux-amd64 - env: - - CC=x86_64-linux-gnu-gcc - hooks: - pre: - - wget {{ .Env.WASMVM_URL }}/v1.3.0/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a main: ./cmd/sonrd binary: sonrd goos: @@ -27,22 +17,13 @@ builds: - -X github.com/cosmos/cosmos-sdk/version.AppName=sonrd - -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} - - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,muslc,osusergo + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo - -w -s - - -linkmode=external - - -extldflags '-Wl,-z,muldefs -static -lm' tags: - netgo - - muslc - - osusergo # Build - Linux (arm64) - id: sonrd-linux-arm64 - env: - - CC=aarch64-linux-gnu-gcc - hooks: - pre: - - wget {{ .Env.WASMVM_URL }}/v1.3.0/libwasmvm_muslc.aarch64.a -O /opt/homebrew/lib/aarch64-linux-gnu/libwasmvm_muslc.a main: ./cmd/sonrd binary: sonrd goos: @@ -57,24 +38,15 @@ builds: - -X github.com/cosmos/cosmos-sdk/version.AppName=sonrd - -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} - - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,muslc,osusergo + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo - -w -s - - -linkmode=external - - -extldflags '-Wl,-z,muldefs -static -lm' tags: - netgo - - muslc - - ousergo + # Build - Darwin (amd64) - id: sonrd-darwin-amd64 main: ./cmd/sonrd/main.go binary: sonrd - hooks: - pre: - - wget {{ .Env.WASMVM_URL }}/v1.3.0/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a - env: - - CC=o64-clang - - CGO_LDFLAGS=-L/lib goos: - darwin goarch: @@ -87,24 +59,15 @@ builds: - -X github.com/cosmos/cosmos-sdk/version.AppName=sonrd - -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} - - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo - -w -s - - -linkmode=external tags: - netgo - - static_wasm - - ledger # Build - Darwin (arm64) - id: sonrd-darwin-arm64 main: ./cmd/sonrd/main.go binary: sonrd - hooks: - pre: - - wget {{ .Env.WASMVM_URL }}/v1.3.0/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a - env: - - CC=oa64-clang - - CGO_LDFLAGS=-L/lib goos: - darwin goarch: @@ -117,13 +80,10 @@ builds: - -X github.com/cosmos/cosmos-sdk/version.AppName=sonrd - -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} - -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} - - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm + - -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo - -w -s - - -linkmode=external tags: - netgo - - static_wasm - - ledger # ! ||--------------------------------------------------------------------------------|| # ! || Tarball Archives || diff --git a/cmd/sonrd/cmd/genaccounts.go b/cmd/sonrd/cmd/genaccounts.go index d5ec65337..08dfcfbee 100644 --- a/cmd/sonrd/cmd/genaccounts.go +++ b/cmd/sonrd/cmd/genaccounts.go @@ -1,4 +1,4 @@ -package cmd +package sonrcmd import ( "bufio" diff --git a/cmd/sonrd/cmd/geninit.go b/cmd/sonrd/cmd/geninit.go index 6ff324f09..93cff9deb 100644 --- a/cmd/sonrd/cmd/geninit.go +++ b/cmd/sonrd/cmd/geninit.go @@ -1,4 +1,4 @@ -package cmd +package sonrcmd import ( "bufio" diff --git a/cmd/sonrd/cmd/gentx.go b/cmd/sonrd/cmd/gentx.go index 52a1c5ff0..aa7442c3f 100644 --- a/cmd/sonrd/cmd/gentx.go +++ b/cmd/sonrd/cmd/gentx.go @@ -1,4 +1,4 @@ -package cmd +package sonrcmd import ( "bufio" diff --git a/cmd/sonrd/cmd/launch.go b/cmd/sonrd/cmd/launch.go deleted file mode 100644 index c99d2f16d..000000000 --- a/cmd/sonrd/cmd/launch.go +++ /dev/null @@ -1,89 +0,0 @@ -package cmd - -import ( - "os/exec" - - "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/sonr-io/core/config" - "github.com/spf13/cobra" -) - -// LaunchCmd returns a command that initializes all files needed for Tendermint -// and the respective application. -func LaunchCmd(mbm module.BasicManager, txEncCfg client.TxEncodingConfig, genBalIterator types.GenesisBalancesIterator, defaultNodeHome string) *cobra.Command { - cmd := &cobra.Command{ - Use: "launch", - Short: "Launch sonr node with all files needed for Tendermint and the respective application.", - Long: `Initialize validators's and node's configuration files.`, - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - err := baseInitFunc(mbm, cmd, args) - if err != nil { - return err - } - // Update with flags - err = updateAppToml(config.GetFlags(cmd)) - if err != nil { - return err - } - return baseGentxFunc(mbm, txEncCfg, genBalIterator, cmd, args) - }, - } - cmd.Flags().String(cli.HomeFlag, defaultNodeHome, "node's home directory") - cmd.Flags().BoolP(FlagOverwrite, "o", false, "overwrite the genesis.json file") - cmd.Flags().Bool(FlagRecover, false, "provide seed phrase to recover existing key instead of creating") - cmd.Flags().String(flags.FlagChainID, config.EnvChainID(), "genesis file chain-id, if left blank will be randomly created") - cmd.Flags().Int64(flags.FlagInitHeight, 1, "specify the initial block height at genesis") - config.AppendFlags(cmd) - return cmd -} - -func updateAppToml(flags config.Flags) error { - if flags.GrpcAddress != "" { - cmd := exec.Command("sed", "-i", "s/grpc.address = .*/grpc.address = \""+flags.GrpcAddress+"\"/", flags.UsrHomeDir+"/.sonr/config/app.toml") - err := cmd.Run() - if err != nil { - return err - } - } - if flags.APIAddress != "" { - cmd := exec.Command("sed", "-i", "s/api.address = .*/api.address = \""+flags.APIAddress+"\"/", flags.UsrHomeDir+"/.sonr/config/app.toml") - err := cmd.Run() - if err != nil { - return err - } - } - if flags.MinimumGasPrices != "" { - cmd := exec.Command("sed", "-i", "s/minimum-gas-prices = .*/minimum-gas-prices = \""+flags.MinimumGasPrices+"\"/", flags.UsrHomeDir+"/.sonr/config/app.toml") - err := cmd.Run() - if err != nil { - return err - } - } - if flags.Seeds != "" { - cmd := exec.Command("sed", "-i", "s/p2p.seeds = .*/p2p.seeds = \""+flags.Seeds+"\"/", flags.UsrHomeDir+"/.sonr/config/config.toml") - err := cmd.Run() - if err != nil { - return err - } - } - if flags.PersistentPeers != "" { - cmd := exec.Command("sed", "-i", "s/p2p.persistent_peers = .*/p2p.persistent_peers = \""+flags.PersistentPeers+"\"/", flags.UsrHomeDir+"/.sonr/config/config.toml") - err := cmd.Run() - if err != nil { - return err - } - } - if flags.PrivatePeerIds != "" { - cmd := exec.Command("sed", "-i", "s/p2p.private_peer_ids = .*/p2p.private_peer_ids = \""+flags.PrivatePeerIds+"\"/", flags.UsrHomeDir+"/.sonr/config/config.toml") - err := cmd.Run() - if err != nil { - return err - } - } - return nil -} diff --git a/cmd/sonrd/cmd/plugin.go b/cmd/sonrd/cmd/plugin.go index 548b5564b..ddce7f961 100644 --- a/cmd/sonrd/cmd/plugin.go +++ b/cmd/sonrd/cmd/plugin.go @@ -1,4 +1,4 @@ -package cmd +package sonrcmd import ( "context" diff --git a/cmd/sonrd/cmd/plugin_default.go b/cmd/sonrd/cmd/plugin_default.go index 950d2cdbd..fb8651e4d 100644 --- a/cmd/sonrd/cmd/plugin_default.go +++ b/cmd/sonrd/cmd/plugin_default.go @@ -1,4 +1,4 @@ -package cmd +package sonrcmd import ( "fmt" diff --git a/cmd/sonrd/cmd/root.go b/cmd/sonrd/cmd/root.go index b40613f93..3cce85240 100644 --- a/cmd/sonrd/cmd/root.go +++ b/cmd/sonrd/cmd/root.go @@ -1,4 +1,4 @@ -package cmd +package sonrcmd import ( "context" @@ -145,12 +145,6 @@ func initRootCmd( banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, ), - LaunchCmd( - app.ModuleBasics, - encodingConfig.TxConfig, - banktypes.GenesisBalancesIterator{}, - app.DefaultNodeHome, - ), NewPlugin(), genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index a0398239b..2b35d9a19 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -7,12 +7,12 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/sonr-io/core/app" - "github.com/sonr-io/core/cmd/sonrd/cmd" + sonrcmd "github.com/sonr-io/core/cmd/sonrd/cmd" ) func main() { - rootCmd, _ := cmd.NewRootCmd() + rootCmd, _ := sonrcmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, "SONR", app.DefaultNodeHome); err != nil { switch e := err.(type) { case server.ErrorCode: