-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simapp implementation as an example chain
- Loading branch information
MalteHerrmann
committed
Aug 6, 2024
1 parent
ab675cc
commit c9eace0
Showing
16 changed files
with
4,408 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/usr/bin/make -f | ||
|
||
VERSION ?= $(shell echo $(shell git describe --tags --always) | sed 's/^v//') | ||
TMVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') | ||
COMMIT := $(shell git log -1 --format='%H') | ||
BINDIR ?= $(GOPATH)/bin | ||
EXAMPLE_BINARY = osd | ||
BUILDDIR ?= $(CURDIR)/build | ||
|
||
export GO111MODULE = on | ||
|
||
# Default target executed when no arguments are given to make. | ||
default_target: all | ||
|
||
.PHONY: default_target | ||
|
||
# process build tags | ||
build_tags = netgo | ||
|
||
ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS))) | ||
build_tags += gcc | ||
endif | ||
build_tags += $(BUILD_TAGS) | ||
build_tags := $(strip $(build_tags)) | ||
|
||
# process linker flags | ||
|
||
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=os \ | ||
-X github.com/cosmos/cosmos-sdk/version.AppName=$(EXAMPLE_BINARY) \ | ||
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ | ||
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ | ||
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TMVERSION) | ||
|
||
# DB backend selection | ||
ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS))) | ||
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb | ||
endif | ||
|
||
# add build tags to linker flags | ||
whitespace := $(subst ,, ) | ||
comma := , | ||
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) | ||
ldflags += -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" | ||
|
||
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) | ||
ldflags += -w -s | ||
endif | ||
ldflags += $(LDFLAGS) | ||
ldflags := $(strip $(ldflags)) | ||
|
||
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' | ||
# check for nostrip option | ||
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) | ||
BUILD_FLAGS += -trimpath | ||
endif | ||
|
||
# check if no optimization option is passed | ||
# used for remote debugging | ||
ifneq (,$(findstring nooptimization,$(COSMOS_BUILD_OPTIONS))) | ||
BUILD_FLAGS += -gcflags "all=-N -l" | ||
endif | ||
|
||
# # The below include contains the tools and runsim targets. | ||
# include contrib/devtools/Makefile | ||
|
||
############################################################################### | ||
### Build ### | ||
############################################################################### | ||
|
||
BUILD_TARGETS := build install | ||
|
||
build: BUILD_ARGS=-o $(BUILDDIR)/ | ||
build-linux: | ||
GOOS=linux GOARCH=amd64 $(MAKE) build | ||
|
||
$(BUILD_TARGETS): go.sum $(BUILDDIR)/ | ||
CGO_ENABLED="1" go $@ $(BUILD_FLAGS) $(BUILD_ARGS) ./... | ||
|
||
$(BUILDDIR)/: | ||
mkdir -p $(BUILDDIR)/ | ||
|
||
distclean: clean tools-clean | ||
|
||
clean: | ||
rm -rf \ | ||
$(BUILDDIR)/ \ | ||
artifacts/ \ | ||
tmp-swagger-gen/ | ||
|
||
all: build | ||
|
||
build-all: build lint test vulncheck | ||
|
||
.PHONY: distclean clean build-all | ||
|
||
############################################################################### | ||
### Tools & Dependencies ### | ||
############################################################################### | ||
|
||
go.sum: go.mod | ||
echo "Ensure dependencies have not been modified ..." >&2 | ||
go mod verify | ||
go mod tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Example evmOS Chain | ||
|
||
This directory contains an example chain that uses the evmOS modules. | ||
It is based on the simapp implementation on the Cosmos SDK repository, | ||
which itself is a simplified version of a Cosmos SDK-based blockchain. | ||
|
||
This chain implementation is used to demonstrate the integration of evmOS | ||
as well as to provide a chain object for testing purposes within the repository. | ||
|
||
## Config | ||
|
||
By default, this chain has the following configuration: | ||
|
||
| Option | Value | | ||
|---------------------|----------------| | ||
| Binary | `osd` | | ||
| Chain ID | `os_9005-1` | | ||
| Denomination | `aos` | | ||
| EVM flavor | permissionless | | ||
| Enabled Precompiles | all | | ||
| Custom Opcodes | - | | ||
|
||
## Running The Chain | ||
|
||
To run the example, execute the local node script found within this repository: | ||
|
||
```bash | ||
./local_node.sh [FLAGS] | ||
``` | ||
|
||
Available flags are: | ||
|
||
- `-y`: Overwrite previous database | ||
- `-n`: Do **not** overwrite previous database | ||
- `--no-install`: Skip installation of the binary | ||
|
||
## Available Cosmos SDK Modules | ||
|
||
As mentioned above, this exemplary chain implementation is a reduced version of `simapp`. | ||
Specifically, instead of offering access to all Cosmos SDK modules, it just includes the following: | ||
|
||
- `auth` | ||
- `authz` | ||
- `bank` | ||
- `capability` | ||
- `consensus` | ||
- `distribution` | ||
- `evidence` | ||
- `feegrant` | ||
- `genutil` | ||
- `gov` | ||
- `mint` | ||
- `params` | ||
- `slashing` | ||
- `staking` | ||
- `upgrade` |
Oops, something went wrong.