Skip to content

Commit

Permalink
change prefix to centauri
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Oct 26, 2023
1 parent a835d31 commit fdec333
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
push: true
platforms: linux/amd64
tags: |
ghcr.io/notional-labs/layer-ictest:latest
ghcr.io/notional-labs/centauri-ictest:latest
test-start-cosmos-chain:
runs-on: ubuntu-latest
needs: build-and-push-image
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/push_docker_images.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This workflow pushes new layer docker images on every new tag.
# This workflow pushes new centauri docker images on every new tag.
#
# On every new `vX.Y.Z` tag the following images are pushed:
#
# notional-labs/layer:X.Y.Z # is pushed
# notional-labs/layer:X.Y # is updated to X.Y.Z
# notional-labs/layer:X # is updated to X.Y.Z
# notional-labs/layer:latest # is updated to X.Y.Z
# notional-labs/centauri:X.Y.Z # is pushed
# notional-labs/centauri:X.Y # is updated to X.Y.Z
# notional-labs/centauri:X # is updated to X.Y.Z
# notional-labs/centauri:latest # is updated to X.Y.Z
#
# All the images above have support for linux/amd64 and linux/arm64.
#
Expand Down Expand Up @@ -66,6 +66,6 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/notional-labs/layer:${{ env.MAJOR_VERSION }}
ghcr.io/notional-labs/layer:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/notional-labs/layer:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
ghcr.io/notional-labs/centauri:${{ env.MAJOR_VERSION }}
ghcr.io/notional-labs/centauri:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}
ghcr.io/notional-labs/centauri:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
run: docker-compose up -d

- name: Copy binary
run: docker cp composable-centauri_node_1:/bin/layerd ./layerd
run: docker cp composable-centauri_node_1:/bin/centaurid ./centaurid

- name: Save sha256 sum
run: sha256sum ./layerd > ./layerd_sha256.txt
run: sha256sum ./centaurid > ./centaurid_sha256.txt

- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ github.token }}
files: |
layerd
layerd_sha256.txt
centaurid
centaurid_sha256.txt
- name: Dump docker logs on failure
if: failure()
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \
linux-headers

# Download go dependencies
WORKDIR /layer
WORKDIR /centauri
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
Expand All @@ -43,25 +43,25 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="layer" \
-X github.com/cosmos/cosmos-sdk/version.AppName="layerd" \
"-X github.com/cosmos/cosmos-sdk/version.Name="centauri" \
-X github.com/cosmos/cosmos-sdk/version.AppName="centaurid" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /layer/build/layerd \
/layer/cmd/layerd
-o /centauri/build/centaurid \
/centauri/cmd/centaurid

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE}

COPY --from=builder /layer/build/layerd /bin/layerd
COPY --from=builder /centauri/build/centaurid /bin/centaurid

ENV HOME /layer
ENV HOME /centauri
WORKDIR $HOME

# rest server
Expand All @@ -72,4 +72,4 @@ EXPOSE 26656
EXPOSE 26657
# grpc
EXPOSE 9090
ENTRYPOINT ["layerd"]
ENTRYPOINT ["centaurid"]
16 changes: 8 additions & 8 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \
linux-headers

# Download go dependencies
WORKDIR /layer
WORKDIR /centauri
COPY go.mod go.sum ./

# Cosmwasm - Download correct libwasmvm version
Expand All @@ -38,29 +38,29 @@ RUN GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="layer" \
-X github.com/cosmos/cosmos-sdk/version.AppName="layerd" \
"-X github.com/cosmos/cosmos-sdk/version.Name="centauri" \
-X github.com/cosmos/cosmos-sdk/version.AppName="centaurid" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /layer/build/layerd \
/layer/cmd/layerd
-o /centauri/build/centaurid \
/centauri/cmd/centaurid

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE}

COPY --from=builder /layer/build/layerd /bin/layerd
COPY --from=builder /centauri/build/centaurid /bin/centaurid

ENV HOME /layer
ENV HOME /centauri

WORKDIR $HOME

