Skip to content

Commit

Permalink
Merge branch 'genesis-v1.0.0' into cronos-v1.0.15
Browse files Browse the repository at this point in the history
Signed-off-by: ZENODE <[email protected]>
  • Loading branch information
zenodeapp authored Jan 6, 2024
2 parents 1f5e261 + f063615 commit 9ead82e
Show file tree
Hide file tree
Showing 20 changed files with 395,340 additions and 249 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COVERAGE ?= coverage.txt

GOPATH ?= $(shell $(GO) env GOPATH)
BINDIR ?= ~/go/bin
BINARY_NAME = genesisd
NETWORK ?= mainnet
LEDGER_ENABLED ?= true
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
Expand Down Expand Up @@ -77,8 +78,8 @@ comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags
ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=cronos \
-X github.com/cosmos/cosmos-sdk/version.AppName=cronosd \
ldflags += -X github.com/cosmos/cosmos-sdk/version.Name=genesis \
-X github.com/cosmos/cosmos-sdk/version.AppName=$(BINARY_NAME) \
-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)
Expand All @@ -91,10 +92,12 @@ endif

all: build
build: check-network print-ledger go.sum
@go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/cronosd ./cmd/cronosd
@go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/$(BINARY_NAME) ./cmd/cronosd

install: check-network print-ledger go.sum
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd
@go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/$(BINARY_NAME) ./cmd/cronosd
@mkdir -p $(BINDIR)
@mv $(BUILDDIR)/$(BINARY_NAME) $(BINDIR)/$(BINARY_NAME)

test:
@go test -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic
Expand Down Expand Up @@ -169,8 +172,8 @@ test-sim-after-import: runsim

test-sim-custom-genesis-multi-seed: runsim
@echo "Running multi-seed custom genesis simulation..."
@echo "By default, ${HOME}/.cronosd/config/genesis.json will be used."
@$(BINDIR)/runsim -Genesis=${HOME}/.cronosd/config/genesis.json -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation
@echo "By default, ${HOME}/.$(BINARY_NAME)/config/genesis.json will be used."
@$(BINDIR)/runsim -Genesis=${HOME}/.$(BINARY_NAME)/config/genesis.json -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation

test-sim-multi-seed-long: runsim
@echo "Running long multi-seed application simulation. This may take awhile!"
Expand Down
173 changes: 24 additions & 149 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,160 +1,35 @@
<!--
parent:
order: false
-->


<div align="center">
<h1> <img src="./assets/cronos.svg" alt="Cronos Logo" width="300px" /> </h1>
</div>
<br />
<h1 align="center">
GenesisL1 Mainnet (Cronos fork)
</h1>

<p align="center">
<a href="https://github.com/crypto-org-chain/cronos/actions/workflows/build.yml"><img label="Build Status" src="https://github.com/crypto-org-chain/cronos/actions/workflows/build.yml/badge.svg" /></a>
<a href="https://codecov.io/gh/crypto-org-chain/cronos"><img label="Code Coverage" src="https://codecov.io/gh/crypto-org-chain/cronos/branch/main/graph/badge.svg" /></a>
<a href="https://discord.gg/pahqHz26q4"><img label="Discord" src="https://img.shields.io/discord/783264383978569728.svg?color=7289da&label=Cronos&logo=discord&style=flat-square" /></a>
<img src="https://github.com/zenodeapp/genesisL1/assets/108588903/be368fa2-a154-48a6-b04b-8eb452b02033" alt="GenesisL1" width="150" height="150"/>
</p>

## Table of Contents

