Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/make -f

VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')

export GO111MODULE = on

# process build tags

LEDGER_ENABLED ?= true
build_tags = netgo
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
GCCEXE = $(shell where gcc.exe 2> NUL)
ifeq ($(GCCEXE),)
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
build_tags += ledger
endif
else
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S),OpenBSD)
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
else
GCC = $(shell command -v gcc 2> /dev/null)
ifeq ($(GCC),)
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
build_tags += ledger
endif
endif
endif
endif

build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=sei \
-X github.com/cosmos/cosmos-sdk/version.ServerName=seid \
-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=$(build_tags_comma_sep)"

ifeq ($(LINK_STATICALLY),true)
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'

#### Command List ####

all: lint install

install: go.sum
go install $(BUILD_FLAGS) ./cmd/seid

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify

lint:
golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
go mod verify

build:
go build $(BUILD_FLAGS) -o ./build/seid ./cmd/seid
8 changes: 6 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import (

const (
AccountAddressPrefix = "cosmos"
Name = "sei-chain"
Name = "sei"
)

// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals
Expand Down Expand Up @@ -245,6 +245,8 @@ type App struct {
// sm is the simulation manager
sm *module.SimulationManager

configurator module.Configurator

tracingInfo *tracing.TracingInfo
}

Expand Down Expand Up @@ -571,7 +573,8 @@ func New(

app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()))
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
app.mm.RegisterServices(app.configurator)

// create the simulation manager and define the order of the modules for deterministic simulations
app.sm = module.NewSimulationManager(
Expand All @@ -595,6 +598,7 @@ func New(
)
app.sm.RegisterStoreDecoders()

app.RegisterUpgradeHandlers()
// initialize stores
app.MountKVStores(keys)
app.MountTransientStores(tkeys)
Expand Down
21 changes: 21 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package app

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const UPGRADE_1_0_1_BETA = "upgrade-1.0.1beta"

func (app App) RegisterUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(UPGRADE_1_0_1_BETA, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// Upgrade specific logic goes here
// For now, remove dex, epoch and oracle from the version map since
// they do not yet have upgrade logic
delete(fromVM, "dex")
delete(fromVM, "epoch")
delete(fromVM, "oracle")
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})
}
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ starport chain serve
### Internal tool
First build the tool
```
go build -o build/seid ./cmd/sei-chaind/
make install
```

If you've run the chain before, you may have leftover cruft. Run the following to reset the state.
```
./build/seid unsafe-reset-all
seid unsafe-reset-all
```

Next, initialize the chain. This creates the genesis field:
```
./build/seid init demo --chain-id sei-chain
seid init {moniker} --chain-id sei-chain
```

Finally, start the chain:
```
./build/seid start
seid start
```


Expand Down
2 changes: 1 addition & 1 deletion scripts/initialize_local_test_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker run -d --name jaeger \
jaegertracing/all-in-one:1.33

echo "Building..."
go build -o build/seid ./cmd/sei-chaind/
go build -o build/seid ./cmd/seid/
echo $password | sudo -S rm -r ~/.sei-chain/
echo $password | sudo -S rm -r ~/test_accounts/
./build/seid unsafe-reset-all
Expand Down