Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rename binary and default directory #193

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
GOPRIVATE: github.com/sedaprotocol/vrf-go
GITHUB_TOKEN: ${{ secrets.PAT }}
TAR_PATH: /tmp/seda-docker-image.tar
IMAGE_NAME: seda-chaind-e2e
IMAGE_NAME: sedad-e2e
SEDA_EXPONENT: ${{ secrets.SEDA_EXPONENT_ICT || 18 }}

permissions:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
with:
context: .
file: ./dockerfiles/Dockerfile.e2e
tags: seda-chaind-e2e
tags: sedad-e2e
build-args: SEDA_EXPONENT=${{ env.SEDA_EXPONENT }}
outputs: type=docker,dest=${{ env.TAR_PATH }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ jobs:
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
build/seda-chaind-amd64
build/seda-chaind-arm64
build/sedad-amd64
build/sedad-arm64

- name: 📦 Create GitHub Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
generateReleaseNotes: true
body: ${{ steps.changelog.outputs.clean_changelog }}
artifacts: "checksum.txt,build/seda-chaind-amd64,build/seda-chaind-arm64"
artifacts: "checksum.txt,build/sedad-amd64,build/sedad-arm64"
8 changes: 4 additions & 4 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Docker is used to help make release and static builds locally.

### [Golang](https://go.dev/)

We use Golang as the language to develop `seda-chaind` as it has the [CosmosSDK](https://v1.cosmos.network/sdk).
We use Golang as the language to develop `sedad` as it has the [CosmosSDK](https://v1.cosmos.network/sdk).

- [Golang](https://go.dev/dl/): you can download it from the linked page or:
- Linux: Use your distribution's package manager.
Expand Down Expand Up @@ -129,10 +129,10 @@ To run a single-node testnet locally:

```bash
make build
BIN=./build/seda-chaind
BIN=./build/sedad

$BIN tendermint unsafe-reset-all
rm -rf ~/.seda-chain
rm -rf ~/.sedad

$BIN init node0 --default-denom aseda --chain-id seda-1-local

Expand Down Expand Up @@ -167,7 +167,7 @@ make lint

## Running

After running the `make install` command you should be able to use `seda-chaind --help`.
After running the `make install` command you should be able to use `sedad --help`.

## Testing

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This Dockerfile is for .gorelease purposesBuild: docker build -t seda-chaind .
# This Dockerfile is for .gorelease purposesBuild: docker build -t sedad .
# If you are looking for a Dockerfile to run a node, see dockerfiles/Dockerfile.node
FROM scratch
ENTRYPOINT ["/seda-chaind"]
COPY seda-chaind /
ENTRYPOINT ["/sedad"]
COPY sedad /
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=seda-chain \
-X github.com/cosmos/cosmos-sdk/version.AppName=seda-chaind \
-X github.com/cosmos/cosmos-sdk/version.AppName=sedad \
-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 Down Expand Up @@ -215,7 +215,7 @@ ifdef GITHUB_TOKEN
docker-build-e2e:
@docker build \
--build-arg GITHUB_TOKEN=$(GITHUB_TOKEN) \
-t sedaprotocol/seda-chaind-e2e \
-t sedaprotocol/sedad-e2e \
-f dockerfiles/Dockerfile.e2e .
else
docker-build-e2e:
Expand Down Expand Up @@ -297,8 +297,8 @@ release:
-e GITHUB_TOKEN=$(GITHUB_TOKEN) \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/seda-chaind \
-w /go/src/seda-chaind \
-v `pwd`:/go/src/sedad \
-w /go/src/sedad \
$(GORELEASER_IMAGE) \
release \
--clean
Expand All @@ -313,8 +313,8 @@ release-dry-run:
--rm \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/seda-chaind \
-w /go/src/seda-chaind \
-v `pwd`:/go/src/sedad \
-w /go/src/sedad \
$(GORELEASER_IMAGE) \
release \
--clean \
Expand All @@ -325,8 +325,8 @@ release-snapshot:
--rm \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/seda-chaind \
-w /go/src/seda-chaind \
-v `pwd`:/go/src/sedad \
-w /go/src/sedad \
$(GORELEASER_IMAGE) \
release \
--clean \
Expand All @@ -344,7 +344,7 @@ RUNNER_BASE_IMAGE_ALPINE := alpine:3.17

docker-static-build:
@DOCKER_BUILDKIT=1 docker build \
-t seda-chain/seda-chaind-static-distroless \
-t seda-chain/sedad-static-distroless \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_DISTROLESS) \
--build-arg GIT_VERSION=$(VERSION) \
Expand All @@ -353,7 +353,7 @@ docker-static-build:

docker-static-build-alpine:
@DOCKER_BUILDKIT=1 docker build \
-t seda-chain/seda-chaind-static-alpine \
-t seda-chain/sedad-static-alpine \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg RUNNER_IMAGE=$(RUNNER_BASE_IMAGE_ALPINE) \
--build-arg GIT_VERSION=$(VERSION) \
Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ This is a guide for operating and running the node.
- Individuals aiming to connect to an [external node](#linking-to-an-external-node) with SEDA.
- Those who wish to establish their own node and/or set up the node as a validator.

`seda-chaind` is the command-line tool for interfacing, or CLI for short, with the SEDA blockchain. You can check out the installation instructions [here](#installation).
`sedad` is the command-line tool for interfacing, or CLI for short, with the SEDA blockchain. You can check out the installation instructions [here](#installation).

Now, you're all set to engage with the SEDA blockchain via an external node. For a rundown of commands, type `seda-chaind --help`. For in-depth info on a particular command, add the `--help` flag, for example:
Now, you're all set to engage with the SEDA blockchain via an external node. For a rundown of commands, type `sedad --help`. For in-depth info on a particular command, add the `--help` flag, for example:

```bash
seda-chaind --help
seda-chaind query --help
seda-chaind query bank --help
sedad --help
sedad query --help
sedad query bank --help
```

### Linking to An External Node

This section is for those linking to an external node, so if you want to run commands from your local machine, or don't feel like running a node yourself you can use the `seda-chaind` binary to connect to an external node. This can be done two ways:
This section is for those linking to an external node, so if you want to run commands from your local machine, or don't feel like running a node yourself you can use the `sedad` binary to connect to an external node. This can be done two ways:

1. Add the `--node` flag to your CLI commands, followed by the RPC endpoint in the `https://<hostname>:<port>` format.
2. Alternatively, set a default node: `seda-chaind config set client node https://[hostname]:[port]`
2. Alternatively, set a default node: `sedad config set client node https://[hostname]:[port]`

When connecting externally, choose a trustworthy node operator. Unscrupulous operators might tamper with query outcomes or block transactions. The SEDA team currently supports these RPC endpoints:

Expand All @@ -86,22 +86,22 @@ When connecting externally, choose a trustworthy node operator. Unscrupulous ope

```
<!-- make the downloaded binary executable -->
chmod +x seda-chaind-${ARCH}
<!-- chmod +x seda-chaind-amd64 -->
<!-- chmod +x seda-chaind-arm64 -->
chmod +x sedad-${ARCH}
<!-- chmod +x sedad-amd64 -->
<!-- chmod +x sedad-arm64 -->

<!-- reset the chain -->
./seda-chaind-${ARCH} tendermint unsafe-reset-all
rm -rf ~/.seda-chain || true
./sedad-${ARCH} tendermint unsafe-reset-all
rm -rf ~/.sedad || true

<!-- create your operator key -->
./seda-chaind-${ARCH} keys add <key-name>
./sedad-${ARCH} keys add <key-name>

<!-- initialize your node and join the network (optionally with an existing key using the recover flag) -->
./seda-chaind-${ARCH} join <moniker> --network <devnet|testnet> [--recover]
./sedad-${ARCH} join <moniker> --network <devnet|testnet> [--recover]

<!-- start your node -->
./seda-chaind-${ARCH} start
./sedad-${ARCH} start
```

### Creating a validator
Expand All @@ -124,7 +124,7 @@ Create a `validator.json` file and fill in the create-validator tx parameters:

```
{
"pubkey": $(./seda-chaind-${ARCH} tendermint show-validator),
"pubkey": $(./sedad-${ARCH} tendermint show-validator),
"amount": "1000000000000000000000000000000000aseda",
"moniker": "the moniker for your validator",
"identity": "optional identity signature (ex. UPort or Keybase) This key will be used by block explorers to identify the validator.",
Expand All @@ -141,13 +141,13 @@ Create a `validator.json` file and fill in the create-validator tx parameters:
Use the following command to create a validator:

```
./seda-chaind-${ARCH} tx staking create-validator validator.json --from <wallet-name> --chain-id <target-chain> --node <node-url>
./sedad-${ARCH} tx staking create-validator validator.json --from <wallet-name> --chain-id <target-chain> --node <node-url>
```

That’s it now you can find your validator operator address using the following command, which you can advertise to receive delegations:

```
./seda-chaind-${ARCH} keys show <wallet-name> --bech val -a
./sedad-${ARCH} keys show <wallet-name> --bech val -a
```

### Running the Node with Cosmovisor
Expand All @@ -165,8 +165,8 @@ Then, add these lines to your profile (maybe `.profile`, `.zprofile`, or somethi

```
echo "# Cosmovisor Setup" >> ~/.profile
echo "export DAEMON_NAME=seda-chaind" >> ~/.profile
echo "export DAEMON_HOME=$HOME/.seda-chain" >> ~/.profile
echo "export DAEMON_NAME=sedad" >> ~/.profile
echo "export DAEMON_HOME=$HOME/.sedad" >> ~/.profile
echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=false" >> ~/.profile
echo "export DAEMON_LOG_BUFFER_SIZE=512" >> ~/.profile
echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.profile
Expand All @@ -177,7 +177,7 @@ source ~/.profile
Initialize Cosmovisor with the chain binary and start the node.

```
cosmovisor init seda-chaind-${ARCH}
cosmovisor init sedad-${ARCH}
cosmovisor run start
```

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func init() {

sdk.DefaultPowerReduction = sdkmath.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(appparams.SedaExponent), nil))

DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
DefaultNodeHome = filepath.Join(userHomeDir, ".sedad")
}

// App extends an ABCI application, but with most of its parameters exported.
Expand Down
Empty file added cmd/sedad/__debug_bin1406259301
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to commit this empty file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It's common for node operators to do rm -rf ~/.seda which would remove the overlay data dir with it.

There is actually a simpler approach, simply do ~/.sedad like osmosis does (~/.osmosisd).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! 👍

Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/seda-chaind/cmd/init.go → cmd/sedad/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/go-bip39"

"github.com/sedaprotocol/seda-chain/cmd/seda-chaind/utils"
"github.com/sedaprotocol/seda-chain/cmd/sedad/utils"
)

func readInMnemonic(cmd *cobra.Command) (string, error) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/seda-chaind/main.go → cmd/sedad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

"github.com/sedaprotocol/seda-chain/app"
"github.com/sedaprotocol/seda-chain/cmd/seda-chaind/cmd"
"github.com/sedaprotocol/seda-chain/cmd/sedad/cmd"
)