- [Table of Contents](#table-of-contents)
- [1. Description](#1-description)
- [2. Contributing](#2-contributing)
- [3. License](#3-license)
- [4. Documentation](#4-documentation)
- [5. Build full node](#5-build-full-node)
- [6. Start a local Development Network and Node](#6-start-a-local-development-network-and-node)
- [7. Send Your First Transaction](#7-send-your-first-transaction)
- [8. Testing](#8-testing)
- [9. Pystarport Quick Start](#9-pystarport-quick-start)
- [install latest python (for linux)](#install-latest-python-for-linux)
- [set path (for linux or for mac)](#set-path-for-linux-or-for-mac)
- [install pystarport](#install-pystarport)
- [quick start](#quick-start)
- [get status](#get-status)
- [stop all](#stop-all)
- [10. Useful links](#10-useful-links)

<a id="description" />

## 1. Description

**Cronos** is the Crypto.org EVM chain that aims to massively scale the DeFi ecosystem.

<a id="contributing" />

## 2. Contributing

Please abide by the [Code of Conduct](CODE_OF_CONDUCT.md) in all interactions,
and the [contributing guidelines](CONTRIBUTING.md) when submitting code.

<a id="license" />

## 3. License

[Apache 2.0](./LICENSE)

<a id="documentation" />

## 4. Documentation

[Technical documentation](http://cronos.org/docs).

<a id="build" />

## 5. Build full node

```bash
# COSMOS_BUILD_OPTIONS=rocksdb make install
make build
```

<a id="start-local-full-node" />

## 6. Start a local Development Network and Node

Please follow this [documentation](https://cronos.org/docs/getting-started/local-devnet.html#devnet-running-latest-development-node) to run a local devnet.

<a id="send-first-transaction" />

## 7. Send Your First Transaction

After setting the local devnet, you may interact with the your local blockchain by following this [documentation](https://cronos.org/docs/getting-started/local-devnet.html#interact-with-the-chain).

<a id="testing" />

## 8. Testing

There are different tests that can be executed in the following ways:

- unit tests: `make test`
- [integration tests](./docs/integration-test.md)
<a id="pystarport" />

## 9. Pystarport Quick Start

you can install pystarport to manage nodes for development.

### install latest python (for linux)

python version should be 3.8 or above.
you can install python like this.

```
git clone [email protected]:python/cpython.git
cd cpython
git checkout tags/v3.9.5
./configure
make
sudo make install
```

### set path (for linux or for mac)
in some cases, if there are multiple python versions, pystarport cannot be found.
then adjust python path.
also `$HOME/.local/bin` should be included to the PATH.

```
export PATH=/usr/local/bin:$HOME/.local/bin:$PATH
```

### install pystarport

```
python3 -m pip install pystarport
```

### quick start

run two nodes devnet

```
pystarport serve --config ./scripts/cronos-devnet.yaml
```

### get status

```
pystarport supervisorctl status
```
<p align="center">
Chain ID <b>genesis_29-2</b>
</p>

### stop all
<p align="center">
A source code fork of <b>Cronos</b> and <b>Ethermint</b>
</p>

```
pystarport supervisorctl stop all
```
<p align="center">
Cosmos SDK <b>v0.46.15</b>
</p>

---

<a id="useful-links" />
> [!IMPORTANT]
> **For Full-Node Syncing**
>
> If you wish to sync a full node, then you'll have to follow the instructions in the `genesis-evmos` repository first before continuing. This for we were an Evmos-fork before we made the decision to hard fork to Cronos.
## Node requirements

## 10. Useful links
- 300GB+ good hard drive disk
- 8GB+ RAM
- 4 CPU Threads
- Good Internet Connection

- [Project Website](http://cronos.org/)
- [Technical Documentation](http://cronos.org/docs)
- Community chatrooms (non-technical): [Discord](https://discord.gg/nsp9JTC) [Telegram](https://t.me/CryptoComOfficial)
- Developer community channel (technical): [![Support Server](https://img.shields.io/discord/783264383978569728.svg?color=7289da&label=Cronos&logo=discord&style=flat-square)](https://discord.gg/pahqHz26q4)
- [Ethermint](https://github.com/evmos/ethermint) by Tharsis
- [Cosmos SDK documentation](https://docs.cosmos.network)
- [Cosmos Discord](https://discord.gg/W8trcGV)
- [Pystarport](https://github.com/crypto-com/pystarport/blob/main/README.md)
## Instructions
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import (
)

const (
Name = "cronos"
Name = "genesis"

// AddrLen is the allowed length (in bytes) for an address.
//
Expand Down Expand Up @@ -212,6 +212,7 @@ func init() {
}

DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
sdk.DefaultPowerReduction = sdk.NewIntFromUint64(1000000000000000000)
}

// GenModuleBasics generate basic module manager according to experimental flag
Expand Down
38 changes: 8 additions & 30 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,30 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
icacontrollertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types"
ibcfeetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types"
)

func (app *App) RegisterUpgradeHandlers(experimental bool) {
upgradeHandlerV1 := func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// upgrade handlers
planName := "plan_cronos"
planHandler := func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
m, err := app.mm.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
return m, err
}
// clear extra_eips from evm parameters
// Ref: https://github.com/crypto-org-chain/cronos/issues/755
params := app.EvmKeeper.GetParams(ctx)
params.ExtraEIPs = []int64{}
evmParams := app.EvmKeeper.GetParams(ctx)
evmParams.ExtraEIPs = []int64{}

// fix the incorrect value on testnet parameters
zero := sdkmath.ZeroInt()
params.ChainConfig.LondonBlock = &zero
evmParams.ChainConfig.LondonBlock = &zero

app.EvmKeeper.SetParams(ctx, params)
app.EvmKeeper.SetParams(ctx, evmParams)
return m, nil
}
// `v1.0.0` upgrade plan will clear the `extra_eips` parameters, and upgrade ibc-go to v5.2.0.
planName := "v1.0.0"
app.UpgradeKeeper.SetUpgradeHandler(planName, upgradeHandlerV1)
// "v1.0.0-testnet3-2" is another coordinated upgrade on testnet3 to upgrade ibc-go to "v5.2.0".
planNameTestnet3 := "v1.0.0-testnet3-2"
app.UpgradeKeeper.SetUpgradeHandler(planNameTestnet3, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})

gravityPlanName := "v0.8.0-gravity-alpha3"
if experimental {
app.UpgradeKeeper.SetUpgradeHandler(gravityPlanName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})
}
app.UpgradeKeeper.SetUpgradeHandler(planName, planHandler)

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
Expand All @@ -57,15 +44,6 @@ func (app *App) RegisterUpgradeHandlers(experimental bool) {
Added: []string{ibcfeetypes.StoreKey},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
if experimental && upgradeInfo.Name == gravityPlanName {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{ibcfeetypes.StoreKey},
Deleted: []string{icacontrollertypes.StoreKey},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
Expand Down
Binary file added assets/L1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 0 additions & 22 deletions assets/cronos.svg

This file was deleted.

Binary file added assets/genesisl1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/whitepaper.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion cmd/cronosd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {

rootCmd := &cobra.Command{
Use: app.Name + "d",
Short: "Cronos Daemon",
Short: "GenesisL1 Daemon",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs
cmd.SetOut(cmd.OutOrStdout())
Expand Down
2 changes: 1 addition & 1 deletion cmd/cronosd/config/prefix_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sdk "github.com/cosmos/cosmos-sdk/types"

const (
// Bech32Prefix defines the Bech32 prefix used for Cronos Accounts
Bech32Prefix = "crc"
Bech32Prefix = "genesis"

// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
Bech32PrefixAccAddr = Bech32Prefix
Expand Down
2 changes: 1 addition & 1 deletion cmd/cronosd/config/prefix_testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sdk "github.com/cosmos/cosmos-sdk/types"

const (
// Bech32Prefix defines the Bech32 prefix used for Cronos Accounts
Bech32Prefix = "tcrc"
Bech32Prefix = "tgenesis"

// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
Bech32PrefixAccAddr = Bech32Prefix
Expand Down
Loading

0 comments on commit 9ead82e

Please sign in to comment.