COPY scripts/* /layer/
COPY scripts/* /centauri/
# rest server
EXPOSE 1317
# tendermint p2p
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ build:
go build $(BUILD_FLAGS) -o bin/centaurid ./cmd/centaurid

docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t layer:debug -f Dockerfile .
@DOCKER_BUILDKIT=1 docker build -t centauri:debug -f Dockerfile .

lint:
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run mvdan.cc/gofumpt -w .
Expand Down Expand Up @@ -133,22 +133,22 @@ proto-check-breaking:

# Executes start chain tests via interchaintest
ictest-start-cosmos:
cd tests/interchaintest && go test -race -v -run TestStartLayer .
cd tests/interchaintest && go test -race -v -run TestStartCentauri .

ictest-validator:
cd tests/interchaintest && go test -race -v -run TestValidator .

# Executes start chain tests via interchaintest
ictest-start-polkadot:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestPolkadotLayerChainStart .
cd tests/interchaintest && go test -timeout=25m -race -v -run TestPolkadotcentauriChainStart .

# Executes IBC tests via interchaintest
ictest-ibc:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestLayerPicassoIBCTransfer .
cd tests/interchaintest && go test -timeout=25m -race -v -run TestCentauriPicassoIBCTransfer .

# Executes Basic Upgrade Chain tests via interchaintest
ictest-upgrade:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestLayerUpgrade .
cd tests/interchaintest && go test -timeout=25m -race -v -run TestCentauriUpgrade .

# Executes all tests via interchaintest after compling a local image as juno:local
ictest-all: ictest-start-cosmos ictest-start-polkadot ictest-ibc
Expand Down
8 changes: 4 additions & 4 deletions cmd/centaurid/cmd/bech32_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ var flagBech32Prefix = "prefix"
func AddBech32ConvertCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "bech32-convert [address]",
Short: "Convert any bech32 string to the composable prefix",
Long: `Convert any bech32 string to the composable prefix
Short: "Convert any bech32 string to the centauri prefix",
Long: `Convert any bech32 string to the centauri prefix
Example:
layerd debug bech32-convert akash1a6zlyvpnksx8wr6wz8wemur2xe8zyh0ytz6d88
centaurid debug bech32-convert akash1a6zlyvpnksx8wr6wz8wemur2xe8zyh0ytz6d88
layerd debug bech32-convert stride1673f0t8p893rqyqe420mgwwz92ac4qv6synvx2 --prefix osmo
centaurid debug bech32-convert stride1673f0t8p893rqyqe420mgwwz92ac4qv6synvx2 --prefix osmo
`,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/centaurid/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
func CovertPrefixAddr() *cobra.Command {
cmd := &cobra.Command{
Use: "convert [address]",
Short: "Convert prefix from centauri to layer",
Short: "Convert prefix from layer to centauri",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
newAddr := utils.ConvertAccAddr(args[0])
Expand Down
14 changes: 7 additions & 7 deletions tests/interchaintest/basic_cosmos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"go.uber.org/zap/zaptest"
)

// TestStartCentauri is a basic test to assert that spinning up a Layer network with 1 validator works properly.
func TestBasicLayer(t *testing.T) {
// TestStartCentauri is a basic test to assert that spinning up a Centauri network with 1 validator works properly.
func TestBasicCentauri(t *testing.T) {
if testing.Short() {
t.Skip()
}
Expand All @@ -21,14 +21,14 @@ func TestBasicLayer(t *testing.T) {

ctx := context.Background()

// Create chain factory with Layer
// Create chain factory with centauri
numVals := 3
numFullNodes := 3

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
{
Name: "layer",
ChainConfig: layerConfig,
Name: "centauri",
ChainConfig: centauriConfig,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
Expand All @@ -38,13 +38,13 @@ func TestBasicLayer(t *testing.T) {
chains, err := cf.Chains(t.Name())
require.NoError(t, err)

layer := chains[0].(*cosmos.CosmosChain)
centauri := chains[0].(*cosmos.CosmosChain)

// Relayer Factory
client, network := interchaintest.DockerSetup(t)

// Create a new Interchain object which describes the chains, relayers, and IBC connections we want to use
ic := interchaintest.NewInterchain().AddChain(layer)
ic := interchaintest.NewInterchain().AddChain(centauri)

rep := testreporter.NewNopReporter()
eRep := rep.RelayerExecReporter(t)
Expand Down
12 changes: 6 additions & 6 deletions tests/interchaintest/chain_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"go.uber.org/zap/zaptest"
)

// TestStartcentauri is a basic test to assert that spinning up a layer network with 1 validator works properly.
func TestStartLayer(t *testing.T) {
// TestStartcentauri is a basic test to assert that spinning up a centauri network with 1 validator works properly.
func TestStartCentauri(t *testing.T) {
if testing.Short() {
t.Skip()
}
Expand All @@ -27,8 +27,8 @@ func TestStartLayer(t *testing.T) {

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
{
Name: "layer",
ChainConfig: layerConfig,
Name: "centauri",
ChainConfig: centauriConfig,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
Expand All @@ -38,13 +38,13 @@ func TestStartLayer(t *testing.T) {
chains, err := cf.Chains(t.Name())
require.NoError(t, err)

layer := chains[0].(*cosmos.CosmosChain)
centauri := chains[0].(*cosmos.CosmosChain)

// Relayer Factory
client, network := interchaintest.DockerSetup(t)

// Create a new Interchain object which describes the chains, relayers, and IBC connections we want to use
ic := interchaintest.NewInterchain().AddChain(layer)
ic := interchaintest.NewInterchain().AddChain(centauri)

rep := testreporter.NewNopReporter()
eRep := rep.RelayerExecReporter(t)
Expand Down
2 changes: 1 addition & 1 deletion tests/interchaintest/polkadot_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"go.uber.org/zap/zaptest"
)

func TestPolkadotLayerChainStart(t *testing.T) {
func TestPolkadotCentauriChainStart(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
Expand Down
36 changes: 18 additions & 18 deletions tests/interchaintest/push_wasm_client_code_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ func TestPushWasmClientCode(t *testing.T) {
{
ChainConfig: ibc.ChainConfig{
Type: "cosmos",
Name: "layer",
ChainID: "layerd",
Name: "centauri",
ChainID: "centaurid",
Images: []ibc.DockerImage{CentauriImage},
Bin: "layerd",
Bech32Prefix: "layer",
Bin: "centaurid",
Bech32Prefix: "centauri",
Denom: "stake",
GasPrices: "0.00stake",
GasAdjustment: 1.3,
Expand All @@ -87,11 +87,11 @@ func TestPushWasmClientCode(t *testing.T) {
chains, err := cf.Chains(t.Name())
require.NoError(t, err)

layerd := chains[0]
centaurid := chains[0]

t.Logf("NewInterchain")
ic := interchaintest.NewInterchain().
AddChain(layerd)
AddChain(centaurid)

t.Logf("Interchain build options")
require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
Expand All @@ -108,46 +108,46 @@ func TestPushWasmClientCode(t *testing.T) {

// Create and Fund User Wallets
fundAmount := int64(10_000_000_000)
users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(fundAmount), layerd)
users := interchaintest.GetAndFundTestUsers(t, ctx, "default", int64(fundAmount), centaurid)
centaurid1User := users[0]

err = testutil.WaitForBlocks(ctx, 10, layerd)
err = testutil.WaitForBlocks(ctx, 10, centaurid)
require.NoError(t, err)

centaurid1UserBalInitial, err := layerd.GetBalance(ctx, centaurid1User.FormattedAddress(), layerd.Config().Denom)
centaurid1UserBalInitial, err := centaurid.GetBalance(ctx, centaurid1User.FormattedAddress(), centaurid.Config().Denom)
require.NoError(t, err)
require.Equal(t, fundAmount, centaurid1UserBalInitial)

layerdChain := layerd.(*cosmos.CosmosChain)
centauridChain := centaurid.(*cosmos.CosmosChain)

// Verify a normal user cannot push a wasm light client contract
_, err = layerdChain.StoreClientContract(ctx, centaurid1User.KeyName(), "ics10_grandpa_cw.wasm")
_, err = centauridChain.StoreClientContract(ctx, centaurid1User.KeyName(), "ics10_grandpa_cw.wasm")
require.ErrorContains(t, err, "invalid authority")

proposal := cosmos.TxProposalv1{
Metadata: "none",
Deposit: "500000000" + layerdChain.Config().Denom, // greater than min deposit
Deposit: "500000000" + centauridChain.Config().Denom, // greater than min deposit
Title: "Grandpa Contract",
Summary: "new grandpa contract",
}

proposalTx, codeHash, err := layerdChain.PushNewWasmClientProposal(ctx, centaurid1User.KeyName(), "ics10_grandpa_cw.wasm", proposal)
proposalTx, codeHash, err := centauridChain.PushNewWasmClientProposal(ctx, centaurid1User.KeyName(), "ics10_grandpa_cw.wasm", proposal)
require.NoError(t, err, "error submitting new wasm contract proposal tx")

height, err := layerdChain.Height(ctx)
height, err := centauridChain.Height(ctx)
require.NoError(t, err, "error fetching height before submit upgrade proposal")

err = layerdChain.VoteOnProposalAllValidators(ctx, proposalTx.ProposalID, cosmos.ProposalVoteYes)
err = centauridChain.VoteOnProposalAllValidators(ctx, proposalTx.ProposalID, cosmos.ProposalVoteYes)
require.NoError(t, err, "failed to submit votes")

_, err = cosmos.PollForProposalStatus(ctx, layerdChain, height, height+heightDelta, proposalTx.ProposalID, cosmos.ProposalStatusPassed)
_, err = cosmos.PollForProposalStatus(ctx, centauridChain, height, height+heightDelta, proposalTx.ProposalID, cosmos.ProposalStatusPassed)
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

err = testutil.WaitForBlocks(ctx, 2, layerdChain)
err = testutil.WaitForBlocks(ctx, 2, centauridChain)
require.NoError(t, err)

var getCodeQueryMsgRsp GetCodeQueryMsgResponse
err = layerdChain.QueryClientContractCode(ctx, codeHash, &getCodeQueryMsgRsp)
err = centauridChain.QueryClientContractCode(ctx, codeHash, &getCodeQueryMsgRsp)
codeHashByte32 := sha256.Sum256(getCodeQueryMsgRsp.Code)
codeHash2 := hex.EncodeToString(codeHashByte32[:])
t.Logf("Contract codeHash from code: %s", codeHash2)
Expand Down
Loading

0 comments on commit fdec333

Please sign in to comment.