func main() {
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions dockerfiles/Dockerfile.build-static
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ RUN ARCH=x86_64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

# Build seda-chaind binary for amd64
# Build sedad binary for amd64
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="seda-chain" \
-X github.com/cosmos/cosmos-sdk/version.AppName="seda-chaind" \
-X github.com/cosmos/cosmos-sdk/version.AppName="sedad" \
-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 /seda-chain/build/seda-chaind-amd64 \
/seda-chain/cmd/seda-chaind/main.go
-o /seda-chain/build/sedad-amd64 \
/seda-chain/cmd/sedad/main.go

# Cosmwasm - Download correct libwasmvm_muslc version for aarch64
RUN ARCH=aarch64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
Expand All @@ -63,26 +63,26 @@ ENV GOARCH=arm64
ENV CC=/aarch64-tools/bin/aarch64-linux-musl-gcc
ENV CXX=/aarch64-tools/bin/aarch64-linux-musl-g++

# Build seda-chaind binary for arm64
# Build sedad binary for arm64
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off CGO_LDFLAGS="-L/lib" go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="seda-chain" \
-X github.com/cosmos/cosmos-sdk/version.AppName="seda-chaind" \
-X github.com/cosmos/cosmos-sdk/version.AppName="sedad" \
-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 /seda-chain/build/seda-chaind-arm64 \
/seda-chain/cmd/seda-chaind/main.go
-o /seda-chain/build/sedad-arm64 \
/seda-chain/cmd/sedad/main.go
# --------------------------------------------------------
# Output
# --------------------------------------------------------

FROM alpine
COPY --from=builder /seda-chain/build/seda-chaind-amd64 /build/seda-chaind-amd64
COPY --from=builder /seda-chain/build/seda-chaind-arm64 /build/seda-chaind-arm64
COPY --from=builder /seda-chain/build/sedad-amd64 /build/sedad-amd64
COPY --from=builder /seda-chain/build/sedad-arm64 /build/sedad-arm64
12 changes: 6 additions & 6 deletions dockerfiles/Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,30 @@ RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm |
# Copy the remaining files
COPY . .

# Build seda-chaind binary
# Build sedad binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="seda-chain" \
-X github.com/cosmos/cosmos-sdk/version.AppName="seda-chaind" \
-X github.com/cosmos/cosmos-sdk/version.AppName="sedad" \
-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 /seda-chain/build/seda-chaind \
/seda-chain/cmd/seda-chaind/main.go
-o /seda-chain/build/sedad \
/seda-chain/cmd/sedad/main.go

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

FROM ${RUNNER_IMAGE}

COPY --from=builder /seda-chain/build/seda-chaind /bin/seda-chaind
COPY --from=builder /seda-chain/build/sedad /bin/sedad

ARG SEDA_EXPONENT # use default if not set
ENV SEDA_EXPONENT=${SEDA_EXPONENT}
Expand All @@ -77,4 +77,4 @@ EXPOSE 26656 26657 1317 9090

# USER nonroot

CMD ["seda-chaind", "start"]
CMD ["sedad", "start"]
4 changes: 2 additions & 2 deletions dockerfiles/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN make install

FROM ubuntu:23.04
EXPOSE 26656 26657 1317 9090
CMD ["seda-chaind", "start"]
CMD ["sedad", "start"]
STOPSIGNAL SIGTERM


Expand All @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install ca-certificates git jq -y \



COPY --from=builder /go/bin/seda-chaind /usr/local/bin/
COPY --from=builder /go/bin/sedad /usr/local/bin/
COPY --from=builder /go/pkg/mod/github.com/\!cosm\!wasm/wasmvm\@v*/internal/api/libwasmvm.*.so /usr/lib/

COPY scripts/validator_setup/validator_setup.sh /usr/local/bin/validator_setup.sh
Expand Down
Loading
Loading