From 4691493084c58e5b6fbb650ab3924a21d60dbcd2 Mon Sep 17 00:00:00 2001 From: Solovyov1796 Date: Thu, 25 Apr 2024 08:50:02 +0800 Subject: [PATCH] fix makefile issue --- Makefile | 4 +-- cmd/0gchaind/app.go | 2 +- cmd/0gchaind/assert-invariants.go | 2 +- cmd/0gchaind/genaccounts.go | 2 +- cmd/0gchaind/keys.go | 2 +- cmd/{ => 0gchaind}/main.go | 3 +- cmd/0gchaind/query.go | 2 +- cmd/0gchaind/root.go | 2 +- cmd/0gchaind/shard.go | 2 +- cmd/0gchaind/status.go | 2 +- cmd/0gchaind/tx.go | 2 +- localtestnet.sh | 46 +++++++++++++++---------------- 12 files changed, 35 insertions(+), 36 deletions(-) rename cmd/{ => 0gchaind}/main.go (84%) diff --git a/Makefile b/Makefile index 64b6ad6f..0304132c 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ ### Project Info ### ################################################################################ PROJECT_NAME := 0g-chain# unique namespace for project -MAIN_ENTRY := ./cmd BINARY_NAME := 0gchaind -DOCKER_IMAGE_NAME := 0glabs/0g-chain +MAIN_ENTRY := ./cmd/$(BINARY_NAME) +DOCKER_IMAGE_NAME := 0glabs/$(PROJECT_NAME) GO_BIN ?= go GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) diff --git a/cmd/0gchaind/app.go b/cmd/0gchaind/app.go index dddd761a..d24743fb 100644 --- a/cmd/0gchaind/app.go +++ b/cmd/0gchaind/app.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "errors" diff --git a/cmd/0gchaind/assert-invariants.go b/cmd/0gchaind/assert-invariants.go index af13e2df..6a83442e 100644 --- a/cmd/0gchaind/assert-invariants.go +++ b/cmd/0gchaind/assert-invariants.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "encoding/json" diff --git a/cmd/0gchaind/genaccounts.go b/cmd/0gchaind/genaccounts.go index f708f11b..ef5e920e 100644 --- a/cmd/0gchaind/genaccounts.go +++ b/cmd/0gchaind/genaccounts.go @@ -1,5 +1,5 @@ // Sourced from https://github.com/evmos/ethermint/blob/main/cmd/ethermintd/genaccounts.go -package zgchaind +package main import ( "bufio" diff --git a/cmd/0gchaind/keys.go b/cmd/0gchaind/keys.go index 687a0b2d..3ec6ee0a 100644 --- a/cmd/0gchaind/keys.go +++ b/cmd/0gchaind/keys.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "bufio" diff --git a/cmd/main.go b/cmd/0gchaind/main.go similarity index 84% rename from cmd/main.go rename to cmd/0gchaind/main.go index ecd66dd6..5a1c4cfe 100644 --- a/cmd/main.go +++ b/cmd/0gchaind/main.go @@ -7,14 +7,13 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/0glabs/0g-chain/chaincfg" - chain "github.com/0glabs/0g-chain/cmd/0gchaind" ) func main() { chaincfg.SetSDKConfig().Seal() chaincfg.RegisterDenoms() - rootCmd := chain.NewRootCmd() + rootCmd := NewRootCmd() if err := svrcmd.Execute(rootCmd, chaincfg.EnvPrefix, chaincfg.DefaultNodeHome); err != nil { switch e := err.(type) { diff --git a/cmd/0gchaind/query.go b/cmd/0gchaind/query.go index c5c652e3..e8021e99 100644 --- a/cmd/0gchaind/query.go +++ b/cmd/0gchaind/query.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "github.com/cosmos/cosmos-sdk/client" diff --git a/cmd/0gchaind/root.go b/cmd/0gchaind/root.go index 6a0e8077..575b2d45 100644 --- a/cmd/0gchaind/root.go +++ b/cmd/0gchaind/root.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "fmt" diff --git a/cmd/0gchaind/shard.go b/cmd/0gchaind/shard.go index 1da15bc4..e25ff3d7 100644 --- a/cmd/0gchaind/shard.go +++ b/cmd/0gchaind/shard.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "fmt" diff --git a/cmd/0gchaind/status.go b/cmd/0gchaind/status.go index 538bbb5a..8c15dc0f 100644 --- a/cmd/0gchaind/status.go +++ b/cmd/0gchaind/status.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "context" diff --git a/cmd/0gchaind/tx.go b/cmd/0gchaind/tx.go index 4bd159d4..167e4b01 100644 --- a/cmd/0gchaind/tx.go +++ b/cmd/0gchaind/tx.go @@ -1,4 +1,4 @@ -package zgchaind +package main import ( "github.com/cosmos/cosmos-sdk/client" diff --git a/localtestnet.sh b/localtestnet.sh index 90985775..347e229b 100755 --- a/localtestnet.sh +++ b/localtestnet.sh @@ -20,11 +20,11 @@ relayerMnemonic="never reject sniff east arctic funny twin feed upper series sta # 0xa2F728F997f62F47D4262a70947F6c36885dF9fa # kava15tmj37vh7ch504px9fcfglmvx6y9m70646ev8t -DATA=~/.kava +DATA=~/.0gchain # remove any old state and config rm -rf $DATA -BINARY=kava +BINARY=0gchaind # Create new data directory, overwriting any that alread existed chainID="zgchain_8888-1" @@ -49,37 +49,37 @@ $BINARY config keyring-backend test # Create validator keys and add account to genesis validatorKeyName="validator" printf "$validatorMnemonic\n" | $BINARY keys add $validatorKeyName --recover -$BINARY add-genesis-account $validatorKeyName 2000000000ukava +$BINARY add-genesis-account $validatorKeyName 2000000000000000000000neuron # Create faucet keys and add account to genesis faucetKeyName="faucet" printf "$faucetMnemonic\n" | $BINARY keys add $faucetKeyName --recover -$BINARY add-genesis-account $faucetKeyName 1000000000ukava +$BINARY add-genesis-account $faucetKeyName 1000000000000000000000neuron evmFaucetKeyName="evm-faucet" printf "$evmFaucetMnemonic\n" | $BINARY keys add $evmFaucetKeyName --eth --recover -$BINARY add-genesis-account $evmFaucetKeyName 1000000000ukava +$BINARY add-genesis-account $evmFaucetKeyName 1000000000000000000000neuron userKeyName="user" printf "$userMnemonic\n" | $BINARY keys add $userKeyName --eth --recover -$BINARY add-genesis-account $userKeyName 1000000000ukava,1000000000usdx +$BINARY add-genesis-account $userKeyName 1000000000000000000000neuron,1000000000usdx relayerKeyName="relayer" printf "$relayerMnemonic\n" | $BINARY keys add $relayerKeyName --eth --recover -$BINARY add-genesis-account $relayerKeyName 1000000000ukava +$BINARY add-genesis-account $relayerKeyName 1000000000000000000000neuron -storageContractAcc="kava1l0j9dqdvd3fatfqywhm4y6avrln4jracrfy9hk" -$BINARY add-genesis-account $storageContractAcc 1000000000ukava +storageContractAcc="0g1l0j9dqdvd3fatfqywhm4y6avrln4jracrfy9hk" +$BINARY add-genesis-account $storageContractAcc 1000000000000000000000neuron # Create a delegation tx for the validator and add to genesis -$BINARY gentx $validatorKeyName 1000000000ukava --keyring-backend test --chain-id $chainID +$BINARY gentx $validatorKeyName 1000000000000000000000neuron --keyring-backend test --chain-id $chainID $BINARY collect-gentxs # Replace stake with ukava -sed -in-place='' 's/stake/ukava/g' $DATA/config/genesis.json +# sed -in-place='' 's/stake/ukava/g' $DATA/config/genesis.json -# Replace the default evm denom of aphoton with ukava -sed -in-place='' 's/aphoton/akava/g' $DATA/config/genesis.json +# Replace the default evm denom of aphoton with neuron +sed -in-place='' 's/aphoton/neuron/g' $DATA/config/genesis.json GENESIS=$DATA/config/genesis.json TMP_GENESIS=$DATA/config/tmp_genesis.json @@ -101,17 +101,17 @@ cat $GENESIS | jq '.app_state.evm.params.chain_config.shanghai_block = null' >$T cat $GENESIS | jq '.app_state.evm.params.chain_config.cancun_block = null' >$TMP_GENESIS && mv $TMP_GENESIS $GENESIS # Add earn vault -cat $GENESIS | jq '.app_state.earn.params.allowed_vaults = [ - { - denom: "usdx", - strategies: ["STRATEGY_TYPE_HARD"], - }, - { - denom: "bkava", - strategies: ["STRATEGY_TYPE_SAVINGS"], - }]' >$TMP_GENESIS && mv $TMP_GENESIS $GENESIS +# cat $GENESIS | jq '.app_state.earn.params.allowed_vaults = [ +# { +# denom: "usdx", +# strategies: ["STRATEGY_TYPE_HARD"], +# }, +# { +# denom: "bkava", +# strategies: ["STRATEGY_TYPE_SAVINGS"], +# }]' >$TMP_GENESIS && mv $TMP_GENESIS $GENESIS -cat $GENESIS | jq '.app_state.savings.params.supported_denoms = ["bkava-kavavaloper1ffv7nhd3z6sych2qpqkk03ec6hzkmufyz4scd0"]' >$TMP_GENESIS && mv $TMP_GENESIS $GENESIS +# cat $GENESIS | jq '.app_state.savings.params.supported_denoms = ["bkava-kavavaloper1ffv7nhd3z6sych2qpqkk03ec6hzkmufyz4scd0"]' >$TMP_GENESIS && mv $TMP_GENESIS $GENESIS $BINARY config broadcast-mode sync