From 1d2808b3c94e3abad906737b04f62706c66b0eca Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Fri, 24 Jul 2020 21:47:39 +0200 Subject: [PATCH 1/8] Remove gaia-specific gitian code --- contrib/devtools/Makefile | 74 ------- contrib/devtools/install-golangci-lint.sh | 32 --- contrib/get_node.sh | 14 -- contrib/gitian-build.sh | 201 ------------------ contrib/gitian-descriptors/gitian-darwin.yml | 114 ---------- contrib/gitian-descriptors/gitian-linux.yml | 113 ---------- contrib/gitian-descriptors/gitian-windows.yml | 115 ---------- contrib/gitian-keys/README.md | 29 --- contrib/gitian-keys/keys.txt | 2 - contrib/localnet-blocks-test.sh | 41 ---- 10 files changed, 735 deletions(-) delete mode 100644 contrib/devtools/Makefile delete mode 100644 contrib/devtools/install-golangci-lint.sh delete mode 100755 contrib/get_node.sh delete mode 100755 contrib/gitian-build.sh delete mode 100644 contrib/gitian-descriptors/gitian-darwin.yml delete mode 100644 contrib/gitian-descriptors/gitian-linux.yml delete mode 100644 contrib/gitian-descriptors/gitian-windows.yml delete mode 100644 contrib/gitian-keys/README.md delete mode 100644 contrib/gitian-keys/keys.txt delete mode 100755 contrib/localnet-blocks-test.sh diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile deleted file mode 100644 index 293cb813f9..0000000000 --- a/contrib/devtools/Makefile +++ /dev/null @@ -1,74 +0,0 @@ -### -# Find OS and Go environment -# GO contains the Go binary -# FS contains the OS file separator -### -ifeq ($(OS),Windows_NT) - GO := $(shell where go.exe 2> NUL) - FS := \\ -else - GO := $(shell command -v go 2> /dev/null) - FS := / -endif - -ifeq ($(GO),) - $(error could not find go. Is it in PATH? $(GO)) -endif - -GOPATH ?= $(shell $(GO) env GOPATH) -GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com -GOLANGCI_LINT_HASHSUM := 8d21cc95da8d3daf8321ac40091456fc26123c964d7c2281d339d431f2f4c840 - -### -# Functions -### - -go_get = $(if $(findstring Windows_NT,$(OS)),\ -IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS) ( mkdir $(GITHUBDIR)$(FS)$(1) ) else (cd .) &\ -IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS)$(2)$(FS) ( cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2) ) else (cd .) &\ -,\ -mkdir -p $(GITHUBDIR)$(FS)$(1) &&\ -(test ! -d $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2)) || true &&\ -)\ -cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) - -go_install = $(call go_get,$(1),$(2),$(3)) && cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && $(GO) install - -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) - -### -# tools -### - -TOOLS_DESTDIR ?= $(GOPATH)/bin -GOLANGCI_LINT = $(TOOLS_DESTDIR)/golangci-lint -RUNSIM = $(TOOLS_DESTDIR)/runsim - -all: tools - -tools: tools-stamp -tools-stamp: $(RUNSIM) - touch $@ - -$(GOLANGCI_LINT): $(mkfile_dir)/install-golangci-lint.sh - @echo "Installing golangci-lint..." - @bash $(mkfile_dir)/install-golangci-lint.sh $(TOOLS_DESTDIR) $(GOLANGCI_LINT_HASHSUM) - -# Install the runsim binary with a temporary workaround of entering an outside -# directory as the "go get" command ignores the -mod option and will polute the -# go.{mod, sum} files. -# -# ref: https://github.com/golang/go/issues/30515 -$(RUNSIM): - @echo "Installing runsim..." - @(cd /tmp && go get github.com/cosmos/tools/cmd/runsim@v1.0.0) - -golangci-lint: $(GOLANGCI_LINT) - -tools-clean: - rm -f $(GOLANGCI_LINT) - rm -f $(RUNSIM) - rm -f tools-stamp - -.PHONY: all tools tools-clean diff --git a/contrib/devtools/install-golangci-lint.sh b/contrib/devtools/install-golangci-lint.sh deleted file mode 100644 index 427a2cf15a..0000000000 --- a/contrib/devtools/install-golangci-lint.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -installer="$(mktemp)" -trap "rm -f ${installer}" EXIT - -GOBIN="${1}" -CURL="$(which curl)" -HASHSUM="${2}" - -f_sha256() { - local l_file - l_file=$1 - python -sBc "import hashlib;print(hashlib.sha256(open('$l_file','rb').read()).hexdigest())" -} - -get_latest_release() { - "${CURL}" --silent "https://api.github.com/repos/$1/releases/latest" | \ - grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' -} -VERSION="$(get_latest_release golangci/golangci-lint)" - -echo "Downloading golangci-lint ${VERSION} installer ..." >&2 -"${CURL}" -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/${VERSION}/install.sh" > "${installer}" - -echo "Checking hashsum ..." >&2 -[ "${HASHSUM}" = "$(f_sha256 ${installer})" ] -chmod +x "${installer}" - -echo "Launching installer ..." >&2 -exec "${installer}" -d -b "${GOBIN}" "${VERSION}" diff --git a/contrib/get_node.sh b/contrib/get_node.sh deleted file mode 100755 index 7f0dd6e38d..0000000000 --- a/contrib/get_node.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -VERSION=v11.15.0 -NODE_FULL=node-${VERSION}-linux-x64 - -mkdir -p ~/.local/bin -mkdir -p ~/.local/node -wget http://nodejs.org/dist/${VERSION}/${NODE_FULL}.tar.gz -O ~/.local/node/${NODE_FULL}.tar.gz -tar -xzf ~/.local/node/${NODE_FULL}.tar.gz -C ~/.local/node/ -ln -s ~/.local/node/${NODE_FULL}/bin/node ~/.local/bin/node -ln -s ~/.local/node/${NODE_FULL}/bin/npm ~/.local/bin/npm -export PATH=~/.local/bin:$PATH -npm i -g dredd@11.0.1 -ln -s ~/.local/node/${NODE_FULL}/bin/dredd ~/.local/bin/dredd diff --git a/contrib/gitian-build.sh b/contrib/gitian-build.sh deleted file mode 100755 index f97a9d6937..0000000000 --- a/contrib/gitian-build.sh +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash - -# symbol prefixes: -# g_ -> global -# l_ - local variable -# f_ -> function - -set -euo pipefail - -GITIAN_CACHE_DIRNAME='.gitian-builder-cache' -GO_RELEASE='1.13.3' -GO_TARBALL="go${GO_RELEASE}.linux-amd64.tar.gz" -GO_TARBALL_URL="https://dl.google.com/go/${GO_TARBALL}" - -# Defaults - -DEFAULT_SIGN_COMMAND='gpg --detach-sign' -DEFAULT_GAIA_SIGS=${GAIA_SIGS:-'gaia.sigs'} -DEFAULT_GITIAN_REPO='https://github.com/tendermint/gitian-builder' -DEFAULT_GBUILD_FLAGS='' -DEFAULT_SIGS_REPO='https://github.com/cosmwasm/wasmd.sigs' - -# Overrides - -SIGN_COMMAND=${SIGN_COMMAND:-${DEFAULT_SIGN_COMMAND}} -GITIAN_REPO=${GITIAN_REPO:-${DEFAULT_GITIAN_REPO}} -GBUILD_FLAGS=${GBUILD_FLAGS:-${DEFAULT_GBUILD_FLAGS}} - -# Globals - -g_workdir='' -g_gitian_cache='' -g_cached_gitian='' -g_cached_go_tarball='' -g_sign_identity='' -g_sigs_dir='' -g_flag_commit='' - - -f_help() { - cat >&2 <&2 - mkdir "${l_builddir}/inputs/" - cp -v "${g_cached_go_tarball}" "${l_builddir}/inputs/" - done -} - -f_build() { - local l_descriptor - - l_descriptor=$1 - - bin/gbuild --commit gaia="$g_commit" ${GBUILD_FLAGS} "$l_descriptor" - libexec/stop-target || f_echo_stderr "warning: couldn't stop target" -} - -f_sign_verify() { - local l_descriptor - - l_descriptor=$1 - - bin/gsign -p "${SIGN_COMMAND}" -s "${g_sign_identity}" --destination="${g_sigs_dir}" --release=${g_release} ${l_descriptor} - bin/gverify --destination="${g_sigs_dir}" --release="${g_release}" ${l_descriptor} -} - -f_commit_sig() { - local l_release_name - - l_release_name=$1 - - pushd "${g_sigs_dir}" - git add . || echo "git add failed" >&2 - git commit -m "Add ${l_release_name} reproducible build" || echo "git commit failed" >&2 - popd -} - -f_prep_docker_image() { - pushd $1 - bin/make-base-vm --docker --suite bionic --arch amd64 - popd -} - -f_ensure_cache() { - g_gitian_cache="${g_workdir}/${GITIAN_CACHE_DIRNAME}" - [ -d "${g_gitian_cache}" ] || mkdir "${g_gitian_cache}" - - g_cached_go_tarball="${g_gitian_cache}/${GO_TARBALL}" - if [ ! -f "${g_cached_go_tarball}" ]; then - f_echo_stderr "${g_cached_go_tarball}: cache miss, caching..." - curl -L "${GO_TARBALL_URL}" --output "${g_cached_go_tarball}" - fi - - g_cached_gitian="${g_gitian_cache}/gitian-builder" - if [ ! -d "${g_cached_gitian}" ]; then - f_echo_stderr "${g_cached_gitian}: cache miss, caching..." - git clone ${GITIAN_REPO} "${g_cached_gitian}" - fi -} - -f_demangle_platforms() { - case "${1}" in - all) - printf '%s' 'darwin linux windows' ;; - linux|darwin|windows) - printf '%s' "${1}" ;; - *) - echo "invalid platform -- ${1}" - exit 1 - esac -} - -f_echo_stderr() { - echo $@ >&2 -} - - -while getopts ":cs:h" opt; do - case "${opt}" in - h) f_help ; exit 0 ;; - c) g_flag_commit=y ;; - s) g_sign_identity="${OPTARG}" ;; - esac -done - -shift "$((OPTIND-1))" - -g_platforms=$(f_demangle_platforms "${1}") -g_workdir="$(pwd)" -g_commit="$(git rev-parse HEAD)" -g_sigs_dir=${GAIA_SIGS:-"${g_workdir}/${DEFAULT_GAIA_SIGS}"} - -f_ensure_cache - -f_prep_docker_image "${g_cached_gitian}" - -f_prep_build "${g_platforms}" - -export USE_DOCKER=1 -for g_os in ${g_platforms}; do - g_release="$(git describe --tags --abbrev=9 | sed 's/^v//')-${g_os}" - g_descriptor="${g_workdir}/contrib/gitian-descriptors/gitian-${g_os}.yml" - [ -f ${g_descriptor} ] - g_builddir="$(f_builddir ${g_os})" - - pushd "${g_builddir}" - f_build "${g_descriptor}" - if [ -n "${g_sign_identity}" ]; then - f_sign_verify "${g_descriptor}" - fi - popd - - if [ -n "${g_sign_identity}" -a -n "${g_flag_commit}" ]; then - [ -d "${g_sigs_dir}/.git/" ] && f_commit_sig ${g_release} || f_echo_stderr "couldn't commit, ${g_sigs_dir} is not a git clone" - fi -done - -exit 0 diff --git a/contrib/gitian-descriptors/gitian-darwin.yml b/contrib/gitian-descriptors/gitian-darwin.yml deleted file mode 100644 index 133a20336b..0000000000 --- a/contrib/gitian-descriptors/gitian-darwin.yml +++ /dev/null @@ -1,114 +0,0 @@ ---- -name: "gaia-darwin" -enable_cache: true -distro: "ubuntu" -suites: -- "bionic" -architectures: -- "amd64" -packages: -- "bsdmainutils" -- "build-essential" -- "ca-certificates" -- "curl" -- "debhelper" -- "dpkg-dev" -- "devscripts" -- "fakeroot" -- "git" -- "golang-any" -- "xxd" -- "quilt" -remotes: -- "url": "https://github.com/cosmwasm/wasmd.git" - "dir": "gaia" -files: -- "go1.13.3.linux-amd64.tar.gz" -script: | - set -e -o pipefail - - GO_SRC_RELEASE=go1.13.3.linux-amd64 - GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz" - # Compile go and configure the environment - export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export BUILD_DIR=`pwd` - tar xf "${GO_SRC_TARBALL}" - rm -f "${GO_SRC_TARBALL}" - [ -d go/ ] - - export GOOS=darwin - export GOROOT=${BUILD_DIR}/go - export GOPATH=${BUILD_DIR}/gopath - mkdir -p ${GOPATH}/bin - - export PATH_orig=${PATH} - export PATH=$GOPATH/bin:$GOROOT/bin:$PATH - - export ARCHS='386 amd64' - export GO111MODULE=on - - # Make release tarball - pushd gaia - VERSION=$(git describe --tags | sed 's/^v//') - COMMIT=$(git log -1 --format='%H') - DISTNAME=gaia-${VERSION} - git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD - SOURCEDIST=`pwd`/`echo gaia-*.tar.gz` - popd - - # Correct tar file order - mkdir -p temp - pushd temp - tar xf $SOURCEDIST - rm $SOURCEDIST - find gaia-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST - popd - - # Prepare GOPATH and install deps - distsrc=${GOPATH}/src/github.com/cosmwasm/wasmd - mkdir -p ${distsrc} - pushd ${distsrc} - tar --strip-components=1 -xf $SOURCEDIST - go mod download - popd - - # Configure LDFLAGS for reproducible builds - LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \ - -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ - -X github.com/cosmos/cosmos-sdk/version.ServerName=wasmd \ - -X github.com/cosmos/cosmos-sdk/version.ClientName=wasmcli \ - -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=netgo,ledger" - - # Extract release tarball and build - for arch in ${ARCHS}; do - INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch} - mkdir -p ${INSTALLPATH} - - # Build gaia tool suite - pushd ${distsrc} - for prog in wasmcli wasmd; do - GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \ - -trimpath \ - -gcflags=all=-trimpath=${GOPATH} \ - -asmflags=all=-trimpath=${GOPATH} \ - -mod=readonly -tags "netgo ledger" \ - -ldflags="${LDFLAGS}" \ - -o ${INSTALLPATH}/${prog} ./cmd/${prog} - - done - popd # ${distsrc} - - pushd ${INSTALLPATH} - find -type f | sort | tar \ - --no-recursion --mode='u+rw,go+r-w,a+X' \ - --numeric-owner --sort=name \ - --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-darwin-${arch}.tar.gz - popd # installed - done - - rm -rf ${distsrc} - - mkdir -p $OUTDIR/src - mv $SOURCEDIST $OUTDIR/src diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml deleted file mode 100644 index b8306b67d3..0000000000 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ /dev/null @@ -1,113 +0,0 @@ ---- -name: "gaia-linux" -enable_cache: true -distro: "ubuntu" -suites: -- "bionic" -architectures: -- "amd64" -packages: -- "bsdmainutils" -- "build-essential" -- "ca-certificates" -- "curl" -- "debhelper" -- "dpkg-dev" -- "devscripts" -- "fakeroot" -- "git" -- "golang-any" -- "xxd" -- "quilt" -remotes: -- "url": "https://github.com/cosmwasm/wasmd.git" - "dir": "gaia" -files: -- "go1.13.3.linux-amd64.tar.gz" -script: | - set -e -o pipefail - - GO_SRC_RELEASE=go1.13.3.linux-amd64 - GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz" - # Compile go and configure the environment - export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export BUILD_DIR=`pwd` - tar xf "${GO_SRC_TARBALL}" - rm -f "${GO_SRC_TARBALL}" - [ -d go/ ] - - export GOROOT=${BUILD_DIR}/go - export GOPATH=${BUILD_DIR}/gopath - mkdir -p ${GOPATH}/bin - - export PATH_orig=${PATH} - export PATH=$GOPATH/bin:$GOROOT/bin:$PATH - - export ARCHS='386 amd64 arm arm64' - export GO111MODULE=on - - # Make release tarball - pushd gaia - VERSION=$(git describe --tags | sed 's/^v//') - COMMIT=$(git log -1 --format='%H') - DISTNAME=gaia-${VERSION} - git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD - SOURCEDIST=`pwd`/`echo gaia-*.tar.gz` - popd - - # Correct tar file order - mkdir -p temp - pushd temp - tar xf $SOURCEDIST - rm $SOURCEDIST - find gaia-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST - popd - - # Prepare GOPATH and install deps - distsrc=${GOPATH}/src/github.com/cosmwasm/wasmd - mkdir -p ${distsrc} - pushd ${distsrc} - tar --strip-components=1 -xf $SOURCEDIST - go mod download - popd - - # Configure LDFLAGS for reproducible builds - LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \ - -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ - -X github.com/cosmos/cosmos-sdk/version.ServerName=wasmd \ - -X github.com/cosmos/cosmos-sdk/version.ClientName=wasmcli \ - -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=netgo,ledger" - - # Extract release tarball and build - for arch in ${ARCHS}; do - INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch} - mkdir -p ${INSTALLPATH} - - # Build gaia tool suite - pushd ${distsrc} - for prog in wasmcli wasmd; do - GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \ - -trimpath \ - -gcflags=all=-trimpath=${GOPATH} \ - -asmflags=all=-trimpath=${GOPATH} \ - -mod=readonly -tags "netgo ledger" \ - -ldflags="${LDFLAGS}" \ - -o ${INSTALLPATH}/${prog} ./cmd/${prog} - - done - popd # ${distsrc} - - pushd ${INSTALLPATH} - find -type f | sort | tar \ - --no-recursion --mode='u+rw,go+r-w,a+X' \ - --numeric-owner --sort=name \ - --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-linux-${arch}.tar.gz - popd # installed - done - - rm -rf ${distsrc} - - mkdir -p $OUTDIR/src - mv $SOURCEDIST $OUTDIR/src diff --git a/contrib/gitian-descriptors/gitian-windows.yml b/contrib/gitian-descriptors/gitian-windows.yml deleted file mode 100644 index ada6fb69ad..0000000000 --- a/contrib/gitian-descriptors/gitian-windows.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- -name: "gaia-windows" -enable_cache: true -distro: "ubuntu" -suites: -- "bionic" -architectures: -- "amd64" -packages: -- "bsdmainutils" -- "build-essential" -- "ca-certificates" -- "curl" -- "debhelper" -- "dpkg-dev" -- "devscripts" -- "fakeroot" -- "git" -- "golang-any" -- "xxd" -- "quilt" -remotes: -- "url": "https://github.com/cosmwasm/wasmd.git" - "dir": "gaia" -files: -- "go1.13.3.linux-amd64.tar.gz" -script: | - set -e -o pipefail - - GO_SRC_RELEASE=go1.13.3.linux-amd64 - GO_SRC_TARBALL="${GO_SRC_RELEASE}.tar.gz" - # Compile go and configure the environment - export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" - export BUILD_DIR=`pwd` - tar xf "${GO_SRC_TARBALL}" - rm -f "${GO_SRC_TARBALL}" - [ -d go/ ] - - export GOOS=windows - export GOROOT=${BUILD_DIR}/go - export GOPATH=${BUILD_DIR}/gopath - mkdir -p ${GOPATH}/bin - - export PATH_orig=${PATH} - export PATH=$GOPATH/bin:$GOROOT/bin:$PATH - - export ARCHS='386 amd64' - export GO111MODULE=on - - # Make release tarball - pushd gaia - VERSION=$(git describe --tags | sed 's/^v//') - COMMIT=$(git log -1 --format='%H') - DISTNAME=gaia-${VERSION} - git archive --format tar.gz --prefix ${DISTNAME}/ -o ${DISTNAME}.tar.gz HEAD - SOURCEDIST=`pwd`/`echo gaia-*.tar.gz` - popd - - # Correct tar file order - mkdir -p temp - pushd temp - tar xf $SOURCEDIST - rm $SOURCEDIST - find gaia-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > $SOURCEDIST - popd - - # Prepare GOPATH and install deps - distsrc=${GOPATH}/src/github.com/cosmwasm/wasmd - mkdir -p ${distsrc} - pushd ${distsrc} - tar --strip-components=1 -xf $SOURCEDIST - go mod download - popd - - # Configure LDFLAGS for reproducible builds - LDFLAGS="-extldflags=-static -buildid=${VERSION} -s -w \ - -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ - -X github.com/cosmos/cosmos-sdk/version.ServerName=wasmd \ - -X github.com/cosmos/cosmos-sdk/version.ClientName=wasmcli \ - -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=netgo,ledger" - - # Extract release tarball and build - for arch in ${ARCHS}; do - INSTALLPATH=`pwd`/installed/${DISTNAME}-${arch} - mkdir -p ${INSTALLPATH} - - # Build gaia tool suite - pushd ${distsrc} - for prog in wasmcli wasmd; do - exe=${prog}.exe - GOARCH=${arch} GOROOT_FINAL=${GOROOT} go build -a \ - -trimpath \ - -gcflags=all=-trimpath=${GOPATH} \ - -asmflags=all=-trimpath=${GOPATH} \ - -mod=readonly -tags "netgo ledger" \ - -ldflags="${LDFLAGS}" \ - -o ${INSTALLPATH}/${exe} ./cmd/${prog} - - done - popd # ${distsrc} - - pushd ${INSTALLPATH} - find -type f | sort | tar \ - --no-recursion --mode='u+rw,go+r-w,a+X' \ - --numeric-owner --sort=name \ - --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-windows-${arch}.tar.gz - popd # installed - done - - rm -rf ${distsrc} - - mkdir -p $OUTDIR/src - mv $SOURCEDIST $OUTDIR/src diff --git a/contrib/gitian-keys/README.md b/contrib/gitian-keys/README.md deleted file mode 100644 index 645014337f..0000000000 --- a/contrib/gitian-keys/README.md +++ /dev/null @@ -1,29 +0,0 @@ -## PGP keys of Gitian builders and Gaia Developers - -The file `keys.txt` contains fingerprints of the public keys of Gitian builders -and active developers. - -The associated keys are mainly used to sign git commits or the build results -of Gitian builds. - -The most recent version of each pgp key can be found on most PGP key servers. - -Fetch the latest version from the key server to see if any key was revoked in -the meantime. -To fetch the latest version of all pgp keys in your gpg homedir, - -```sh -gpg --refresh-keys -``` - -To fetch keys of Gitian builders and active core developers, feed the list of -fingerprints of the primary keys into gpg: - -```sh -while read fingerprint keyholder_name; \ -do gpg --keyserver hkp://subset.pool.sks-keyservers.net \ ---recv-keys ${fingerprint}; done < ./keys.txt -``` - -Add your key to the list if you are a Gaia core developer or you have -provided Gitian signatures for two major or minor releases of Gaia. diff --git a/contrib/gitian-keys/keys.txt b/contrib/gitian-keys/keys.txt deleted file mode 100644 index 1d9cf6ec5b..0000000000 --- a/contrib/gitian-keys/keys.txt +++ /dev/null @@ -1,2 +0,0 @@ -04160004A8276E40BB9890FBE8A48AE5311D765A Alessio Treglia -237396563D09DCD65B122AE7EC1904F1389EF7E5 Karoly Albert Szabo diff --git a/contrib/localnet-blocks-test.sh b/contrib/localnet-blocks-test.sh deleted file mode 100755 index 53df090ff7..0000000000 --- a/contrib/localnet-blocks-test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -CNT=0 -ITER=$1 -SLEEP=$2 -NUMBLOCKS=$3 -NODEADDR=$4 - -if [ -z "$1" ]; then - echo "Need to input number of iterations to run..." - exit 1 -fi - -if [ -z "$2" ]; then - echo "Need to input number of seconds to sleep between iterations" - exit 1 -fi - -if [ -z "$3" ]; then - echo "Need to input block height to declare completion..." - exit 1 -fi - -if [ -z "$4" ]; then - echo "Need to input node address to poll..." - exit 1 -fi - -while [ ${CNT} -lt $ITER ]; do - var=$(curl -s $NODEADDR:26657/status | jq -r '.result.sync_info.latest_block_height') - echo "Number of Blocks: ${var}" - if [ ! -z ${var} ] && [ ${var} -gt ${NUMBLOCKS} ]; then - echo "Number of blocks reached, exiting success..." - exit 0 - fi - let CNT=CNT+1 - sleep $SLEEP -done - -echo "Timeout reached, exiting failure..." -exit 1 From a4d27bf63e9272dbb3f7b83ea86d38286540b4cf Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Fri, 24 Jul 2020 21:47:54 +0200 Subject: [PATCH 2/8] Remove gaia-specific docs --- docs/.vuepress/components/home.vue | 11 - docs/.vuepress/config.js | 160 - docs/.vuepress/public/logo-bw.svg | 8 - docs/.vuepress/public/logo.svg | 18 - docs/.vuepress/styles/index.styl | 3 - docs/DOCS_README.md | 112 - docs/README.md | 43 - docs/delegators/README.md | 13 - docs/delegators/delegator-faq.md | 71 - docs/delegators/delegator-guide-cli.md | 546 - docs/delegators/delegator-security.md | 56 - docs/gaia-tutorials/README.md | 16 - docs/gaia-tutorials/deploy-testnet.md | 269 - docs/gaia-tutorials/installation.md | 98 - docs/gaia-tutorials/join-mainnet.md | 186 - docs/gaia-tutorials/join-testnet.md | 67 - docs/gaia-tutorials/live-upgrade-tutorial.md | 74 - docs/gaia-tutorials/upgrade-node.md | 97 - docs/gaia-tutorials/what-is-gaia.md | 26 - docs/hub-overview/README.md | 9 - docs/hub-overview/overview.md | 70 - docs/images/README.md | 4 - docs/images/cosmos-hub-image.jpg | Bin 367964 -> 0 bytes docs/images/ledger-tuto-dev-mode.png | Bin 325063 -> 0 bytes docs/images/ledger-tuto-lunie-address.png | Bin 235487 -> 0 bytes docs/images/ledger-tuto-lunie-option.png | Bin 200139 -> 0 bytes docs/images/ledger-tuto-manager.png | Bin 201512 -> 0 bytes docs/images/ledger-tuto-search.png | Bin 212373 -> 0 bytes docs/launch/README.md | 4 - docs/launch/blog-1-cn.md | 71 - docs/launch/blog-1-en.md | 222 - docs/launch/blog-1-kr.md | 82 - docs/launch/blog-2-cn.md | 116 - docs/launch/blog-2-en.md | 67 - docs/launch/blog-2-kr.md | 74 - docs/migration/README.md | 10 - docs/migration/cosmoshub-2.md | 215 - docs/package-lock.json | 10524 ---------------- docs/package.json | 15 - docs/resources/README.md | 16 - docs/resources/archives.md | 25 - docs/resources/gaiacli.md | 929 -- docs/resources/genesis.md | 336 - docs/resources/hd-wallets.md | 61 - docs/resources/ledger.md | 212 - docs/resources/reproducible-builds.md | 90 - docs/resources/service-providers.md | 243 - docs/translations/README.md | 4 - .../Screen Shot 2019-05-29 at 14.14.28.png | Bin 648940 -> 0 bytes docs/translations/cn/README.md | 23 - docs/translations/cn/delegator-guide-cli.md | 519 - docs/translations/cn/deploy-testnet.md | 258 - docs/translations/cn/gaiacli.md | 833 -- docs/translations/cn/genesis-state.md | 31 - docs/translations/cn/genesis.md | 334 - docs/translations/cn/installation.md | 62 - docs/translations/cn/join-mainnet.md | 148 - docs/translations/cn/join-testnet.md | 59 - docs/translations/cn/keys.md | 0 docs/translations/cn/launch/blog-1-cn.md | 71 - docs/translations/cn/launch/blog-2-cn.md | 116 - docs/translations/cn/ledger.md | 77 - docs/translations/cn/validators/overview.md | 38 - docs/translations/cn/validators/security.md | 55 - .../cn/validators/validator-faq.md | 328 - .../cn/validators/validator-setup.md | 210 - docs/translations/cn/what-is-gaia.md | 22 - docs/translations/kr/README.md | 19 - docs/translations/kr/delegator-guide-cli.md | 483 - docs/translations/kr/deploy-testnet.md | 254 - docs/translations/kr/gaiacli.md | 846 -- docs/translations/kr/genesis-state.md | 30 - docs/translations/kr/genesis.md | 333 - docs/translations/kr/hd-wallets.md | 58 - docs/translations/kr/installation.md | 89 - docs/translations/kr/join-mainnet.md | 176 - docs/translations/kr/join-testnet.md | 157 - docs/translations/kr/keys.md | 9 - docs/translations/kr/ledger.md | 183 - docs/translations/kr/upgrade-node.md | 94 - docs/translations/kr/validators/overview.md | 34 - docs/translations/kr/validators/security.md | 54 - .../kr/validators/validator-faq.md | 308 - .../kr/validators/validator-setup.md | 223 - docs/translations/kr/what-is-gaia.md | 22 - docs/validators/README.md | 17 - docs/validators/kms/kms.md | 38 - docs/validators/kms/kms_ledger.md | 117 - docs/validators/kms/ledger_1.jpg | Bin 23307 -> 0 bytes docs/validators/kms/ledger_2.jpg | Bin 24150 -> 0 bytes docs/validators/overview.md | 38 - docs/validators/security.md | 60 - docs/validators/validator-faq.md | 298 - docs/validators/validator-setup.md | 226 - docs/versions | 1 - 95 files changed, 22624 deletions(-) delete mode 100644 docs/.vuepress/components/home.vue delete mode 100644 docs/.vuepress/config.js delete mode 100644 docs/.vuepress/public/logo-bw.svg delete mode 100644 docs/.vuepress/public/logo.svg delete mode 100644 docs/.vuepress/styles/index.styl delete mode 100644 docs/DOCS_README.md delete mode 100644 docs/README.md delete mode 100644 docs/delegators/README.md delete mode 100644 docs/delegators/delegator-faq.md delete mode 100644 docs/delegators/delegator-guide-cli.md delete mode 100644 docs/delegators/delegator-security.md delete mode 100644 docs/gaia-tutorials/README.md delete mode 100644 docs/gaia-tutorials/deploy-testnet.md delete mode 100644 docs/gaia-tutorials/installation.md delete mode 100644 docs/gaia-tutorials/join-mainnet.md delete mode 100644 docs/gaia-tutorials/join-testnet.md delete mode 100644 docs/gaia-tutorials/live-upgrade-tutorial.md delete mode 100644 docs/gaia-tutorials/upgrade-node.md delete mode 100644 docs/gaia-tutorials/what-is-gaia.md delete mode 100644 docs/hub-overview/README.md delete mode 100644 docs/hub-overview/overview.md delete mode 100644 docs/images/README.md delete mode 100755 docs/images/cosmos-hub-image.jpg delete mode 100644 docs/images/ledger-tuto-dev-mode.png delete mode 100644 docs/images/ledger-tuto-lunie-address.png delete mode 100644 docs/images/ledger-tuto-lunie-option.png delete mode 100644 docs/images/ledger-tuto-manager.png delete mode 100644 docs/images/ledger-tuto-search.png delete mode 100644 docs/launch/README.md delete mode 100644 docs/launch/blog-1-cn.md delete mode 100644 docs/launch/blog-1-en.md delete mode 100644 docs/launch/blog-1-kr.md delete mode 100644 docs/launch/blog-2-cn.md delete mode 100644 docs/launch/blog-2-en.md delete mode 100644 docs/launch/blog-2-kr.md delete mode 100644 docs/migration/README.md delete mode 100644 docs/migration/cosmoshub-2.md delete mode 100644 docs/package-lock.json delete mode 100644 docs/package.json delete mode 100644 docs/resources/README.md delete mode 100644 docs/resources/archives.md delete mode 100644 docs/resources/gaiacli.md delete mode 100644 docs/resources/genesis.md delete mode 100644 docs/resources/hd-wallets.md delete mode 100644 docs/resources/ledger.md delete mode 100644 docs/resources/reproducible-builds.md delete mode 100644 docs/resources/service-providers.md delete mode 100644 docs/translations/README.md delete mode 100644 docs/translations/Screen Shot 2019-05-29 at 14.14.28.png delete mode 100644 docs/translations/cn/README.md delete mode 100644 docs/translations/cn/delegator-guide-cli.md delete mode 100644 docs/translations/cn/deploy-testnet.md delete mode 100644 docs/translations/cn/gaiacli.md delete mode 100644 docs/translations/cn/genesis-state.md delete mode 100644 docs/translations/cn/genesis.md delete mode 100644 docs/translations/cn/installation.md delete mode 100644 docs/translations/cn/join-mainnet.md delete mode 100644 docs/translations/cn/join-testnet.md delete mode 100644 docs/translations/cn/keys.md delete mode 100644 docs/translations/cn/launch/blog-1-cn.md delete mode 100644 docs/translations/cn/launch/blog-2-cn.md delete mode 100644 docs/translations/cn/ledger.md delete mode 100644 docs/translations/cn/validators/overview.md delete mode 100644 docs/translations/cn/validators/security.md delete mode 100644 docs/translations/cn/validators/validator-faq.md delete mode 100644 docs/translations/cn/validators/validator-setup.md delete mode 100644 docs/translations/cn/what-is-gaia.md delete mode 100755 docs/translations/kr/README.md delete mode 100644 docs/translations/kr/delegator-guide-cli.md delete mode 100755 docs/translations/kr/deploy-testnet.md delete mode 100755 docs/translations/kr/gaiacli.md delete mode 100644 docs/translations/kr/genesis-state.md delete mode 100644 docs/translations/kr/genesis.md delete mode 100644 docs/translations/kr/hd-wallets.md delete mode 100755 docs/translations/kr/installation.md delete mode 100644 docs/translations/kr/join-mainnet.md delete mode 100755 docs/translations/kr/join-testnet.md delete mode 100755 docs/translations/kr/keys.md delete mode 100755 docs/translations/kr/ledger.md delete mode 100644 docs/translations/kr/upgrade-node.md delete mode 100755 docs/translations/kr/validators/overview.md delete mode 100755 docs/translations/kr/validators/security.md delete mode 100755 docs/translations/kr/validators/validator-faq.md delete mode 100755 docs/translations/kr/validators/validator-setup.md delete mode 100644 docs/translations/kr/what-is-gaia.md delete mode 100644 docs/validators/README.md delete mode 100644 docs/validators/kms/kms.md delete mode 100644 docs/validators/kms/kms_ledger.md delete mode 100644 docs/validators/kms/ledger_1.jpg delete mode 100644 docs/validators/kms/ledger_2.jpg delete mode 100644 docs/validators/overview.md delete mode 100644 docs/validators/security.md delete mode 100644 docs/validators/validator-faq.md delete mode 100644 docs/validators/validator-setup.md delete mode 100644 docs/versions diff --git a/docs/.vuepress/components/home.vue b/docs/.vuepress/components/home.vue deleted file mode 100644 index b49c06157d..0000000000 --- a/docs/.vuepress/components/home.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js deleted file mode 100644 index 2c160dc11b..0000000000 --- a/docs/.vuepress/config.js +++ /dev/null @@ -1,160 +0,0 @@ -module.exports = { - theme: "cosmos", - title: "Cosmos Hub", - head: [ - [ - "link", - { - rel: "stylesheet", - type: "text/css", - href: "https://cloud.typography.com/6138116/7255612/css/fonts.css" - } - ], - ], - base: process.env.VUEPRESS_BASE || "/", - themeConfig: { - docsRepo: "cosmos/gaia", - docsDir: "docs", - editLinks: true, - label: "hub", - sidebar: [ - { - title: "Resources", - children: [ - { - title: "Tutorials", - path: "https://tutorials.cosmos.network" - }, - { - title: "SDK API Reference", - path: "https://godoc.org/github.com/cosmos/cosmos-sdk" - }, - { - title: "REST API Spec", - path: "https://cosmos.network/rpc/" - } - ] - } - ], - gutter: { - title: "Help & Support", - editLink: true, - chat: { - title: "Riot Chat", - text: "Chat with Cosmos developers on Riot Chat.", - url: "https://riot.im/app/#/room/#cosmos-sdk:matrix.org", - bg: "linear-gradient(225.11deg, #2E3148 0%, #161931 95.68%)" - }, - forum: { - title: "Cosmos SDK Forum", - text: "Join the SDK Developer Forum to learn more.", - url: "https://forum.cosmos.network/", - bg: "linear-gradient(225deg, #46509F -1.08%, #2F3564 95.88%)", - logo: "cosmos" - }, - github: { - title: "Found an Issue?", - text: "Help us improve this page by suggesting edits on GitHub." - } - }, - footer: { - logo: "/logo-bw.svg", - textLink: { - text: "cosmos.network", - url: "/" - }, - services: [ - { - service: "medium", - url: "https://blog.cosmos.network/" - }, - { - service: "twitter", - url: "https://twitter.com/cosmos" - }, - { - service: "linkedin", - url: "https://www.linkedin.com/company/tendermint/" - }, - { - service: "reddit", - url: "https://reddit.com/r/cosmosnetwork" - }, - { - service: "telegram", - url: "https://t.me/cosmosproject" - }, - { - service: "youtube", - url: "https://www.youtube.com/c/CosmosProject" - } - ], - smallprint: - "This website is maintained by Tendermint Inc. The contents and opinions of this website are those of Tendermint Inc.", - links: [ - { - title: "Documentation", - children: [ - { - title: "Cosmos SDK", - url: "https://docs.cosmos.network" - }, - { - title: "Cosmos Hub", - url: "https://hub.cosmos.network/" - }, - { - title: "Tendermint Core", - url: "https://docs.tendermint.com/" - } - ] - }, - { - title: "Community", - children: [ - { - title: "Cosmos blog", - url: "https://blog.cosmos.network/" - }, - { - title: "Forum", - url: "https://forum.cosmos.network/" - }, - { - title: "Chat", - url: "https://riot.im/app/#/room/#cosmos-sdk:matrix.org" - } - ] - }, - { - title: "Contributing", - children: [ - { - title: "Contributing to the docs", - url: - "https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOCS_README.md" - }, - { - title: "Source code on GitHub", - url: "https://github.com/cosmos/cosmos-sdk/" - } - ] - } - ] - } - }, - plugins: [ - // [ - // "@vuepress/google-analytics", - // { - // ga: "UA-51029217-12" - // } - // ], - [ - "sitemap", - { - hostname: "https://hub.cosmos.network" - } - ] - ] -}; diff --git a/docs/.vuepress/public/logo-bw.svg b/docs/.vuepress/public/logo-bw.svg deleted file mode 100644 index f2575260a7..0000000000 --- a/docs/.vuepress/public/logo-bw.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/docs/.vuepress/public/logo.svg b/docs/.vuepress/public/logo.svg deleted file mode 100644 index 95ca6d30da..0000000000 --- a/docs/.vuepress/public/logo.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/docs/.vuepress/styles/index.styl b/docs/.vuepress/styles/index.styl deleted file mode 100644 index e50a4efbac..0000000000 --- a/docs/.vuepress/styles/index.styl +++ /dev/null @@ -1,3 +0,0 @@ -:root - --accent-color #ba3ed9 - --background #161931 \ No newline at end of file diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md deleted file mode 100644 index cca06e665f..0000000000 --- a/docs/DOCS_README.md +++ /dev/null @@ -1,112 +0,0 @@ - - -# Updating the docs - -If you want to open a PR on Gaia to update the documentation, please follow the guidelines in the [`CONTRIBUTING.md`](https://github.com/cosmos/gaia/tree/master/CONTRIBUTING.md) - -## Docs Build Workflow - -The documentation for Gaia is hosted at: - -- https://hub.cosmos.network/docs/ - -built from the files in this (`/docs`) directory for [master](https://github.com/cosmos/gaia/tree/master/docs) - -### How It Works - -There is a CircleCI job listening for changes in the `/docs` directory, on both -the `master` and `develop` branches. Any updates to files in this directory -on those branches will automatically trigger a website deployment. Under the hood, -the private website repository has a `make build-docs` target consumed by a CircleCI job in that repo. - -## README - -The [README.md](./README.md) is also the landing page for the documentation -on the website. During the Jenkins build, the current commit is added to the bottom -of the README. - -## Links - -**NOTE:** Strongly consider the existing links - both within this directory -and to the website docs - when moving or deleting files. - -Relative links should be used nearly everywhere, having discovered and weighed the following: - -### Relative - -Where is the other file, relative to the current one? - -- works both on GitHub and for the VuePress build -- confusing / annoying to have things like: `../../../../myfile.md` -- requires more updates when files are re-shuffled - -### Absolute - -Where is the other file, given the root of the repo? - -- works on GitHub, doesn't work for the VuePress build -- this is much nicer: `/docs/hereitis/myfile.md` -- if you move that file around, the links inside it are preserved (but not to it, of course) - -### Full - -The full GitHub URL to a file or directory. Used occasionally when it makes sense -to send users to the GitHub. - -## Building Locally - -To build and serve the documentation locally, run: - -```bash -npm install -g vuepress -``` - -then change the following line in the `config.js`: - -```js -base: "/docs/", -``` - -to: - -```js -base: "/", -``` - -Finally, go up one directory to the root of the repo and run: - -```bash -# from root of repo -vuepress build docs -cd dist/docs -python -m SimpleHTTPServer 8080 -``` - -then navigate to localhost:8080 in your browser. - -## Search - -We are using [Algolia](https://www.algolia.com) to power full-text search. This uses a public API search-only key in the `config.js` as well as a [cosmos_network.json](https://github.com/algolia/docsearch-configs/blob/master/configs/cosmos_network.json) configuration file that we can update with PRs. - -## Consistency - -Because the build processes are identical (as is the information contained herein), this file should be kept in sync as -much as possible with its [counterpart in the Tendermint Core repo](https://github.com/tendermint/tendermint/blob/master/docs/DOCS_README.md). - -### Update and Build the RPC docs - -1. Execute the following command at the root directory to install the swagger-ui generate tool. - ```bash - make tools - ``` -2. Edit API docs - 1. Directly Edit API docs manually: `cmd/gaiacli/swagger-ui/swagger.yaml`. - 2. Edit API docs within the [Swagger Editor](https://editor.swagger.io/). Please refer to this [document](https://swagger.io/docs/specification/2-0/basic-structure/) for the correct structure in `.yaml`. -3. Download `swagger.yaml` and replace the old `swagger.yaml` under fold `cmd/gaiacli/swagger-ui`. -4. Compile gaiacli - ```bash - make install - ``` diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 4701aac986..0000000000 --- a/docs/README.md +++ /dev/null @@ -1,43 +0,0 @@ - - -# Cosmos Hub Documentation - -Welcome to the documentation of the **Cosmos Hub application: `gaia`**. - -## What is Gaia? - -- [Intro to the `gaia` software](./gaia-tutorials/what-is-gaia.md) - -## Join the Cosmos Hub Mainnet - -- [Install the `gaia` application](./gaia-tutorials/installation.md) -- [Set up a full node and join the mainnet](./gaia-tutorials/join-mainnet.md) -- [Upgrade to a validator node](./validators/validator-setup.md) - -## Join the Cosmos Hub Public Testnet - -- [Join the testnet](./gaia-tutorials/join-testnet.md) - -## Setup Your Own `gaia` Testnet - -- [Setup your own `gaia` testnet](./gaia-tutorials/deploy-testnet.md) - -## Additional Resources - -- [Validator Resources](./validators/README.md): Contains documentation for `gaia` validators. -- [Delegator Resources](./delegators/README.md): Contains documentation for delegators. -- [Other Resources](./resources/README.md): Contains documentation on `gaiacli`, genesis file, service providers, ledger wallets, ... -- [Cosmos Hub Archives](./resources/archives.md): State archives of past iteration of the Cosmos Hub. - -# Contribute - -See [this file](./DOCS_README.md) for details of the build process and -considerations when making changes. - -# Version - -This documentation is built from the following commit: diff --git a/docs/delegators/README.md b/docs/delegators/README.md deleted file mode 100644 index 3ccd423976..0000000000 --- a/docs/delegators/README.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -order: false -parent: - order: 2 ---- - -# Delegators - -This folder contains documentation relevant to delegators of the Cosmos Hub and other `gaia` blockchains. - -- [Delegator CLI Guide](./delegator-guide-cli.md) -- [Delegators FAQ](./delegator-faq.md) -- [Delegator Security Notice](./delegator-security.md) \ No newline at end of file diff --git a/docs/delegators/delegator-faq.md b/docs/delegators/delegator-faq.md deleted file mode 100644 index 9617824a0b..0000000000 --- a/docs/delegators/delegator-faq.md +++ /dev/null @@ -1,71 +0,0 @@ - - -# Delegator FAQ - -## What is a delegator? - -People that cannot or do not want to operate [validator nodes](..//validators/overview.md) can still participate in the staking process as delegators. Indeed, validators are not chosen based on their self-delegated stake but based on their total stake, which is the sum of their self-delegated stake and of the stake that is delegated to them. This is an important property, as it makes delegators a safeguard against validators that exhibit bad behavior. If a validator misbehaves, their delegators will move their Atoms away from them, thereby reducing their stake. Eventually, if a validator's stake falls under the top 100 addresses with highest stake, they will exit the validator set. - -**Delegators share the revenue of their validators, but they also share the risks.** In terms of revenue, validators and delegators differ in that validators can apply a commission on the revenue that goes to their delegator before it is distributed. This commission is known to delegators beforehand and can only change according to predefined constraints (see [section](#choosing-a-validator) below). In terms of risk, delegators' Atoms can be slashed if their validator misbehaves. For more, see [Risks](#risks) section. - -To become delegators, Atom holders need to send a ["Delegate transaction"](./delegator-guide-cli.md#sending-transactions) where they specify how many Atoms they want to bond and to which validator. A list of validator candidates will be displayed in Cosmos Hub explorers. Later, if a delegator wants to unbond part or all of their stake, they needs to send an "Unbond transaction". From there, the delegator will have to wait 3 weeks to retrieve their Atoms. Delegators can also send a "Rebond Transaction" to switch from one validator to another, without having to go through the 3 weeks waiting period. - -For a practical guide on how to become a delegator, click [here](./delegator-guide-cli.md). - -## Choosing a validator - -In order to choose their validators, delegators have access to a range of information directly in [Lunie](https://lunie.io) or other Cosmos block explorers. - -- **Validator's moniker**: Name of the validator candidate. -- **Validator's description**: Description provided by the validator operator. -- **Validator's website**: Link to the validator's website. -- **Initial commission rate**: The commission rate on revenue charged to any delegator by the validator (see below for more detail). -- **Commission max change rate:** The maximum daily increase of the validator's commission. This parameter cannot be changed by the validator operator. -- **Maximum commission:** The maximum commission rate this validator candidate can charge. This parameter cannot be changed by the validator operator. -- **Minimum self-bond amount**: Minimum amount of Atoms the validator candidate need to have bonded at all time. If the validator's self-bonded stake falls below this limit, their entire staking pool (i.e. all its delegators) will unbond. This parameter exists as a safeguard for delegators. Indeed, when a validator misbehaves, part of their total stake gets slashed. This included the validator's self-delegateds stake as well as their delegators' stake. Thus, a validator with a high amount of self-delegated Atoms has more skin-in-the-game than a validator with a low amount. The minimum self-bond amount parameter guarantees to delegators that a validator will never fall below a certain amount of self-bonded stake, thereby ensuring a minimum level of skin-in-the-game. This parameter can only be increased by the validator operator. - -## Directives of delegators - -Being a delegator is not a passive task. Here are the main directives of a delegator: - -- **Perform careful due diligence on validators before delegating.** If a validator misbehaves, part of their total stake, which includes the stake of their delegators, can be slashed. Delegators should therefore carefully select validators they think will behave correctly. -- **Actively monitor their validator after having delegated.** Delegators should ensure that the validators they delegate to behave correctly, meaning that they have good uptime, do not double sign or get compromised, and participate in governance. They should also monitor the commission rate that is applied. If a delegator is not satisfied with its validator, they can unbond or switch to another validator (Note: Delegators do not have to wait for the unbonding period to switch validators. Rebonding takes effect immediately). -- **Participate in governance.** Delegators can and are expected to actively participate in governance. A delegator's voting power is proportional to the size of their bonded stake. If a delegator does not vote, they will inherit the vote of their validator(s). If they do vote, they override the vote of their validator(s). Delegators therefore act as a counterbalance to their validators. - -## Revenue - -Validators and delegators earn revenue in exchange for their services. This revenue is given in three forms: - -- **Block provisions (Atoms):** They are paid in newly created Atoms. Block provisions exist to incentivize Atom holders to stake. The yearly inflation rate is calculated to target 2/3 bonded stake. If the total bonded stake in the network is less than 2/3 of the total Atom supply, inflation increases until it reaches 20%. If the total bonded stake is more than 2/3 of the Atom supply, inflation decreases until it reaches 7%. This means that if total bonded stake stays less than 2/3 of the total Atom supply for a prolonged period of time, unbonded Atom holders can expect their Atom value to deflate by 20% (compounded) per year. -- **Transaction fees (various tokens):** Each transfer on the Cosmos Hub comes with transactions fees. These fees can be paid in any currency that is whitelisted by the Hub's governance. Fees are distributed to bonded Atom holders in proportion to their stake. The first whitelisted token at launch is the ATOM. - -## Validator Commission - -Each validator receives revenue based on their total stake. Before this revenue is distributed to delegators, the validator can apply a commission. In other words, delegators have to pay a commission to their validators on the revenue they earn. Let us look at a concrete example: - -We consider a validator whose stake (i.e. self-delegated stake + delegated stake) is 10% of the total stake of all validators. This validator has 20% self-delegated stake and applies a commission of 10%. Now let us consider a block with the following revenue: - -- 990 Atoms in block provisions -- 10 Atoms in transaction fees. - -This amounts to a total of 1000 Atoms and 100 Photons to be distributed among all staking pools. - -Our validator's staking pool represents 10% of the total stake, which means the pool obtains 100 Atoms and 10 Photons. Now let us look at the internal distribution of revenue: - -- Commission = `10% * 80% * 100` Atoms = 8 Atoms -- Validator's revenue = `20% * 100` Atoms + Commission = 28 Atoms -- Delegators' total revenue = `80% * 100` Atoms - Commission = 72 Atoms - -Then, each delegator in the staking pool can claim their portion of the delegators' total revenue. - -## Risks - -Staking Atoms is not free of risk. First, staked Atoms are locked up, and retrieving them requires a 3 week waiting period called unbonding period. Additionally, if a validator misbehaves, a portion of their total stake can be slashed (i.e. destroyed). This includes the stake of their delegators. - -There is one main slashing condition: - -- **Double signing:** If someone reports on that a validator signed two different blocks with the same chain ID at the same height, this validator will get slashed. - -This is why Atom holders should perform careful due diligence on validators before delegating. It is also important that delegators actively monitor the activity of their validators. If a validator behaves suspiciously or is too often offline, delegators can choose to unbond from them or switch to another validator. **Delegators can also mitigate risk by distributing their stake across multiple validators.**s \ No newline at end of file diff --git a/docs/delegators/delegator-guide-cli.md b/docs/delegators/delegator-guide-cli.md deleted file mode 100644 index dd8345025b..0000000000 --- a/docs/delegators/delegator-guide-cli.md +++ /dev/null @@ -1,546 +0,0 @@ - - -# Delegator Guide (CLI) - -This document contains all the necessary information for delegators to interact with the Cosmos Hub through the Command-Line Interface (CLI). - -It also contains instructions on how to manage accounts, restore accounts from the fundraiser and use a ledger nano device. - -::: danger -**Very Important**: Please assure that you follow the steps described hereinafter -carefully, as negligence in this significant process could lead to an indefinite -loss of your Atoms. Therefore, read through the following instructions in their -entirety prior to proceeding and reach out to us in case you need support. - -Please also note that you are about to interact with the Cosmos Hub, a -blockchain technology containing highly experimental software. While the -blockchain has been developed in accordance to the state of the art and audited -with utmost care, we can nevertheless expect to have issues, updates and bugs. -Furthermore, interaction with blockchain technology requires -advanced technical skills and always entails risks that are outside our control. -By using the software, you confirm that you understand the inherent risks -associated with cryptographic software (see also risk section of the -[Interchain Cosmos Contribution terms](https://github.com/cosmos/cosmos/blob/master/fundraiser/Interchain%20Cosmos%20Contribution%20Terms%20-%20FINAL.pdf)) and that the Interchain Foundation and/or -the Tendermint Team may not be held liable for potential damages arising out of the use of the -software. Any use of this open source software released under the Apache 2.0 license is -done at your own risk and on a "AS IS" basis, without warranties or conditions -of any kind. -::: - -Please exercise extreme caution! - -## Table of Contents - -- [Installing `gaiacli`](#installing-gaiacli) -- [Cosmos Accounts](#cosmos-accounts) - + [Restoring an Account from the Fundraiser](#restoring-an-account-from-the-fundraiser) - + [Creating an Account](#creating-an-account) -- [Accessing the Cosmos Hub Network](#accessing-the-cosmos-hub-network) - + [Running Your Own Full-Node](#running-your-own-full-node) - + [Connecting to a Remote Full-Node](#connecting-to-a-remote-full-node) -- [Setting Up `gaiacli`](#setting-up-gaiacli) -- [Querying the State](#querying-the-state) -- [Sending Transactions](#sending-transactions) - + [A Note on Gas and Fees](#a-note-on-gas-and-fees) - + [Bonding Atoms and Withdrawing Rewards](#bonding-atoms-and-withdrawing-rewards) - + [Participating in Governance](#participating-in-governance) - + [Signing Transactions from an Offline Computer](#signing-transactions-from-an-offline-computer) - -## Installing `gaiacli` - -`gaiacli`: This is the command-line interface to interact with a `gaiad` full-node. - -::: warning -**Please check that you download the latest stable release of `gaiacli` that is available** -::: - -[**Download the binaries**] -Not available yet. - -[**Install from source**](../gaia-tutorials/installation.md) - -::: tip -`gaiacli` is used from a terminal. To open the terminal, follow these steps: -- **Windows**: `Start` > `All Programs` > `Accessories` > `Command Prompt` -- **MacOS**: `Finder` > `Applications` > `Utilities` > `Terminal` -- **Linux**: `Ctrl` + `Alt` + `T` -::: - -## Cosmos Accounts - -At the core of every Cosmos account, there is a seed, which takes the form of a 12 or 24-words mnemonic. From this mnemonic, it is possible to create any number of Cosmos accounts, i.e. pairs of private key/public key. This is called an HD wallet (see [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) for more information on the HD wallet specification). - -``` - Account 0 Account 1 Account 2 - -+------------------+ +------------------+ +------------------+ -| | | | | | -| Address 0 | | Address 1 | | Address 2 | -| ^ | | ^ | | ^ | -| | | | | | | | | -| | | | | | | | | -| | | | | | | | | -| + | | + | | + | -| Public key 0 | | Public key 1 | | Public key 2 | -| ^ | | ^ | | ^ | -| | | | | | | | | -| | | | | | | | | -| | | | | | | | | -| + | | + | | + | -| Private key 0 | | Private key 1 | | Private key 2 | -| ^ | | ^ | | ^ | -+------------------+ +------------------+ +------------------+ - | | | - | | | - | | | - +--------------------------------------------------------------------+ - | - | - +---------+---------+ - | | - | Mnemonic (Seed) | - | | - +-------------------+ -``` - -The funds stored in an account are controlled by the private key. This private key is generated using a one-way function from the mnemonic. If you lose the private key, you can retrieve it using the mnemonic. However, if you lose the mnemonic, you will lose access to all the derived private keys. Likewise, if someone gains access to your mnemonic, they gain access to all the associated accounts. - -::: danger -**Do not lose or share your 12 words with anyone. To prevent theft or loss of funds, it is best to ensure that you keep multiple copies of your mnemonic, and store it in a safe, secure place and that only you know how to access. If someone is able to gain access to your mnemonic, they will be able to gain access to your private keys and control the accounts associated with them.** -::: - -The address is a public string with a human-readable prefix (e.g. `cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg`) that identifies your account. When someone wants to send you funds, they send it to your address. It is computationally infeasible to find the private key associated with a given address. - -### Restoring an Account from the Fundraiser - -::: tip -*NOTE: This section only concerns fundraiser participants* -::: - -If you participated in the fundraiser, you should be in possession of a 12-words mnemonic. Newly generated mnemonics use 24 words, but 12-word mnemonics are also compatible with all the Cosmos tools. - -#### On a Ledger Device - -At the core of a ledger device, there is a mnemonic used to generate accounts on multiple blockchains (including the Cosmos Hub). Usually, you will create a new mnemonic when you initialize your ledger device. However, it is possible to tell the ledger device to use a mnemonic provided by the user instead. Let us go ahead and see how you can input the mnemonic you obtained during the fundraiser as the seed of your ledger device. - -::: warning -*NOTE: To do this, **it is preferable to use a brand new ledger device.**. Indeed, there can be only one mnemonic per ledger device. If, however, you want to use a ledger that is already initialized with a seed, you can reset it by going in `Settings`>`Device`>`Reset All`. **Please note that this will wipe out the seed currently stored on the device. If you have not properly secured the associated mnemonic, you could lose your funds!!!*** -::: - -The following steps need to be performed on an un-initialized ledger device: - -1. Connect your ledger device to the computer via USB -2. Press both buttons -3. Do **NOT** choose the "Config as a new device" option. Instead, choose "Restore Configuration" -4. Choose a PIN -5. Choose the 12 words option -6. Input each of the words you got during the fundraiser, in the correct order. - -Your ledger is now correctly set up with your fundraiser mnemonic! Do not lose this mnemonic! If your ledger is compromised, you can always restore a new device again using the same mnemonic. - -Next, click [here](#using-a-ledger-device) to learn how to generate an account. - -#### On a Computer - -::: warning -**NOTE: It is more secure to perform this action on an offline computer** -::: - -To restore an account using a fundraiser mnemonic and store the associated encrypted private key on a computer, use the following command: - -```bash -gaiacli keys add --recover -``` - -- `` is the name of the account. It is a reference to the account number used to derive the key pair from the mnemonic. You will use this name to identify your account when you want to send a transaction. -- You can add the optional `--account` flag to specify the path (`0`, `1`, `2`, ...) you want to use to generate your account. By default, account `0` is generated. - -The private key of account `0` will be saved in your operating system's credentials storage. -Each time you want to send a transaction, you will need to unlock your system's credentials store. -If you lose access to your credentials storage, you can always recover the private key with the -mnemonic. - -::: tip -**You may not be prompted for password each time you send a transaction since most operating systems -unlock user's credentials store upon login by default. If you want to change your credentials -store security policies please refer to your operating system manual.** -::: - -### Creating an Account - -To create an account, you just need to have `gaiacli` installed. Before creating it, you need to know where you intend to store and interact with your private keys. The best options are to store them in an offline dedicated computer or a ledger device. Storing them on your regular online computer involves more risk, since anyone who infiltrates your computer through the internet could exfiltrate your private keys and steal your funds. - -#### Using a Ledger Device - -::: warning -**Only use Ledger devices that you bought factory new or trust fully** -::: - -When you initialize your ledger, a 24-word mnemonic is generated and stored in the device. This mnemonic is compatible with Cosmos and Cosmos accounts can be derived from it. Therefore, all you have to do is make your ledger compatible with `gaiacli`. To do so, you need to go through the following steps: - -1. Download the Ledger Live app [here](https://www.ledger.com/pages/ledger-live). -2. Connect your ledger via USB and update to the latest firmware -3. Go to the ledger live app store, and download the "Cosmos" application (this can take a while). **Note: You may have to enable `Dev Mode` in the `Settings` of Ledger Live to be able to download the "Cosmos" application**. -4. Navigate to the Cosmos app on your ledger device - -Then, to create an account, use the following command: - -```bash -gaiacli keys add --ledger -``` - -::: warning -**This command will only work while the Ledger is plugged in and unlocked** -::: - -- `` is the name of the account. It is a reference to the account number used to derive the key pair from the mnemonic. You will use this name to identify your account when you want to send a transaction. -- You can add the optional `--account` flag to specify the path (`0`, `1`, `2`, ...) you want to use to generate your account. By default, account `0` is generated. - -#### Using a Computer - -::: warning -**NOTE: It is more secure to perform this action on an offline computer** -::: - -To generate an account, just use the following command: - -```bash -gaiacli keys add -``` - -The command will generate a 24-words mnemonic and save the private and public keys for account `0` -at the same time. -Each time you want to send a transaction, you will need to unlock your system's credentials store. -If you lose access to your credentials storage, you can always recover the private key with the -mnemonic. - -::: tip -**You may not be prompted for password each time you send a transaction since most operating systems -unlock user's credentials store upon login by default. If you want to change your credentials -store security policies please refer to your operating system manual.** -::: - -::: danger -**Do not lose or share your 12 words with anyone. To prevent theft or loss of funds, it is best to ensure that you keep multiple copies of your mnemonic, and store it in a safe, secure place and that only you know how to access. If someone is able to gain access to your mnemonic, they will be able to gain access to your private keys and control the accounts associated with them.** -::: - -::: warning -After you have secured your mnemonic (triple check!), you can delete bash history to ensure no one can retrieve it: - -```bash -history -c -rm ~/.bash_history -``` -::: - -- `` is the name of the account. It is a reference to the account number used to derive the key pair from the mnemonic. You will use this name to identify your account when you want to send a transaction. -- You can add the optional `--account` flag to specify the path (`0`, `1`, `2`, ...) you want to use to generate your account. By default, account `0` is generated. - - -You can generate more accounts from the same mnemonic using the following command: - -```bash -gaiacli keys add --recover --account 1 -``` - -This command will prompt you to input a passphrase as well as your mnemonic. Change the account number to generate a different account. - - -## Accessing the Cosmos Hub Network - -In order to query the state and send transactions, you need a way to access the network. To do so, you can either run your own full-node, or connect to someone else's. - -::: danger -**NOTE: Do not share your mnemonic (12 or 24 words) with anyone. The only person who should ever need to know it is you. This is especially important if you are ever approached via email or direct message by someone requesting that you share your mnemonic for any kind of blockchain services or support. No one from Cosmos, the Tendermint team or the Interchain Foundation will ever send an email that asks for you to share any kind of account credentials or your mnemonic."**. -::: - -### Running Your Own Full-Node - -This is the most secure option, but comes with relatively high resource requirements. In order to run your own full-node, you need good bandwidth and at least 1TB of disk space. - -You will find the tutorial on how to install `gaiad` [here](https://cosmos.network/docs/cosmos-hub/installation.html), and the guide to run a full-node [here](https://cosmos.network/docs/cosmos-hub/join-mainnet.html). - -### Connecting to a Remote Full-Node - -If you do not want or cannot run your own node, you can connect to someone else's full-node. You should pick an operator you trust, because a malicious operator could return incorrect query results or censor your transactions. However, they will never be able to steal your funds, as your private keys are stored locally on your computer or ledger device. Possible options of full-node operators include validators, wallet providers or exchanges. - -In order to connect to the full-node, you will need an address of the following form: `https://77.87.106.33:26657` (*Note: This is a placeholder*). This address has to be communicated by the full-node operator you choose to trust. You will use this address in the [following section](#setting-up-gaiacli). - -## Setting Up `gaiacli` - -::: tip -**Before setting up `gaiacli`, make sure you have set up a way to [access the Cosmos Hub network](#accessing-the-cosmos-hub-network)** -::: - -::: warning -**Please check that you are always using the latest stable release of `gaiacli`** -::: - -`gaiacli` is the tool that enables you to interact with the node that runs on the Cosmos Hub network, whether you run it yourself or not. Let us set it up properly. - -In order to set up `gaiacli`, use the following command: - -```bash -gaiacli config -``` - -It allows you to set a default value for each given flag. - -First, set up the address of the full-node you want to connect to: - -```bash -gaiacli config node : - -// query the list of validators -gaiacli query staking validators - -// query the information of a validator given their address (e.g. cosmosvaloper1n5pepvmgsfd3p2tqqgvt505jvymmstf6s9gw27) -gaiacli query staking validator - -// query all delegations made from a delegator given their address (e.g. cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg) -gaiacli query staking delegations - -// query a specific delegation made from a delegator (e.g. cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg) to a validator (e.g. cosmosvaloper1n5pepvmgsfd3p2tqqgvt505jvymmstf6s9gw27) given their addresses -gaiacli query staking delegation - -// query the rewards of a delegator given a delegator address (e.g. cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg) -gaiacli query distribution rewards - -// query all proposals currently open for depositing -gaiacli query gov proposals --status deposit_period - -// query all proposals currently open for voting -gaiacli query gov proposals --status voting_period - -// query a proposal given its proposalID -gaiacli query gov proposal -``` - -For more commands, just type: - -```bash -gaiacli query -``` - -For each command, you can use the `-h` or `--help` flag to get more information. - -## Sending Transactions - -::: warning -On Cosmos Hub mainnet, the accepted denom is `uatom`, where `1atom = 1,000,000uatom` -::: - -### A Note on Gas and Fees - -Transactions on the Cosmos Hub network need to include a transaction fee in order to be processed. This fee pays for the gas required to run the transaction. The formula is the following: - -``` -fees = ceil(gas * gasPrices) -``` - -The `gas` is dependent on the transaction. Different transaction require different amount of `gas`. The `gas` amount for a transaction is calculated as it is being processed, but there is a way to estimate it beforehand by using the `auto` value for the `gas` flag. Of course, this only gives an estimate. You can adjust this estimate with the flag `--gas-adjustment` (default `1.0`) if you want to be sure you provide enough `gas` for the transaction. For the remainder of this tutorial, we will use a `--gas-adjustment` of `1.5`. - -The `gasPrice` is the price of each unit of `gas`. Each validator sets a `min-gas-price` value, and will only include transactions that have a `gasPrice` greater than their `min-gas-price`. - -The transaction `fees` are the product of `gas` and `gasPrice`. As a user, you have to input 2 out of 3. The higher the `gasPrice`/`fees`, the higher the chance that your transaction will get included in a block. - -::: tip -For mainnet, the recommended `gas-prices` is `0.025uatom`. -::: - -### Sending Tokens - -::: tip -**Before you can bond atoms and withdraw rewards, you need to [set up `gaiacli`](#setting-up-gaiacli) and [create an account](#creating-an-account)** -::: - -::: warning -**Note: These commands need to be run on an online computer. It is more secure to perform them commands using a Ledger Nano S device. For the offline procedure, click [here](#signing-transactions-from-an-offline-computer).** -::: - -```bash -// Send a certain amount of tokens to an address -// Ex value for parameters (do not actually use these values in your tx!!): =cosmos16m93fezfiezhvnjajzrfyszml8qm92a0w67ntjhd3d0 =1000000uatom -// Ex value for flags: =0.025uatom - -gaiacli tx send --from --gas auto --gas-adjustment 1.5 --gas-prices -``` - -### Bonding Atoms and Withdrawing Rewards - -::: tip -**Before you can bond atoms and withdraw rewards, you need to [set up `gaiacli`](#setting-up-gaiacli) and [create an account](#creating-an-account)** -::: - -::: warning -**Before bonding Atoms, please read the [delegator faq](https://cosmos.network/resources/delegators) to understand the risk and responsibilities involved with delegating** -::: - -::: warning -**Note: These commands need to be run on an online computer. It is more secure to perform them commands using a ledger device. For the offline procedure, click [here](#signing-transactions-from-an-offline-computer).** -::: - -```bash -// Bond a certain amount of Atoms to a given validator -// ex value for flags: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =10000000uatom, =0.025uatom - -gaiacli tx staking delegate --from --gas auto --gas-adjustment 1.5 --gas-prices - - -// Redelegate a certain amount of Atoms from a validator to another -// Can only be used if already bonded to a validator -// Redelegation takes effect immediately, there is no waiting period to redelegate -// After a redelegation, no other redelegation can be made from the account for the next 3 weeks -// ex value for flags: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =100000000uatom, =0.025uatom - -gaiacli tx staking redelegate --from --gas auto --gas-adjustment 1.5 --gas-prices - -// Withdraw all rewards -// ex value for flag: =0.025uatom - -gaiacli tx distribution withdraw-all-rewards --from --gas auto --gas-adjustment 1.5 --gas-prices - - -// Unbond a certain amount of Atoms from a given validator -// You will have to wait 3 weeks before your Atoms are fully unbonded and transferrable -// ex value for flags: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =10000000uatom, =0.025uatom - -gaiacli tx staking unbond --from --gas auto --gas-adjustment 1.5 --gas-prices -``` - -::: warning -**If you use a connected Ledger, you will be asked to confirm the transaction on the device before it is signed and broadcast to the network. Note that the command will only work while the Ledger is plugged in and unlocked.** -::: - -To confirm that your transaction went through, you can use the following queries: - -```bash -// your balance should change after you bond Atoms or withdraw rewards -gaiacli query account - -// you should have delegations after you bond Atom -gaiacli query staking delegations - -// this returns your tx if it has been included -// use the tx hash that was displayed when you created the tx -gaiacli query tx - -``` - -Double check with a block explorer if you interact with the network through a trusted full-node. - -## Participating in Governance - -#### Primer on Governance - -The Cosmos Hub has a built-in governance system that lets bonded Atom holders vote on proposals. There are three types of proposal: - -- `Text Proposals`: These are the most basic type of proposals. They can be used to get the opinion of the network on a given topic. -- `Parameter Proposals`: These are used to update the value of an existing parameter. -- `Software Upgrade Proposal`: These are used to propose an upgrade of the Hub's software. - -Any Atom holder can submit a proposal. In order for the proposal to be open for voting, it needs to come with a `deposit` that is greater than a parameter called `minDeposit`. The `deposit` need not be provided in its entirety by the submitter. If the initial proposer's `deposit` is not sufficient, the proposal enters the `deposit_period` status. Then, any Atom holder can increase the deposit by sending a `depositTx`. - -Once the `deposit` reaches `minDeposit`, the proposal enters the `voting_period`, which lasts 2 weeks. Any **bonded** Atom holder can then cast a vote on this proposal. The options are `Yes`, `No`, `NoWithVeto` and `Abstain`. The weight of the vote is based on the amount of bonded Atoms of the sender. If they don't vote, delegator inherit the vote of their validator. However, delegators can override their validator's vote by sending a vote themselves. - -At the end of the voting period, the proposal is accepted if there are more than 50% `Yes` votes (excluding `Abstain ` votes) and less than 33.33% of `NoWithVeto` votes (excluding `Abstain` votes). - -#### In Practice - -::: tip -**Before you can bond atoms and withdraw rewards, you need to [bond Atoms](#bonding-atoms-and-withdrawing-rewards)** -::: - -::: warning -**Note: These commands need to be run on an online computer. It is more secure to perform them commands using a ledger device. For the offline procedure, click [here](#signing-transactions-from-an-offline-computer).** -::: - -```bash -// Submit a Proposal -// =text/parameter_change/software_upgrade -// ex value for flag: =0.025uatom - -gaiacli tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type --deposit=10000000uatom --gas auto --gas-adjustment 1.5 --gas-prices --from - -// Increase deposit of a proposal -// Retrieve proposalID from $gaiacli query gov proposals --status deposit_period -// ex value for parameter: =10000000uatom - -gaiacli tx gov deposit --gas auto --gas-adjustment 1.5 --gas-prices --from - -// Vote on a proposal -// Retrieve proposalID from $gaiacli query gov proposals --status voting_period -//