Skip to content

Commit

Permalink
Merge pull request #1604 from mesg-foundation/dev
Browse files Browse the repository at this point in the history
Release v0.18.1
  • Loading branch information
Nicolas Mahé authored Jan 14, 2020
2 parents e3d2c02 + 8e249e0 commit 4387753
Show file tree
Hide file tree
Showing 27 changed files with 666 additions and 211 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Dockerfile

# build
/bin
!/bin/engine

# repo files
README.md
CHANGELOG.md
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## [v0.18.1](https://github.com/mesg-foundation/engine/releases/tag/v0.18.1)

#### Added

- ([#1580](https://github.com/mesg-foundation/engine/pull/1580)) Add execution metrics.
- ([#1595](https://github.com/mesg-foundation/engine/pull/1595)) Add cosmos cli for low-level utility functionality.

#### Changed

- ([#1572](https://github.com/mesg-foundation/engine/pull/1572)) Customize cosmos address prefix.
- ([#1601](https://github.com/mesg-foundation/engine/pull/1601)) Change default block time to 5sec and some token config.
- ([#1602](https://github.com/mesg-foundation/engine/pull/1602)) Change the mesg coin type to the registered one (470).

#### Fixed

- ([#1588](https://github.com/mesg-foundation/engine/pull/1588)) Fix supply module init.
- ([#1598](https://github.com/mesg-foundation/engine/pull/1598)) Fix account number used for signing tx.
- ([#1553](https://github.com/mesg-foundation/engine/pull/1553)) Add fees and estimation of tx's gas.

#### Removed

- ([#1579](https://github.com/mesg-foundation/engine/pull/1579)) Remove useless database config.

## [v0.18.0](https://github.com/mesg-foundation/engine/releases/tag/v0.18.0)

#### Breaking Changes
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all e2e check-version docker-publish docker-publish-dev docker-tools dev dev-stop dev-start lint dep build test mock protobuf changelog clean genesis clean-build clean-docker
.PHONY: all e2e check-version docker-publish docker-publish-dev docker-tools dev dev-stop dev-start lint dep build test mock protobuf changelog clean genesis clean-build clean-docker build-cmd-cosmos

MAJOR_VERSION := $(shell echo $(version) | cut -d . -f 1)
MINOR_VERSION := $(shell echo $(version) | cut -d . -f 1-2)
Expand Down Expand Up @@ -51,6 +51,10 @@ dep:
build: check-version dep
go build -mod=readonly -o ./bin/engine -ldflags="-X 'github.com/mesg-foundation/engine/version.Version=$(version)'" core/main.go

build-cmd-cosmos: dep
go build -mod=readonly -o ./bin/mesg-cosmos ./cmd/mesg-cosmos/main.go
go build -mod=readonly -o ./bin/mesg-cosmos-daemon ./cmd/mesg-cosmos-daemon/main.go

e2e: docker-dev
./scripts/run-e2e.sh

Expand Down
111 changes: 111 additions & 0 deletions cmd/mesg-cosmos-daemon/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package main

import (
"encoding/json"
"io"
"os"
"path/filepath"

"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/x/genaccounts"
genaccscli "github.com/cosmos/cosmos-sdk/x/genaccounts/client/cli"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/mesg-foundation/engine/codec"
"github.com/mesg-foundation/engine/config"
"github.com/mesg-foundation/engine/cosmos"
"github.com/mesg-foundation/engine/logger"
enginesdk "github.com/mesg-foundation/engine/sdk"
"github.com/spf13/cobra"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/cli"
"github.com/tendermint/tendermint/libs/log"
tmtypes "github.com/tendermint/tendermint/types"
db "github.com/tendermint/tm-db"
)

var (
defaultCLIHome = os.ExpandEnv("$HOME/.mesg-cosmos-cli")
app *cosmos.App
)

func main() {
cobra.EnableCommandSorting = false

// init app and codec
cfg, err := config.New()
if err != nil {
panic(err)
}
db, err := db.NewGoLevelDB("app", filepath.Join(cfg.Path, cfg.Cosmos.RelativePath))
if err != nil {
panic(err)
}
appFactory := cosmos.NewAppFactory(logger.TendermintLogger(), db, cfg.Cosmos.MinGasPrices)
enginesdk.NewBackend(appFactory)
app, err = cosmos.NewApp(appFactory)
if err != nil {
panic(err)
}
cosmos.CustomizeConfig()
cdc := codec.Codec

ctx := server.NewDefaultContext()

rootCmd := &cobra.Command{
Use: "mesg-cosmos-daemon",
Short: "ClI Daemon (server)",
PersistentPreRunE: server.PersistentPreRunEFn(ctx),
}
// CLI commands to initialize the chain
rootCmd.AddCommand(
genutilcli.InitCmd(ctx, cdc, app.BasicManager(), cfg.Tendermint.Config.RootDir),
genutilcli.CollectGenTxsCmd(ctx, cdc, genaccounts.AppModuleBasic{}, cfg.Tendermint.Config.RootDir),
genutilcli.GenTxCmd(
ctx, cdc, app.BasicManager(), staking.AppModuleBasic{},
genaccounts.AppModuleBasic{}, cfg.Tendermint.Config.RootDir, defaultCLIHome,
),
genutilcli.ValidateGenesisCmd(ctx, cdc, app.BasicManager()),
genaccscli.AddGenesisAccountCmd(ctx, cdc, cfg.Tendermint.Config.RootDir, defaultCLIHome),
)

server.AddCommands(ctx, cdc, rootCmd, newApp, exportAppStateAndTMValidators)

// prepare and add flags
executor := cli.PrepareBaseCmd(rootCmd, "MESG", cfg.Tendermint.Config.RootDir)
err = executor.Execute()
if err != nil {
panic(err)
}
}

func newApp(logger log.Logger, db db.DB, traceStore io.Writer) abci.Application {
return app
}

func exportAppStateAndTMValidators(logger log.Logger, db db.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailWhiteList []string,
) (json.RawMessage, []tmtypes.GenesisValidator, error) {
return nil, nil, nil
}

/*
genaccounts
func AddGenesisAccountCmd(ctx *server.Context, cdc *codec.Codec, defaultNodeHome, defaultClientHome string) *cobra.Command {
genutil
func CollectGenTxsCmd(ctx *server.Context, cdc *codec.Codec, genAccIterator types.GenesisAccountsIterator, defaultNodeHome string) *cobra.Command {
func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, smbh StakingMsgBuildingHelpers, genAccIterator types.GenesisAccountsIterator, defaultNodeHome, defaultCLIHome string) *cobra.Command {
func InitCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, defaultNodeHome string) *cobra.Command {
func MigrateGenesisCmd(_ *server.Context, cdc *codec.Codec) *cobra.Command {
func ValidateGenesisCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager) *cobra.Command {
server
func AddCommands(ctx *Context, cdc *codec.Codec, rootCmd *cobra.Command, appCreator AppCreator, appExport AppExporter) {
func StartCmd(ctx *Context, appCreator AppCreator) *cobra.Command {
func ExportCmd(ctx *Context, cdc *codec.Codec, appExporter AppExporter) *cobra.Command {
func ShowNodeIDCmd(ctx *Context) *cobra.Command {
func ShowValidatorCmd(ctx *Context) *cobra.Command {
func ShowAddressCmd(ctx *Context) *cobra.Command {
func VersionCmd(ctx *Context) *cobra.Command {
func UnsafeResetAllCmd(ctx *Context) *cobra.Command {
*/
Loading

0 comments on commit 4387753

Please sign in to comment.