Skip to content

Commit

Permalink
Merge pull request #196 from aura-nw/serenity
Browse files Browse the repository at this point in the history
Merge from Serenity
  • Loading branch information
kienvc authored May 23, 2024
2 parents 4a8c3e5 + bae6930 commit e49a285
Show file tree
Hide file tree
Showing 84 changed files with 21,528 additions and 9,538 deletions.
2 changes: 1 addition & 1 deletion .VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.8.0
v0.8.1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

## [v0.8.1] - 2024-05-22
### Improvements
- Clean unused code in evmutil module
- Adapt Evmos precompiles

## [v0.8.0] - 2024-04-06
### Features
- Add EVM module
Expand Down
57 changes: 45 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,95 @@
# Aura

[![Release](https://github.com/aura-nw/aura/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/aura-nw/aura/actions/workflows/release.yml)

This repository contains source code for Aurad (Aura Daemon). Aurad binary is the official client for Aura Network. Aurad is built using Cosmos SDK

Aura Network is a NFT-centric blockchain platform that provides infrastructure assisting to bring user assets to the crypto market.

## Prerequisite
- Go 1.18

- Go 1.20

## Install Aura daemon

Using Makefile
```

```bash
make
```
The **aurad** bin file is located on **${source_directory}/build/** or **GO_PATH** (default ~/go/bin/)

The **aurad** bin file is located on **${source_directory}/build/** or **GO_PATH** (default ~/go/bin/)

## Setup a LocalNet

### Initialize the Chain
```

```bash
# <moniker> is the custom username of the node
# <chain-id> is the identity of the chain
aurad init <moniker> --chain-id <chain-id>
```

This command will initialize the home folder containing necessary components for your chain
(default: ~/.aura)

### Customize the genesis file

A genesis file is a JSON file which defines the initial state of your blockchain. It can be seen as height 0 of your blockchain. The first block, at height 1, will reference the genesis file as its parent.

The docs about genesis customization: https://hub.cosmos.network/main/resources/genesis.html
The docs about genesis customization: <https://hub.cosmos.network/main/resources/genesis.html>

### Create your validator

Create a local key pair for creating validator:
```

```bash
aurad keys add <key_name>
```

Add some tokens to the wallet:
```

```bash
aurad add-genesis-account <key_name> <amount><denom>
```

Create a validtor generation transaction:
```

```bash
aurad gentx <key_name> <amount><denom> --chain-id <chain-id>
```

Collect the gentx to genesis file:
```

```bash
aurad collect-gentxs
```

### Run a node
```

```bash
aurad start
```

## Run a local test node

```bash
sh scripts/testnode.sh
```

## Setup testnet using testnetCmd

## Contribution
The Aurad is still in development by the Aura Network team. For more information on how to contribute to this project, please contact us at [email protected]

The Aurad is still in development by the Aura Network team. For more information on how to contribute to this project, please contact us at <[email protected]>

## License
Aurad project source code files are made available under Apache-2.0 License, located in the LICENSE file. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.

Aura project source code files are made available under Apache-2.0 License, located in the LICENSE file. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.

## Acknowledgments

Aura project is built using [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) and uses additional modules:
- ```github.com/evmos/evmos/v16``` by Tharsis Labs Ltd.(Evmos). This EVM library is distributed under [ENCL-1.0](https://github.com/evmos/evmos/blob/v16.0.3/LICENSE).

- ```x/evmutil``` by Kava Labs, Inc. This module is distributed under [Apache v2 License](https://github.com/Kava-Labs/kava/blob/master/LICENSE.md).
102 changes: 56 additions & 46 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import (
v700 "github.com/aura-nw/aura/app/upgrades/v0.7.0"
v701 "github.com/aura-nw/aura/app/upgrades/v0.7.1"
v702 "github.com/aura-nw/aura/app/upgrades/v0.7.2"


v081 "github.com/aura-nw/aura/app/upgrades/v0.8.1"

"github.com/aura-nw/aura/app/internal"

"github.com/aura-nw/aura/app/utils"
Expand Down Expand Up @@ -1293,6 +1295,11 @@ func (app *App) setupUpgradeHandlers() {
v703.CreateUpgradeHandler(app.mm, app.configurator),
)

app.UpgradeKeeper.SetUpgradeHandler(
v081.UpgradeName,
v081.CreateUpgradeHandler(app.mm, app.configurator),
)

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
// This will read that value, and execute the preparations for the upgrade.
Expand All @@ -1308,69 +1315,72 @@ func (app *App) setupUpgradeHandlers() {
var storeUpgrades *storetypes.StoreUpgrades

switch upgradeInfo.Name {
case v0_3_0.UpgradeName:
// no store upgrades in v0.3.0
case v0_3_0.UpgradeName:
// no store upgrades in v0.3.0

case v0_3_1.UpgradeName:
// no store upgrades in v0.3.1
case v0_3_1.UpgradeName:
// no store upgrades in v0.3.1

case v0_3_2.UpgradeName:
// no store upgrades in v0.3.2
case v0_3_2.UpgradeName:
// no store upgrades in v0.3.2

case v0_3_3.UpgradeName:
// no store upgrades in v0.3.3
case v0_3_3.UpgradeName:
// no store upgrades in v0.3.3

case v0_4_0.UpgradeName:
// no store upgrades in v0.4.0
case v0_4_0.UpgradeName:
// no store upgrades in v0.4.0

case v0_4_1.UpgradeName:
// no store upgrades in v0.4.1
case v0_4_1.UpgradeName:
// no store upgrades in v0.4.1

case v0_4_2.UpgradeName:
// no store upgrades in v0.4.2
case v0_4_2.UpgradeName:
// no store upgrades in v0.4.2

case v0_4_4.UpgradeName:
// no store upgrades in v0.4.4
case v0_4_4.UpgradeName:
// no store upgrades in v0.4.4

case v500.UpgradeName:
// no store upgrades in v0.5.0
case v500.UpgradeName:
// no store upgrades in v0.5.0

case v501.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
//Added: []string{ibcmiddlewaretypes.StoreKey},
}
case v600.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{samoduletypes.StoreKey},
}

case v601.UpgradeName:
// no store upgrades in v0.6.
case v501.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
//Added: []string{ibcmiddlewaretypes.StoreKey},
}
case v600.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{samoduletypes.StoreKey},
}

case v700.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
},
}
case v601.UpgradeName:
// no store upgrades in v0.6.

case v701.UpgradeName:
if ChainID == "xstaxy-1" {
case v700.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
ibchookstypes.StoreKey,
samoduletypes.StoreKey,
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
},
}
}

case v702.UpgradeName:
// no store upgrades in v0.7.2
case v703.UpgradeName:
// no store upgrades in v0.7.3
case v701.UpgradeName:
if ChainID == "xstaxy-1" {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
ibchookstypes.StoreKey,
samoduletypes.StoreKey,
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
},
}
}

case v702.UpgradeName:
// no store upgrades in v0.7.2
case v703.UpgradeName:
// no store upgrades in v0.7.3

case v081.UpgradeName:
// no store upgrades in v0.8.1

}

Expand Down
13 changes: 4 additions & 9 deletions app/evm_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
"golang.org/x/exp/maps"

// staking and distribution precompiles
distprecompile "github.com/aura-nw/aura/precompiles/distribution"
stakingprecompile "github.com/aura-nw/aura/precompiles/staking"

authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
channelkeeper "github.com/cosmos/ibc-go/v7/modules/core/04-channel/keeper"
bankprecompile "github.com/evmos/evmos/v16/precompiles/bank"
distprecompile "github.com/evmos/evmos/v16/precompiles/distribution"
ics20precompile "github.com/evmos/evmos/v16/precompiles/ics20"
"github.com/evmos/evmos/v16/precompiles/p256"
stakingprecompile "github.com/evmos/evmos/v16/precompiles/staking"
erc20Keeper "github.com/evmos/evmos/v16/x/erc20/keeper"
transferkeeper "github.com/evmos/evmos/v16/x/ibc/transfer/keeper"
)
Expand Down Expand Up @@ -59,11 +60,6 @@ func Precompiles(
panic(fmt.Errorf("failed to instantiate ICS20 precompile: %w", err))
}

bankPrecompile, err := bankprecompile.NewPrecompile(bankKeeper, erc20Keeper)
if err != nil {
panic(fmt.Errorf("failed to instantiate bank precompile: %w", err))
}

// Stateless precompiles
precompiles[bech32Precompile.Address()] = bech32Precompile
precompiles[p256Precompile.Address()] = p256Precompile
Expand All @@ -72,7 +68,6 @@ func Precompiles(
precompiles[stakingPrecompile.Address()] = stakingPrecompile
precompiles[distributionPrecompile.Address()] = distributionPrecompile
precompiles[ibcTransferPrecompile.Address()] = ibcTransferPrecompile
precompiles[bankPrecompile.Address()] = bankPrecompile

return precompiles
}
20 changes: 20 additions & 0 deletions app/upgrades/v0.8.1/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v081

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

// UpgradeName is the name of upgrade. This upgrade added new module
const UpgradeName = "v0.8.1"

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {

return mm.RunMigrations(ctx, configurator, vm)
}
}
Loading

0 comments on commit e49a285

Please sign in to comment.