diff --git a/.github/lint.yml b/.github/lint.yml new file mode 100644 index 00000000..d49ad4f2 --- /dev/null +++ b/.github/lint.yml @@ -0,0 +1,27 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: 1.19 + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: latest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 211bd344..af9f2ff2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,497 +1,2 @@ -release/bcna_darwin_amd64.tar.gz -release/bcna_darwin_arm64.tar.gz -release/bcna_linux_amd64.tar.gz -release/bcna_linux_arm64.tar.gz -release/release_checksum -ts-client/client.ts -ts-client/env.ts -ts-client/helpers.ts -ts-client/index.ts -ts-client/modules.ts -ts-client/package.json -ts-client/types.d.ts -ts-client/bitcannaglobal.bcna.bcna/index.ts -ts-client/bitcannaglobal.bcna.bcna/module.ts -ts-client/bitcannaglobal.bcna.bcna/registry.ts -ts-client/bitcannaglobal.bcna.bcna/rest.ts -ts-client/bitcannaglobal.bcna.bcna/types.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bitcannaid.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/genesis.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/params.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/query.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/supplychain.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/tx.ts -ts-client/bitcannaglobal.bcna.bcna/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/bitcannaglobal.bcna.bcna/types/gogoproto/gogo.ts -ts-client/bitcannaglobal.bcna.bcna/types/google/api/annotations.ts -ts-client/bitcannaglobal.bcna.bcna/types/google/api/http.ts -ts-client/bitcannaglobal.bcna.bcna/types/google/protobuf/descriptor.ts -ts-client/cosmos.auth.v1beta1/index.ts -ts-client/cosmos.auth.v1beta1/module.ts -ts-client/cosmos.auth.v1beta1/registry.ts -ts-client/cosmos.auth.v1beta1/rest.ts -ts-client/cosmos.auth.v1beta1/types.ts -ts-client/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.ts -ts-client/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/genesis.ts -ts-client/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.ts -ts-client/cosmos.auth.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.auth.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.auth.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.auth.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.auth.v1beta1/types/google/api/http.ts -ts-client/cosmos.auth.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.auth.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.authz.v1beta1/index.ts -ts-client/cosmos.authz.v1beta1/module.ts -ts-client/cosmos.authz.v1beta1/registry.ts -ts-client/cosmos.authz.v1beta1/rest.ts -ts-client/cosmos.authz.v1beta1/types.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/authz/v1beta1/authz.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/authz/v1beta1/event.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/authz/v1beta1/genesis.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/authz/v1beta1/query.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/authz/v1beta1/tx.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.authz.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.authz.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.authz.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.authz.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.authz.v1beta1/types/google/api/http.ts -ts-client/cosmos.authz.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.authz.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.authz.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.bank.v1beta1/index.ts -ts-client/cosmos.bank.v1beta1/module.ts -ts-client/cosmos.bank.v1beta1/registry.ts -ts-client/cosmos.bank.v1beta1/rest.ts -ts-client/cosmos.bank.v1beta1/types.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/bank.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.bank.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.bank.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.bank.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.bank.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.bank.v1beta1/types/google/api/http.ts -ts-client/cosmos.bank.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.base.tendermint.v1beta1/index.ts -ts-client/cosmos.base.tendermint.v1beta1/module.ts -ts-client/cosmos.base.tendermint.v1beta1/registry.ts -ts-client/cosmos.base.tendermint.v1beta1/rest.ts -ts-client/cosmos.base.tendermint.v1beta1/types.ts -ts-client/cosmos.base.tendermint.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/query.ts -ts-client/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/types.ts -ts-client/cosmos.base.tendermint.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.base.tendermint.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.base.tendermint.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.base.tendermint.v1beta1/types/google/api/http.ts -ts-client/cosmos.base.tendermint.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.base.tendermint.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.base.tendermint.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/keys.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/crypto/proof.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/p2p/types.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/block.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/evidence.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/types.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/types/validator.ts -ts-client/cosmos.base.tendermint.v1beta1/types/tendermint/version/types.ts -ts-client/cosmos.crisis.v1beta1/index.ts -ts-client/cosmos.crisis.v1beta1/module.ts -ts-client/cosmos.crisis.v1beta1/registry.ts -ts-client/cosmos.crisis.v1beta1/rest.ts -ts-client/cosmos.crisis.v1beta1/types.ts -ts-client/cosmos.crisis.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/genesis.ts -ts-client/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.ts -ts-client/cosmos.crisis.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.crisis.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.crisis.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.crisis.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.distribution.v1beta1/index.ts -ts-client/cosmos.distribution.v1beta1/module.ts -ts-client/cosmos.distribution.v1beta1/registry.ts -ts-client/cosmos.distribution.v1beta1/rest.ts -ts-client/cosmos.distribution.v1beta1/types.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/distribution.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/genesis.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.distribution.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.distribution.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.distribution.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.distribution.v1beta1/types/google/api/http.ts -ts-client/cosmos.distribution.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.evidence.v1beta1/index.ts -ts-client/cosmos.evidence.v1beta1/module.ts -ts-client/cosmos.evidence.v1beta1/registry.ts -ts-client/cosmos.evidence.v1beta1/rest.ts -ts-client/cosmos.evidence.v1beta1/types.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/evidence.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/genesis.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/tx.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.evidence.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.evidence.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.evidence.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.evidence.v1beta1/types/google/api/http.ts -ts-client/cosmos.evidence.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.evidence.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.evidence.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.feegrant.v1beta1/index.ts -ts-client/cosmos.feegrant.v1beta1/module.ts -ts-client/cosmos.feegrant.v1beta1/registry.ts -ts-client/cosmos.feegrant.v1beta1/rest.ts -ts-client/cosmos.feegrant.v1beta1/types.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/feegrant.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/genesis.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/query.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/feegrant/v1beta1/tx.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.feegrant.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.feegrant.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.feegrant.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.feegrant.v1beta1/types/google/api/http.ts -ts-client/cosmos.feegrant.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.feegrant.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.feegrant.v1beta1/types/google/protobuf/duration.ts -ts-client/cosmos.feegrant.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.gov.v1/index.ts -ts-client/cosmos.gov.v1/module.ts -ts-client/cosmos.gov.v1/registry.ts -ts-client/cosmos.gov.v1/rest.ts -ts-client/cosmos.gov.v1/types.ts -ts-client/cosmos.gov.v1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.gov.v1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.gov.v1/types/cosmos/gov/v1/genesis.ts -ts-client/cosmos.gov.v1/types/cosmos/gov/v1/gov.ts -ts-client/cosmos.gov.v1/types/cosmos/gov/v1/query.ts -ts-client/cosmos.gov.v1/types/cosmos/gov/v1/tx.ts -ts-client/cosmos.gov.v1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.gov.v1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.gov.v1/types/gogoproto/gogo.ts -ts-client/cosmos.gov.v1/types/google/api/annotations.ts -ts-client/cosmos.gov.v1/types/google/api/http.ts -ts-client/cosmos.gov.v1/types/google/protobuf/any.ts -ts-client/cosmos.gov.v1/types/google/protobuf/descriptor.ts -ts-client/cosmos.gov.v1/types/google/protobuf/duration.ts -ts-client/cosmos.gov.v1/types/google/protobuf/timestamp.ts -ts-client/cosmos.gov.v1beta1/index.ts -ts-client/cosmos.gov.v1beta1/module.ts -ts-client/cosmos.gov.v1beta1/registry.ts -ts-client/cosmos.gov.v1beta1/rest.ts -ts-client/cosmos.gov.v1beta1/types.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/genesis.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/gov.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/query.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/tx.ts -ts-client/cosmos.gov.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.gov.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.gov.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.gov.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.gov.v1beta1/types/google/api/http.ts -ts-client/cosmos.gov.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.gov.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.gov.v1beta1/types/google/protobuf/duration.ts -ts-client/cosmos.gov.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.group.v1/index.ts -ts-client/cosmos.group.v1/module.ts -ts-client/cosmos.group.v1/registry.ts -ts-client/cosmos.group.v1/rest.ts -ts-client/cosmos.group.v1/types.ts -ts-client/cosmos.group.v1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.group.v1/types/cosmos/group/v1/events.ts -ts-client/cosmos.group.v1/types/cosmos/group/v1/genesis.ts -ts-client/cosmos.group.v1/types/cosmos/group/v1/query.ts -ts-client/cosmos.group.v1/types/cosmos/group/v1/tx.ts -ts-client/cosmos.group.v1/types/cosmos/group/v1/types.ts -ts-client/cosmos.group.v1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.group.v1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.group.v1/types/gogoproto/gogo.ts -ts-client/cosmos.group.v1/types/google/api/annotations.ts -ts-client/cosmos.group.v1/types/google/api/http.ts -ts-client/cosmos.group.v1/types/google/protobuf/any.ts -ts-client/cosmos.group.v1/types/google/protobuf/descriptor.ts -ts-client/cosmos.group.v1/types/google/protobuf/duration.ts -ts-client/cosmos.group.v1/types/google/protobuf/timestamp.ts -ts-client/cosmos.mint.v1beta1/index.ts -ts-client/cosmos.mint.v1beta1/module.ts -ts-client/cosmos.mint.v1beta1/registry.ts -ts-client/cosmos.mint.v1beta1/rest.ts -ts-client/cosmos.mint.v1beta1/types.ts -ts-client/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/genesis.ts -ts-client/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/mint.ts -ts-client/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/query.ts -ts-client/cosmos.mint.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.mint.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.mint.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.mint.v1beta1/types/google/api/http.ts -ts-client/cosmos.mint.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.nft.v1beta1/index.ts -ts-client/cosmos.nft.v1beta1/module.ts -ts-client/cosmos.nft.v1beta1/registry.ts -ts-client/cosmos.nft.v1beta1/rest.ts -ts-client/cosmos.nft.v1beta1/types.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/event.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/genesis.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/nft.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/query.ts -ts-client/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/tx.ts -ts-client/cosmos.nft.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.nft.v1beta1/types/google/api/http.ts -ts-client/cosmos.nft.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.nft.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.params.v1beta1/index.ts -ts-client/cosmos.params.v1beta1/module.ts -ts-client/cosmos.params.v1beta1/registry.ts -ts-client/cosmos.params.v1beta1/rest.ts -ts-client/cosmos.params.v1beta1/types.ts -ts-client/cosmos.params.v1beta1/types/cosmos/params/v1beta1/params.ts -ts-client/cosmos.params.v1beta1/types/cosmos/params/v1beta1/query.ts -ts-client/cosmos.params.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.params.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.params.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.params.v1beta1/types/google/api/http.ts -ts-client/cosmos.params.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.slashing.v1beta1/index.ts -ts-client/cosmos.slashing.v1beta1/module.ts -ts-client/cosmos.slashing.v1beta1/registry.ts -ts-client/cosmos.slashing.v1beta1/rest.ts -ts-client/cosmos.slashing.v1beta1/types.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/genesis.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/query.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/slashing.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.ts -ts-client/cosmos.slashing.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.slashing.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.slashing.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.slashing.v1beta1/types/google/api/http.ts -ts-client/cosmos.slashing.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.slashing.v1beta1/types/google/protobuf/duration.ts -ts-client/cosmos.slashing.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.staking.v1beta1/index.ts -ts-client/cosmos.staking.v1beta1/module.ts -ts-client/cosmos.staking.v1beta1/registry.ts -ts-client/cosmos.staking.v1beta1/rest.ts -ts-client/cosmos.staking.v1beta1/types.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/authz.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/genesis.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/query.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.ts -ts-client/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.ts -ts-client/cosmos.staking.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.staking.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.staking.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.staking.v1beta1/types/google/api/http.ts -ts-client/cosmos.staking.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.staking.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.staking.v1beta1/types/google/protobuf/duration.ts -ts-client/cosmos.staking.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.staking.v1beta1/types/tendermint/crypto/keys.ts -ts-client/cosmos.staking.v1beta1/types/tendermint/crypto/proof.ts -ts-client/cosmos.staking.v1beta1/types/tendermint/types/types.ts -ts-client/cosmos.staking.v1beta1/types/tendermint/types/validator.ts -ts-client/cosmos.staking.v1beta1/types/tendermint/version/types.ts -ts-client/cosmos.tx.v1beta1/index.ts -ts-client/cosmos.tx.v1beta1/module.ts -ts-client/cosmos.tx.v1beta1/registry.ts -ts-client/cosmos.tx.v1beta1/rest.ts -ts-client/cosmos.tx.v1beta1/types.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/crypto/multisig/v1beta1/multisig.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/tx/signing/v1beta1/signing.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.ts -ts-client/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/tx.ts -ts-client/cosmos.tx.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.tx.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.tx.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.tx.v1beta1/types/google/api/http.ts -ts-client/cosmos.tx.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.tx.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.tx.v1beta1/types/google/protobuf/duration.ts -ts-client/cosmos.tx.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/abci/types.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/crypto/keys.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/crypto/proof.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/types/block.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/types/evidence.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/types/params.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/types/types.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/types/validator.ts -ts-client/cosmos.tx.v1beta1/types/tendermint/version/types.ts -ts-client/cosmos.upgrade.v1beta1/index.ts -ts-client/cosmos.upgrade.v1beta1/module.ts -ts-client/cosmos.upgrade.v1beta1/registry.ts -ts-client/cosmos.upgrade.v1beta1/rest.ts -ts-client/cosmos.upgrade.v1beta1/types.ts -ts-client/cosmos.upgrade.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/query.ts -ts-client/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/tx.ts -ts-client/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/upgrade.ts -ts-client/cosmos.upgrade.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.upgrade.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.upgrade.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.upgrade.v1beta1/types/google/api/http.ts -ts-client/cosmos.upgrade.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.upgrade.v1beta1/types/google/protobuf/descriptor.ts -ts-client/cosmos.upgrade.v1beta1/types/google/protobuf/timestamp.ts -ts-client/cosmos.vesting.v1beta1/index.ts -ts-client/cosmos.vesting.v1beta1/module.ts -ts-client/cosmos.vesting.v1beta1/registry.ts -ts-client/cosmos.vesting.v1beta1/rest.ts -ts-client/cosmos.vesting.v1beta1/types.ts -ts-client/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.ts -ts-client/cosmos.vesting.v1beta1/types/cosmos/base/v1beta1/coin.ts -ts-client/cosmos.vesting.v1beta1/types/cosmos/msg/v1/msg.ts -ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/tx.ts -ts-client/cosmos.vesting.v1beta1/types/cosmos/vesting/v1beta1/vesting.ts -ts-client/cosmos.vesting.v1beta1/types/cosmos_proto/cosmos.ts -ts-client/cosmos.vesting.v1beta1/types/gogoproto/gogo.ts -ts-client/cosmos.vesting.v1beta1/types/google/protobuf/any.ts -ts-client/cosmos.vesting.v1beta1/types/google/protobuf/descriptor.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/index.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/module.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/registry.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/rest.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/gogoproto/gogo.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/google/api/annotations.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/google/api/http.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/google/protobuf/descriptor.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/controller.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/query.ts -ts-client/ibc.applications.interchain_accounts.host.v1/index.ts -ts-client/ibc.applications.interchain_accounts.host.v1/module.ts -ts-client/ibc.applications.interchain_accounts.host.v1/registry.ts -ts-client/ibc.applications.interchain_accounts.host.v1/rest.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types/gogoproto/gogo.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types/google/api/annotations.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types/google/api/http.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types/google/protobuf/descriptor.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/host.ts -ts-client/ibc.applications.interchain_accounts.host.v1/types/ibc/applications/interchain_accounts/host/v1/query.ts -ts-client/ibc.applications.transfer.v1/index.ts -ts-client/ibc.applications.transfer.v1/module.ts -ts-client/ibc.applications.transfer.v1/registry.ts -ts-client/ibc.applications.transfer.v1/rest.ts -ts-client/ibc.applications.transfer.v1/types.ts -ts-client/ibc.applications.transfer.v1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/ibc.applications.transfer.v1/types/cosmos/base/v1beta1/coin.ts -ts-client/ibc.applications.transfer.v1/types/cosmos/upgrade/v1beta1/upgrade.ts -ts-client/ibc.applications.transfer.v1/types/cosmos_proto/cosmos.ts -ts-client/ibc.applications.transfer.v1/types/gogoproto/gogo.ts -ts-client/ibc.applications.transfer.v1/types/google/api/annotations.ts -ts-client/ibc.applications.transfer.v1/types/google/api/http.ts -ts-client/ibc.applications.transfer.v1/types/google/protobuf/any.ts -ts-client/ibc.applications.transfer.v1/types/google/protobuf/descriptor.ts -ts-client/ibc.applications.transfer.v1/types/google/protobuf/timestamp.ts -ts-client/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/genesis.ts -ts-client/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/query.ts -ts-client/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/transfer.ts -ts-client/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/tx.ts -ts-client/ibc.applications.transfer.v1/types/ibc/core/client/v1/client.ts -ts-client/ibc.core.channel.v1/index.ts -ts-client/ibc.core.channel.v1/module.ts -ts-client/ibc.core.channel.v1/registry.ts -ts-client/ibc.core.channel.v1/rest.ts -ts-client/ibc.core.channel.v1/types.ts -ts-client/ibc.core.channel.v1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/ibc.core.channel.v1/types/cosmos/upgrade/v1beta1/upgrade.ts -ts-client/ibc.core.channel.v1/types/cosmos_proto/cosmos.ts -ts-client/ibc.core.channel.v1/types/gogoproto/gogo.ts -ts-client/ibc.core.channel.v1/types/google/api/annotations.ts -ts-client/ibc.core.channel.v1/types/google/api/http.ts -ts-client/ibc.core.channel.v1/types/google/protobuf/any.ts -ts-client/ibc.core.channel.v1/types/google/protobuf/descriptor.ts -ts-client/ibc.core.channel.v1/types/google/protobuf/timestamp.ts -ts-client/ibc.core.channel.v1/types/ibc/core/channel/v1/channel.ts -ts-client/ibc.core.channel.v1/types/ibc/core/channel/v1/genesis.ts -ts-client/ibc.core.channel.v1/types/ibc/core/channel/v1/query.ts -ts-client/ibc.core.channel.v1/types/ibc/core/channel/v1/tx.ts -ts-client/ibc.core.channel.v1/types/ibc/core/client/v1/client.ts -ts-client/ibc.core.client.v1/index.ts -ts-client/ibc.core.client.v1/module.ts -ts-client/ibc.core.client.v1/registry.ts -ts-client/ibc.core.client.v1/rest.ts -ts-client/ibc.core.client.v1/types.ts -ts-client/ibc.core.client.v1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/ibc.core.client.v1/types/cosmos/upgrade/v1beta1/upgrade.ts -ts-client/ibc.core.client.v1/types/cosmos_proto/cosmos.ts -ts-client/ibc.core.client.v1/types/gogoproto/gogo.ts -ts-client/ibc.core.client.v1/types/google/api/annotations.ts -ts-client/ibc.core.client.v1/types/google/api/http.ts -ts-client/ibc.core.client.v1/types/google/protobuf/any.ts -ts-client/ibc.core.client.v1/types/google/protobuf/descriptor.ts -ts-client/ibc.core.client.v1/types/google/protobuf/timestamp.ts -ts-client/ibc.core.client.v1/types/ibc/core/client/v1/client.ts -ts-client/ibc.core.client.v1/types/ibc/core/client/v1/genesis.ts -ts-client/ibc.core.client.v1/types/ibc/core/client/v1/query.ts -ts-client/ibc.core.client.v1/types/ibc/core/client/v1/tx.ts -ts-client/ibc.core.connection.v1/index.ts -ts-client/ibc.core.connection.v1/module.ts -ts-client/ibc.core.connection.v1/registry.ts -ts-client/ibc.core.connection.v1/rest.ts -ts-client/ibc.core.connection.v1/types.ts -ts-client/ibc.core.connection.v1/types/proofs.ts -ts-client/ibc.core.connection.v1/types/cosmos/base/query/v1beta1/pagination.ts -ts-client/ibc.core.connection.v1/types/cosmos/upgrade/v1beta1/upgrade.ts -ts-client/ibc.core.connection.v1/types/cosmos_proto/cosmos.ts -ts-client/ibc.core.connection.v1/types/gogoproto/gogo.ts -ts-client/ibc.core.connection.v1/types/google/api/annotations.ts -ts-client/ibc.core.connection.v1/types/google/api/http.ts -ts-client/ibc.core.connection.v1/types/google/protobuf/any.ts -ts-client/ibc.core.connection.v1/types/google/protobuf/descriptor.ts -ts-client/ibc.core.connection.v1/types/google/protobuf/timestamp.ts -ts-client/ibc.core.connection.v1/types/ibc/core/client/v1/client.ts -ts-client/ibc.core.connection.v1/types/ibc/core/commitment/v1/commitment.ts -ts-client/ibc.core.connection.v1/types/ibc/core/connection/v1/connection.ts -ts-client/ibc.core.connection.v1/types/ibc/core/connection/v1/genesis.ts -ts-client/ibc.core.connection.v1/types/ibc/core/connection/v1/query.ts -ts-client/ibc.core.connection.v1/types/ibc/core/connection/v1/tx.ts -vue/src/store/generated/index.ts -vue/src/store/generated/package.json -vue/src/store/generated/bitcannaglobal.bcna.bcna/index.ts -.DS_Store config.yml -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bcna/bitcannaid.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bcna/genesis.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bcna/params.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bcna/query.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bcna/supplychain.ts -ts-client/bitcannaglobal.bcna.bcna/types/bcna/bcna/tx.ts -ts-client/cosmos.base.node.v1beta1/index.ts -ts-client/cosmos.base.node.v1beta1/module.ts -ts-client/cosmos.base.node.v1beta1/registry.ts -ts-client/cosmos.base.node.v1beta1/rest.ts -ts-client/cosmos.base.node.v1beta1/types.ts -ts-client/cosmos.base.node.v1beta1/types/cosmos/base/node/v1beta1/query.ts -ts-client/cosmos.base.node.v1beta1/types/google/api/annotations.ts -ts-client/cosmos.base.node.v1beta1/types/google/api/http.ts -ts-client/cosmos.base.node.v1beta1/types/google/protobuf/descriptor.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/google/protobuf/any.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/tx.ts -ts-client/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/v1/packet.ts +.DS_Store diff --git a/1.install-compile.md b/1.install-compile.md index d8b1cc6c..157de1ab 100644 --- a/1.install-compile.md +++ b/1.install-compile.md @@ -1,5 +1,5 @@ # Install / Compile last BitCanna binary -**bcnad** is a blockchain application built using Cosmos SDK v.0.45.8 and Tendermint v.0.34.21 and IBC-go v3.2.0. +**bcnad** is a blockchain application built using Cosmos SDK v.0.45.15 and Comet-BFT v.0.34.27 and IBC-go v3.4.0. In this guide you will find how to install the last binary or compile it by yourself. @@ -18,18 +18,18 @@ If we don't raise this value, nodes will crash once the network grows large enou ``` ## Option 1. Download and install the last binary By downloading the binary we avoid compiling the source code. -1. Download the latest version (v.1.4.2) from Github: +1. Download the latest version (v.1.6.3) from Github: ``` cd $HOME - wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.4.2/bcna_linux_amd64.tar.gz + wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.3/bcna_linux_amd64.tar.gz ``` 2. Check the sha256sum for the downloaded file. ``` sha256sum bcna_linux_amd64.tar.gz ``` - It must return: `903c63b9f668bf5208566955648279bdf0c15e73aab415d5ea5efc09ec1fc890` + It must return: `21e7f032244362c0eeb43d477e39ab5b1f2ae12cd5b2799468444fb32f39da5e` -3. Verify that the version is `1.4.2` +3. Verify that the version is `1.6.3` ``` rm -f ./bcnad #delete old file if exist tar zxvf bcna_linux_amd64.tar.gz @@ -47,7 +47,7 @@ By downloading the binary we avoid compiling the source code. ``` ## Option 2. Compile instructions: -### Install GoLang v1.18.x +### Install GoLang v1.19.x The official instructions can be found here: https://golang.org/doc/install @@ -57,7 +57,7 @@ The official instructions can be found here: https://golang.org/doc/install ``` 2. Download the software: ``` - curl https://dl.google.com/go/go1.18.5.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - + curl https://dl.google.com/go/go1.19.6.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - ``` 3. Update environment variables to include Go (copy everything & paste) ``` @@ -74,21 +74,21 @@ The official instructions can be found here: https://golang.org/doc/install ``` go version ``` - Should return `go version go1.18.5 linux/amd64` + Should return `go version go1.19.6 linux/amd64` ### Download source code and compile 5. Download the source code using `git` ``` git clone https://github.com/BitCannaGlobal/bcna.git cd bcna - git checkout v1.4.2 + git checkout v1.6.3 make build #it build the binary in build/ folder ``` 6. Verify the version: ``` build/bcnad version ``` - The output must be `1.4.2` + The output must be `1.6.3` 7. You now have two options: * Move the binary to the /usr/local/bin path with: diff --git a/2.2.snapshot.md b/2.2.snapshot.md index 911a1c39..2b9d3b81 100644 --- a/2.2.snapshot.md +++ b/2.2.snapshot.md @@ -2,16 +2,23 @@ This is a fast way to sync a node with `bitcanna-1` chain. A snapshot is nothing more than someone sharing a copy of his/her blockchain's data folder in a compressed file. -Our current authorized providers are (in alphabetical order): - -* **Paranormal Brothers**: -https://bc.paranorm.pro/ -* **Polkachu**: -https://polkachu.com/tendermint_snapshots/bitcanna +Our current authorized providers are: + +- https://polkachu.com/tendermint_snapshots/bitcanna +- https://bc.paranorm.pro/ +- https://github.com/obajay/StateSync-snapshots/tree/main/Bitcanna +- https://nodejumper.io/bitcanna/sync +- https://github.com/Voynitskiy/Voynitskiy/blob/main/mainnet/BitCanna/README.md#snapshot-2-times-a-day +- https://snapshot-bcna.kjinc.io/ +- https://services.kjnodes.com/mainnet/bitcanna/snapshot +- https://github.com/Michel-Leidson/Snapshots +- https://bitszn.com/snapshots.html +- https://nodiums.com/index.php/2022/11/20/bitcanna-snapshot-state-sync-and-api-rpc/ +- https://stakepool.dev.br/snapshots.html (make sure to include them in your delegations ;)!) -The fastest way to sync a peer is using State Sync and is described [here as an alternative](https://github.com/BitCannaGlobal/bcna/blob/main/2.1.statesync.md). +> The fastest way to sync a peer is using State Sync and is described [here as an alternative](https://github.com/BitCannaGlobal/bcna/blob/main/2.1.statesync.md). For this step, its necesary that you have followed [this manual](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md) previously in order to install the `bcnad` binary. @@ -20,7 +27,7 @@ For this step, its necesary that you have followed [this manual](https://github. ``` bcnad version ``` - Output should be: `.1.3.1` + Output should be: `v1.6.3` If you are using Cosmovisor, ``` @@ -29,8 +36,8 @@ For this step, its necesary that you have followed [this manual](https://github. Output should be: ``` cosmovisor run version - 11:11AM INF running app args=["version"] module=cosmovisor path=/home/raul/.bcna/cosmovisor/upgrades/ruderalis/bin/bcnad - --> .1.3.1 + 11:11AM INF running app args=["version"] module=cosmovisor path=/home/raul/.bcna/cosmovisor/upgrades/grow-vigorous-fix/bin/bcnad + --> v1.6.3 ``` 2. If you are a new user, you should **Initialize the folders:** change **_Moniker_** by your validator name (use quotes for two or more separated words *"Royal Queen Seeds"*) ``` @@ -50,7 +57,7 @@ For this step, its necesary that you have followed [this manual](https://github. 4. **Add to _config.toml_ file: server SEEDs:** ``` - sed -E -i 's/seeds = \".*\"/seeds = \"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:26656\"/' $HOME/.bcna/config/config.toml + sed -E -i 's/seeds = \".*\"/seeds = \"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,e2e7c704f766ef6b9e2c8dd61d963f8393b87966@seed3.bitcanna.io:26656\"/' $HOME/.bcna/config/config.toml ``` 5. You can **set the minimum gas prices** for transactions to be accepted into your node’s mempool. This sets a lower bound on gas prices, preventing spam. ``` diff --git a/2.3.cosmovisor.md b/2.3.cosmovisor.md index 523454e7..459631df 100644 --- a/2.3.cosmovisor.md +++ b/2.3.cosmovisor.md @@ -1,67 +1,59 @@ -# Cosmovisor setup guide for bitcanna-1 - +# Cosmovisor setup for `bitcanna-1` `Cosmovisor` is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, it stops the current binary, switch from the old binary to the new one, and finally restarts the node with the new binary. -This guide will explain how to install Cosmovisor and prepare for a future chain update. A full guide about Cosmovisor can be found [here](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor). -> NOTE: This doc is updated to run with last version v1.4.2. Specific Upgrade Guide for v1.4.2 from v.1.3.1 is [here](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md) +This guide will explain how to install Cosmovisor and prepare for a future chain update. A full guide about Cosmovisor can be found [here](https://github.com/cosmos/cosmos-sdk/tree/main/tools/cosmovisor). -## Step 1. Download Cosmovisor -You can build Cosmovisor from the source or download it from our GitHub repository. Detailed instruction to understand how it works [here](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor#cosmosvisor). +> NOTE: If you want to install Cosmovisor for sync the whole chain from the scratch (in example to build an Archive Node) you should put as persistent peer this node: `23671067d0fd40aec523290585c7d8e91034a771@65.108.43.170:26656` -### A) Download Cosmovisor +## Step 1. Install/update Cosmovisor +You can build Cosmovisor from the source or download it from the official GitHub repository. -To download Cosmovisor without having to compile it yourself, run the following command: -``` -cd ~ -wget https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.1.0/cosmovisor-v1.1.0-linux-amd64.tar.gz -``` -Check sha256 sum -``` -sha256sum cosmovisor-v1.1.0-linux-amd64.tar.gz -``` -It must return: `9a6eb658404f28a3607a3d531821ca4a6501749aa483698847155f362e66859d` +The easy way is install with Go: -Unzip the file, give it the correct permissions and move it to your machine's PATH -``` -tar -xf cosmovisor-v1.1.0-linux-amd64.tar.gz -rm cosmovisor-v1.1.0-linux-amd64.tar.gz -chmod +x cosmovisor -sudo mv cosmovisor /usr/local/bin -``` -### B) Build from source +`go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.4.0` -To compile Cosmovisor from the source, you need to have `go` installed on your system. A full guide to install `go` can be found [here](https://golangdocs.com/install-go-linux). -Try this to install Cosmovisor from the source by pulling the cosmos-sdk repository, switch to the correct version and build it: -``` -git clone https://github.com/cosmos/cosmos-sdk.git -cd cosmos-sdk -git checkout cosmovisor/v1.1.0 -make cosmovisor -``` -The previous action builds Cosmovisor in the `/cosmovisor` directory, now let's move it to the system's PATH: +## Step 2. Setup Cosmovisor +> Version v1.2 and higher includes a new command that will create the required folder structure for you, so it will avoid you some extra steps + +1) Download & init the folders with the old genesis version BitCanna `v1.2` binary. ``` -sudo mv cosmovisor/cosmovisor /usr/local/bin +cd ~ +rm -f bcnad #delete the binary if exist to avoid version mixings +wget https://github.com/BitCannaGlobal/bcna/releases/download/v1.2/bcnad +chmod +x ./bcnad +#Set the necessaries VARs to start Cosmovisor (later you can add to .profile) +export DAEMON_NAME=bcnad +export DAEMON_RESTART_AFTER_UPGRADE=true +export DAEMON_HOME=${HOME}/.bcna +export DAEMON_RESTART_DELAY=30s +export UNSAFE_SKIP_BACKUP=true +export DAEMON_LOG_BUFFER_SIZE=512 + +#add this to continue to use bcnad for commands, this is optional +PATH="${HOME}/.bcna/cosmovisor/current/bin:$PATH" + +#start the initial configuration +cosmovisor init ./bcnad ``` -You can delete the `cosmos-sdk` folder +It should show something like: ``` -cd .. && rm -rf cosmos-sdk/ +11:46AM INF checking on the genesis/bin directory module=cosmovisor +11:46AM INF creating directory (and any parents): "/Users/test/.bcna/cosmovisor/genesis/bin" module=cosmovisor +11:46AM INF checking on the genesis/bin executable module=cosmovisor +11:46AM INF copying executable into place: "/Users/test/.bcna/cosmovisor/genesis/bin/bcnad" module=cosmovisor +11:46AM INF making sure "/Users/test/.bcna/cosmovisor/genesis/bin/bcnad" is executable module=cosmovisor +11:46AM INF checking on the current symlink and creating it if needed module=cosmovisor +11:46AM INF the current symlink points to: "/Users/t/.bcna/cosmovisor/genesis/bin/bcnad" module=cosmovisor ``` -## Step 2. Setup Cosmovisor -> Version v1.2 includes a new command that will create the required folder structure for you, check [here](https://github.com/cosmos/cosmos-sdk/blob/main/cosmovisor/README.md#initialization), we will create them manually: -1) Create new directories +2) Create directories for next upgrades ``` -mkdir -p ${HOME}/.bcna/cosmovisor/genesis/bin mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/ruderalis/bin +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/strangeBuddheads/bin/ +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/trichomemonster-ica/bin/ ``` -2) Download & copy the old genesis version BitCanna `v1.2` binary to Cosmovisor's genesis folder. -``` -cd ~ -rm -f bcnad #delete the binary if exist to avoid version mixings -wget https://github.com/BitCannaGlobal/bcna/releases/download/v1.2/bcnad -cp ./bcnad ${HOME}/.bcna/cosmovisor/genesis/bin/ -``` + 3a) Download & copy the next version `v.1.3.1` to the upgrades folder. This guide shows how to download the binary. If you want to build the binary from the source, detailed instructions can be found in the [README](https://github.com/BitCannaGlobal/bcna/blob/main/README.md) of our GitHub. @@ -87,21 +79,48 @@ mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/ruderalis/bin/ ``` > If you build the binary from the code source move it to the same folder -3b) Download & copy the last version `v.1.4.2` to the upgrades folder. +3b) Download & copy the last version `v.1.4.5` to the upgrades folder. +This guide shows how to download the binary. If you want to build the binary from the source, detailed instructions can be found in the [README](https://github.com/BitCannaGlobal/bcna/blob/main/README.md) of our GitHub. + +``` +cd ~ +rm bcna_linux_amd64.tar.gz #delete old file if exist +wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.4.5/bcna_linux_amd64.tar.gz +``` +Check the sha256sum. +``` +sha256sum bcna_linux_amd64.tar.gz +``` +It must return: `a4ade068a9c3face2f6e5e052bcdd4d5f2fae52c0c9d6bb804dca565c5642180` + +Extract and verify that the version is:`1.4.5` +``` +rm -f ./bcnad #delete old file if exist +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +chmod +x bcnad +./bcnad version +``` +Move the newly built binary to the upgrades directory. +``` +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/strangeBuddheads/bin/ +``` + +3c) **Download & copy the last version `v.1.5.3` to the upgrades folder**. This guide shows how to download the binary. If you want to build the binary from the source, detailed instructions can be found in the [README](https://github.com/BitCannaGlobal/bcna/blob/main/README.md) of our GitHub. ``` cd ~ -bcna_linux_amd64.tar.gz #delete old file if exist -wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.4.2/bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz #delete old file if exist +wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.5.3/bcna_linux_amd64.tar.gz ``` Check the sha256sum. ``` sha256sum bcna_linux_amd64.tar.gz ``` -It must return: `903c63b9f668bf5208566955648279bdf0c15e73aab415d5ea5efc09ec1fc890` +It must return: `--------------------tda--------------------` -Extract and verify that the version is:`1.4.2` +Extract and verify that the version is:`1.5.3` ``` rm -f ./bcnad #delete old file if exist tar zxvf bcna_linux_amd64.tar.gz @@ -111,20 +130,21 @@ chmod +x bcnad ``` Move the newly built binary to the upgrades directory. ``` -mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads/bin/ -mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads/bin/ +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/trichomemonster-ica/bin/ ``` + + > If you build the binary from the code source move it to the same folder 4) Setup the current version link for Cosmovisor. > Very important decision now. Depending on your choice you should sync the chain using a snapshot file/service or sync from the scratch (very slow process but the only to get the whole original chain by yourself) * If you want to sync from the scratch (from block 1) you should do: ``` - ln -s -T ${HOME}/.bcna/cosmovisor/genesis ${HOME}/.bcna/cosmovisor/current + ln -sfn -T ${HOME}/.bcna/cosmovisor/genesis ${HOME}/.bcna/cosmovisor/current ``` -* If you are going to sync using **(advanced users)** a snapshot file, StateSync or other you should point to the last version (v1.4.2) +* If you are going to sync using **(advanced users)** a snapshot file, StateSync or other you should point to the last version (v1.4.5) ``` - ln -s -T ${HOME}/.bcna/cosmovisor/upgrades/strangebuddheads ${HOME}/.bcna/cosmovisor/current + ln -sfn ${HOME}/.bcna/cosmovisor/upgrades/strangeBuddheads ${HOME}/.bcna/cosmovisor/current ``` 5) To check if everything is OK, run: ``` @@ -133,7 +153,7 @@ ls .bcna/cosmovisor/ -lh The output should look like this: ``` total 8.0K -lrwxrwxrwx 1 user user 35 Jan 14 20:16 current -> /home/user/.bcna/cosmovisor/genesis +lrwxrwxrwx 1 user user 35 Jan 14 20:16 current -> /home/user/.bcna/cosmovisor/upgrades/strangeBuddheads drwxrwxr-x 3 user user 4.0K Jan 14 20:09 genesis drwxrwxr-x 4 user user 4.0K Jan 14 20:15 upgrades ``` @@ -157,7 +177,7 @@ curl -s https://raw.githubusercontent.com/BitCannaGlobal/bcna/main/genesis.json 8. Add to _config.toml_ file: server SEEDs: ``` -sed -E -i 's/seeds = \".*\"/seeds = \"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:26656\"/' $HOME/.bcna/config/config.toml +sed -E -i 's/seeds = \".*\"/seeds = \"d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656,e2e7c704f766ef6b9e2c8dd61d963f8393b87966@seed3.bitcanna.io:26656\"/' $HOME/.bcna/config/config.toml ``` 9. You can **set the minimum gas prices** for transactions to be accepted into your node’s mempool. This sets a lower bound on gas prices, preventing spam. ``` @@ -201,7 +221,7 @@ sudo systemctl enable cosmovisor.service && sudo systemctl start cosmovisor.serv 13) Check the logs to see if everything is OK. (ctrl + C to stop). ``` -sudo journalctl -uf cosmovisor +sudo journalctl -u cosmovisor -f -o cat ``` > You can speed up the syncing using a StateSync Server or a snapshot file. @@ -220,6 +240,7 @@ export DAEMON_RESTART_AFTER_UPGRADE=true export DAEMON_HOME=${HOME}/.bcna export UNSAFE_SKIP_BACKUP=true #if you want to skip automatic backup export DAEMON_LOG_BUFFER_SIZE=512 +export DAEMON_RESTART_DELAY=30s #add this to continue to use bcnad for commands, this is optional PATH="${HOME}/.bcna/cosmovisor/current/bin:$PATH" @@ -231,7 +252,7 @@ source .profile ``` 3) Now let's try Cosmovisor. -* Show Cosmovisor version: `cosmovisor run version` Will be `v.1.3.1` before the upgrade and `v1.4.2` after the upgrade +* Show Cosmovisor version: `cosmovisor run version` Will be `v.1.4.5` before the upgrade and `v1.5.3` after the upgrade ``` cosmovisor run version ``` @@ -253,3 +274,8 @@ For example: * Stop the service: `sudo service cosmovisor stop` * Restart the service: `sudo service cosmovisor restart` * Check the logs: `sudo journalctl -u cosmovisor -f` + + + + +###### tags: `cosmovisor`, `bitcanna` diff --git a/README.md b/README.md index 6dc1ee2e..f3c2dae4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,200 @@ -# BitCanna Blockchain... in the way to v0.46.x +# BitCanna Blockchain -## Done: -- NFT module -- Fix/Delete Ignite CLI -- Upgrade handler for v0.45 -> v0.46 migration -- Check refactor done in v45 branchs (v1.4.5 & main (v1.5.x) and apply to v2.0 +BitCanna provides a decentralized payment network, supply chain and trust network for the legal cannabis industry by utilizing the BCNA coin. -## Pending: -- ~~Check refactor done in v45 branchs (v1.4.5 & main (v1.5.x) and apply to v2.0~~ +> Current version (v1.6.3 Vigorous-Grow-fix) of our development uses Cosmos SDK v0.45.15 & Comet-BFT v0.34.27 & IBC-go v3.4.0 + +> Last breaking consensus upgrade info: [Update scheduled for 10th March 2023](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md) v1.6.1 + +> Last compatible update is here ([v1.6.3](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.3)) + +These docs at Github are chain related. For more information about our coin, partners and roadmap visit: +* Our website: https://www.bitcanna.io +* Our docs platform: https://docs.bitcanna.io + +## Hardware Requirements +Here are the minimal hardware configs required for running a validator/sentry node: + +* 8GB RAM +* 4vCPUs (8vCPUs is recommended) +* 200GB - 300GB SSD Disk space per year (NVMe disks are recommended) +* 400 Mbit/s bandwidth (800Mbit/s - 1Gbit/s recommended) + +## Software Requirements +* Linux server (Ubuntu 20/22 server recommended) +* Go version v1.19.5 + +> Please avoid cheap VPS providers as a main validator (we suggest using it as a cheap backup). We advise to use a shared dedicated server or a high-end NVMe VPS. + +## Genesis file +* [Link to Genesis file](https://raw.githubusercontent.com/BitCannaGlobal/bcna/main/devnets/bitcanna-dev-1/genesis.json) + +## Binary / Upgrades table + +| Upgrade Date | Upgrade Height | Binary Path | Release GitHub | Release notes | +| -------- | -------- | -------- | ------- | ------- | +| 7th Nov 2022 15.00h CET | 5.787.420 | [v1.5.3](https://github.com/BitCannaGlobal/bcna/releases/download/v1.5.3/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.5.3) | [Doc](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md#v153-codename-trichomemonster-ica---from-v145) | +| 2nd Mar 2023 16.20h CET | 7.467.420 | [v1.6.0-fix](https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-fix/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.0-fix) | [Doc](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md#v160-fix-codename-vigorous-grow---from-v153) | +| 10th Mar 2023 18.40h CET | 7.585.420 | [v1.6.1](https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.1/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.1) | [Doc](https://github.com/BitCannaGlobal/bcna/blob/main/last_upgrade.md#v161-codename-vigorous-grow-fix---from-v161) | + +Current compatible release: https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.3 + + +# How to join `bitcanna-1` chain +> Tip: At the end of this doc, you will find links with important info + +The necessary steps to join to `bitcanna-1` chain are: + +## 1. Install / Compile last binary +Check this [link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md) to find instructions to install or compile our latest release. + +## 2. Sync the chain +You can sync the chain in your server to run a validator or a simple node/peer. +**Select one method of the below:** +### 2.1. Sync using a StateSync snapshot server. +This is the recommended option for new nodes/validators. + +By downloading the StateSync script, you will sync the last blocks of the chain from two BitCanna StateSync servers. + +The script will setup your folder and config if you start a fresh install. If your node/validator exist will make a backup, syncing and restoring the backup at the end of the script. Choose the best that fits you! +* https://github.com/BitCannaGlobal/bcna/blob/main/2.1.statesync.md + +### 2.2. Sync using a snapshot file +This is an alternative way to get synced without having to download the entire chain block by block. Recommended for advanced users in Cosmos chains. +* https://github.com/BitCannaGlobal/bcna/blob/main/2.2.snapshot.md +### 2.3. Sync the whole chain using cosmovisor +Start to sync from block 1. Automate the upgrades with Cosmovisor by putting the right binaries in the appropriate folder. +* https://github.com/BitCannaGlobal/bcna/blob/main/2.3.cosmovisor.md + + + +## 3. Create a validator +Your node must be fully synced in order to send the TX of validator creation and start to validate the network. You can check if your node has fully synced by comparing your logs and the latest block in the explorer (https://explorer.bitcanna.io/) + +**You will need coins:** +Send coins to your new address, you will need roughly 2 BCNA to run the validator (1 BCNA for self-delegation and a bit more for transactions). +* https://app.osmosis.zone/ +* https://app.rango.exchange/ +* https://coindeal.com/ +* https://coinmerce.io/ + + + +1. **Set the chain-id parameter** +``` + bcnad config chain-id bitcanna-1 +``` +2. **Create a wallet**: +You may create a wallet with one or more keys (addresses) using `bcnad`; you can choose a name of your own liking (we strongly advice you use one word) +``` + bcnad keys add MyFirstAddress +``` +``` + name: MyFirstAddress + type: local + address: bcna14shzreglay98us0hep44hhhuy7dm43snv38plr + pubkey: bcnapub1addwnpepqvtpzyugupvcu773rzdcvhele6e22txy2zr235dn7uf8t2mlqcarcyx2gg9 + mnemonic: "" + threshold: 0 + pubkeys: [] + + deposit daring slim glide hello dolphin expire stoner cluster vivid orphan work pond section client friend yellow west hamster torch settle island opinion gloom +``` +> It is very important to write this mnemonic phrase in a safe place. +It is the only way to recover your account if you ever forget/lose your password. +``` + deposit daring slim glide hello dolphin expire stoner cluster vivid orphan work pond section client friend yellow west hamster torch settle island opinion gloom +``` + +3. **Send the _Create validator_ TX:** + +> We recommend you read the [FAQ Chain's guide](https://github.com/BitCannaGlobal/bcna/blob/main/faq_chain.md) to understand all parameters - be aware that some values are permanent and cannot be changed at a later date. + +When you have your node synced and your wallet funded with coins, send the TX to become _validator_ (change _wallet_name_ and _moniker_): +> You can use quotes to include spaces and more than two words +`--from "Royal Queen Seeds"` + +``` +bcnad tx staking create-validator \ + --amount 1000000ubcna \ + --commission-max-change-rate 0.10 \ + --commission-max-rate 0.2 \ + --commission-rate 0.1 \ + --from WALLET_NAME \ + --min-self-delegation 1 \ + --moniker YOUR_MONIKER \ + --pubkey $(bcnad tendermint show-validator) \ + --chain-id bitcanna-1 \ + --gas auto \ + --gas-adjustment 1.5 \ + --gas-prices 0.001ubcna +``` + +You can check the list of validators (also in [Explorer](https://explorer.bitcanna.io/validators)): + +``` +bcnad query staking validators --output json| jq +``` + +## 4. Backup the keys and config +Making a backup of the Validator private keys and node keys is very important. Store them encrypted also. +1. Backup your Validator_priv_key: + +``` +tar -czvf validator_key.tar.gz .bcna/config/*_key.json +gpg -o validator_key.tar.gz.gpg -ca validator_key.tar.gz +rm validator_key.tar.gz +``` +This will create a GPG encrypted file with both key files. +You can download the `validator_key.tar.gz.gpg` file to your computer. + +2. Export the wallet key (if you have backup the seeds keys is enough) +``` +bcnad keys export MyFisrstAddress +``` +``` +Enter passphrase to encrypt the exported key: passwordForCryptThisKey +Enter keyring passphrase: TheWalletPassword +-----BEGIN TENDERMINT PRIVATE KEY----- +salt: BEC519DA3C1A3BDFC74D799FE983CA6C +type: secp256k1 +kdf: bcrypt + +tfguD11614drcOrdnmujAm+c+FbPbAFkYbsHv/qbQ8O9nQjdQCPuXTOZsYLkYopK +FYgEgITfk980jjUfDTE25BPfJR22csjJM/qzx0Y= +=vchm +-----END TENDERMINT PRIVATE KEY----- +``` +You can copy&paste the entire text above in a text file. + +# Links to important info + +## Explorers: +* [BitCanna based on Forbole](https://explorer.bitcanna.io) +* [MintScan based on Cosmostation](https://www.mintscan.io/bitcanna) +* [Ping-Pub explorer](https://ping.pub/bitcanna/uptime) +* [Old chain explorer](https://old-explorer.bitcanna.io) +* [ATOMScan explorer](https://atomscan.com/bitcanna) + +## Wallets +* [BitCanna web wallet](https://wallet.bitcanna.io) +* [Ping-Pub web wallet](https://ping.pub/wallet/accounts) +* [Cosmostation iOS](https://apps.apple.com/kr/app/cosmostation/id1459830339) +* [Cosmostation Android](https://play.google.com/store/apps/details?id=wannabit.io.cosmostaion) + +## Genesis file +* [bitcanna-1](https://raw.githubusercontent.com/BitCannaGlobal/bcna/main/genesis.json) + +## Peer, seeds and public service providers +* [BitCanna service providers](https://github.com/BitCannaGlobal/bcna/blob/main/peers_seeds_and_services.md) +* [Cosmos Chain Registry](https://github.com/cosmos/chain-registry/tree/master/bitcanna) + +## Archived Guides, FAQs & docs +* [BitCanna Docs](https://docs.bitcanna.io) +* [GitHub Testnet & DevNet archive](https://github.com/BitCannaGlobal/testnet-bcna-cosmos/tree/main/instructions) +* [Current DevNet](https://github.com/BitCannaGlobal/testnet-bcna-cosmos/tree/main/instructions/bitcanna-dev-4) +* [Old Instructions guide](https://github.com/BitCannaGlobal/bcna/blob/main/archived_guides/instructions.md) +* [How to perform a manual upgrade](https://github.com/BitCannaGlobal/bcna/blob/main/archived_guides/manual_update.md) +* [How to perform an upgrade with Cosmovisor (v.1.1)](https://github.com/BitCannaGlobal/bcna/blob/main/archived_guides/cosmovisor_config.md) + +###### tags: `doc` `github` diff --git a/app/ante.go b/app/ante.go index 527b511b..52621ac2 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,10 +1,12 @@ package app import ( + "errors" + "fmt" + decorators "github.com/BitCannaGlobal/bcna/app/decorators" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" ) @@ -23,16 +25,16 @@ type HandlerOptions struct { // signer. func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { if options.AccountKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder") + return nil, fmt.Errorf("%w: account keeper is required for ante builder", errors.New("logic error")) } if options.BankKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder") + return nil, fmt.Errorf("%w: bank keeper is required for ante builder", errors.New("logic error")) } if options.SignModeHandler == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") + return nil, fmt.Errorf("%w:sign mode handler is required for ante builder", errors.New("logic error")) } if options.GovKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "gov keeper is required for AnteHandler") + return nil, fmt.Errorf("%w:gov keeper is required for AnteHandler", errors.New("logic error")) } sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { diff --git a/app/decorators/gov_filter.go b/app/decorators/gov_filter.go index 397a6d26..c7d11126 100644 --- a/app/decorators/gov_filter.go +++ b/app/decorators/gov_filter.go @@ -1,9 +1,11 @@ package decorators import ( + "errors" + "fmt" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -55,13 +57,12 @@ func (gpsd GovPreventSpamDecorator) checkSpamSubmitProposalMsg(ctx sdk.Context, // // prevent spam gov msg if msg.InitialDeposit.IsAllLT(miniumInitialDeposit) { - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "not enough initial deposit. required: %v", miniumInitialDeposit) + return fmt.Errorf("not enough initial deposit. required: %v: %w", miniumInitialDeposit, errors.New("insufficient funds")) } case *govv1.MsgSubmitProposal: // don't use Gov v1 Proposals: message := "- Please don't use Gov v1 Proposals in SDK v0.46! " - - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "Failed to send a new proposal: %s", message) + return fmt.Errorf("Failed to send a new proposal: %v: %w", message, errors.New("Not allowed")) } return nil @@ -74,7 +75,7 @@ func (gpsd GovPreventSpamDecorator) checkSpamSubmitProposalMsg(ctx sdk.Context, var innerMsg sdk.Msg err := gpsd.cdc.UnpackAny(v, &innerMsg) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "not enough initial deposit. required: %v", miniumInitialDeposit) + return fmt.Errorf("not enough initial deposit. required: %v: %w", miniumInitialDeposit, errors.New("insufficient funds")) } err = validMsg(innerMsg) diff --git a/devnets/README.md b/devnets/README.md new file mode 100644 index 00000000..b8305abb --- /dev/null +++ b/devnets/README.md @@ -0,0 +1 @@ +Active DevNets diff --git a/devnets/bitcanna-dev-1/README.md b/devnets/bitcanna-dev-1/README.md new file mode 100644 index 00000000..2caed2df --- /dev/null +++ b/devnets/bitcanna-dev-1/README.md @@ -0,0 +1,178 @@ +# Devnet-1: Setup up your validator and join *bitcanna-dev-1* + +## Target of this DevNet. +We created a new testnet that follows the exact upgrade cycle as the current Mainnet. Our target is to test new features here before apply them at MainNet. + +### We are going to work in three new testnets: +* `bitcanna-dev-1` +* `innuendo-5` (with `quicksilverd` current version binary) YOU DON'T NEED TO RUN THIS CHAIN. +* `axelar-testnet-lisbon-3` (with `axelard` current version binary) YOU DON'T NEED TO RUN THIS CHAIN. + +## P2P Network INFO +In the next section you will find the params for P2P and a *step by step* guide with a StateSync script ([Step by step guide](#running-a-validator-on-bitcanna-dev-5)) + +#### Seed server +* `471341f9befeab582e845d5e9987b7a4889c202f@144.91.89.66:26656` + +#### Persistent peers +* `80ee9ed689bfb329cf21b94aa12978e073226db4@212.227.151.143:26656` +* `ba6c17d707cb0c4f81e0ef590f2e36152ff7dd1a@212.227.151.106:26656` + + +#### Genesis file +* [Link to Genesis file](https://raw.githubusercontent.com/BitCannaGlobal/bcna/main/devnets/bitcanna-dev-1/genesis.json) + +#### Binary / Upgrades table + +| Upgrade Date | Upgrade Height | Binary Path | Release GitHub | Release doc | +| -------- | -------- | -------- | ------- | ------- | +| 22nd Dec 2022 | 0 | [v1.5.3](https://github.com/BitCannaGlobal/bcna/releases/download/v1.5.3/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.5.3) | x | +| 22nd Feb 2023 15h UTC | 956.837 | [v1.6.0-rc2](https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-rc2/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.0-rc2) | [Doc](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc2.md) | +| 24nd Feb 2023 15h UTC | 987.757 | [v1.6.0-rc3](https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-rc3/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.0-rc3) | [Doc](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc3.md) | +| 7th Mar 2023 15h UTC | 1.159.488 | [v1.6.1](https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.1/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.1) | [Doc](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/upgrade_v1.6.1.md) | +| No break consensus | x | [v1.6.2](https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.2/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.2) | x | +| No break consensus | x | v1.6.3-rc1 | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.3-rc1/bcna_linux_amd64.tar.gz) | x | +| 19th Apr 2023 14h UTC | 1.831.901 | v2.0.1-rc6 | [Link](https://github.com/BitCannaGlobal/bcna/releases/download/v2.0.1-rc6/bcna_linux_amd64.tar.gz) | [Link](https://github.com/BitCannaGlobal/bcna/releases/tag/v2.0.1-rc6) | + +#### More DEVNET-1 resources +* [Link to AWESOME doc](awesome.md) +* [Link to manual set-up by Aviaone Validator](awesome.md#Manual-setup) +* [Link to setup and other tools by KonsorTech](https://github.com/konsortech/Node/tree/main/Testnet/Bitcanna) +* [Link to setup Cosmovisor for DEVNET-1](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/cosmovisor_install.md) + +## Running a validator on **bitcanna-dev-1** using StateSync +* Before you start, you want to ensure your system is updated. Besides other utilities you can install `jq` which is a utility to read and navigate JSON files and output. Also remove the `.bcna` folder, take in consideration first NOTES in this doc. + ``` + sudo apt update && sudo apt upgrade -y + sudo apt install -y build-essential curl wget jq + ``` +* Increase the default open files limit. If we don't raise this value nodes will crash once the network grows large enough. + ``` + sudo su -c "echo 'fs.file-max = 65536' >> /etc/sysctl.conf" + sudo sysctl -p + ``` +## Step 1 - Download and run statesync script +By running the statesync script we download the latest binary (v1.5.3) and sync the chain to the latest block. +1. **Download the statesync script** for new peers from Github: + ``` + cd ~ + wget https://raw.githubusercontent.com/BitCannaGlobal/cosmos-statesync_client/main/statesync_DEVNET-1_client_linux_new.sh + ``` +2. **Run the script**: + ``` + bash statesync_DEVNET-1_client_linux_new.sh + ``` + Watch the output of the logs. When the chain is synced (wait 1 minute), press ctrl+C to stop the script and proceed with the next step. + + This is an example of the output you see when you can stop the script by pressing ctrl+C + ``` + 4:39PM INF indexed block height=2920 module=txindex + 4:39PM INF Timed out dur=4988.140195 height=2921 module=consensus round=0 step=1 + 4:39PM INF commit is for a block we do not know about; set ProposalBlock=nil commit=3E75B8B4371324172A860BBBB4BE8B5C2A2C96A7FA5F5507BB8457D0B40F00D2 commit_round=0 height=2921 module=consensus proposal={} + 4:39PM INF received complete proposal block hash=3E75B8B4371324172A860BBBB4BE8B5C2A2C96A7FA5F5507BB8457D0B40F00D2 height=2921 module=consensus + 4:39PM INF finalizing commit of block hash={} height=2921 module=consensus num_txs=0 root=E8705846BEAAA45BC87474D9ACBFBA074447ED8A680FAB5AD53516E7E0B2C7C7 + 4:39PM INF minted coins from module account amount=4836690ubcna from=mint module=x/bank + 4:39PM INF executed block height=2921 module=state num_invalid_txs=0 num_valid_txs=0 + 4:39PM INF commit synced commit=436F6D6D697449447B5B36352037332032303120393220313733203133203537203930203138352036342035382031323520323230203133392031313620313730203336203932203535203131382031303920363520323037203138382037312031333520313236203234352031343820353520313837203235305D3A4236397D + 4:39PM INF committed state app_hash=4149C95CAD0D395AB9403A7DDC8B74AA245C37766D41CFBC47877EF59437BBFA height=2921 module=state num_txs=0 + 4:39PM INF indexed block height=2921 module=txindex + ``` + +3. **Move the new `bcnad` binary** to your machine's PATH. + ``` + sudo mv bcnad /usr/local/bin/ + ``` + **Optionally:** + ``` + bcnad config chain-id bitcanna-dev-1 + ``` +## Step 2 - Prepare the node +To create a validator you need a funded wallet. Once the wallet is created, go to the **#devnet-faucet** channel on [Discord](https://discord.com/channels/805725188355260436/847019574662922260) and claim your devnet coins. For example: `!claim bcna14shzreglay98us0hep44hhhuy7dm43snv38plr` + +1. **Create a wallet:** +You can create a wallet with one or more keys (addresses) using `bcnad`. Replace **"MyFirstAddress"** with your desired name. + ``` + bcnad keys add MyFirstAddress + + name: MyFirstAddress + type: local + address: bcna14shzreglay98us0hep44hhhuy7dm43snv38plr + pubkey: bcnapub1addwnpepqvtpzyugupvcu773rzdcvhele6e22txy2zr235dn7uf8t2mlqcarcyx2gg9 + mnemonic: "" + threshold: 0 + pubkeys: [] + + + Important write this mnemonic phrase in a safe place. + It is the only way to recover your account if you ever forget your password. + + deposit daring slim glide spend dolphin expire shadow cluster weed orphan work 420 section client friend yellow west hamster torch settle island opinion gloom + ``` + Your address will look something similar like this: `bcna14shzreglay98us0hep44hhhuy7dm43snv38plr` + +2. **Service creation** +With all configurations ready you can set up `systemd` to run the node daemon with auto-restart. +Setup `bcnad` systemd service (copy and paste all to create the file service): + ``` + cd $HOME + echo "[Unit] + Description=BitCanna Node + After=network-online.target + [Service] + User=${USER} + ExecStart=$(which bcnad) start + Restart=always + RestartSec=3 + LimitNOFILE=4096 + [Install] + WantedBy=multi-user.target + " >bcnad.service + ``` + Enable and activate the BCNAD service. + + ``` + sudo mv bcnad.service /lib/systemd/system/ + sudo systemctl enable bcnad.service && sudo systemctl start bcnad.service + ``` + + Check the logs to see if everything is working correct: + ``` + sudo journalctl -fu bcnad + ``` + +## Step 3 - Create the validator +When your node is synced and your wallet funded it's time to send the TX to become validator: +(change **_WALLET_NAME_** and **_MONIKER_**) +> You can use quotes to include spaces and more than two words +`--from "Royal Queen Seeds"` + +``` +bcnad tx staking create-validator \ + --amount 1000000ubcna \ + --commission-max-change-rate 0.10 \ + --commission-max-rate 0.2 \ + --commission-rate 0.1 \ + --from WALLET_NAME \ + --min-self-delegation 1 \ + --moniker MONIKER \ + --pubkey $(bcnad tendermint show-validator) \ + --chain-id bitcanna-dev-1 \ + --gas auto \ + --gas-adjustment 1.5 \ + --gas-prices 0.001ubcna +``` + +You can check the list of validators (also in [Explorer](https://testnet.ping.pub/bitcanna/staking)): + + ``` + bcnad query staking validators --output json| jq + ``` + +Another **IMPORTANT** but **optional** action is backup your Validator_priv_key: + + ``` + tar -czvf validator_key.tar.gz .bcna/config/*_key.json + gpg -o validator_key.tar.gz.gpg -ca validator_key.tar.gz + rm validator_key.tar.gz + ``` + This will create a GPG encrypted file with both key files. diff --git a/devnets/bitcanna-dev-1/awesome.md b/devnets/bitcanna-dev-1/awesome.md new file mode 100644 index 00000000..fd0c70b5 --- /dev/null +++ b/devnets/bitcanna-dev-1/awesome.md @@ -0,0 +1,207 @@ +# bitcanna-dev-1 peers and services + +## Persistent Peers +- 80ee9ed689bfb329cf21b94aa12978e073226db4@212.227.151.143:26656 +- 20ca909b49106aacbf516ba28fa8a2409f825a82@212.227.151.106:26656 + +## Seed Peer +This will disconnect after passing P2P info so not include in your _persistent_peers_ +- 471341f9befeab582e845d5e9987b7a4889c202f@144.91.89.66:26656 +- 3f472746f46493309650e5a033076689996c8881@bitcanna-testnet.rpc.kjnodes.com:42659 + +## Explorers +- https://testnets-cosmos.mintthemoon.xyz/bitcanna/staking +- https://testnet.ping.pub/bitcanna/uptime +- https://explorer.stavr.tech/bitcanna-dev/staking +- https://explorer.kjnodes.com/bitcanna-testnet + +## RPC endpoints +- https://rpc-testnet.bitcanna.io +- https://rpc.bitcanna-dev-1.bitcanna.aviaone.com/ (TX index = off) +- https://testnet-bitcanna-rpc.konsortech.xyz/ +- https://bitcanna-testnet.rpc.kjnodes.com + +## GRPC endpoints +- bitcanna-testnet.grpc.kjnodes.com:42090 + +## LCD Enpoints +- http://lcd-testnet.bitcanna.io +- https://api.bitcanna-dev-1.bitcanna.aviaone.com/ +- https://testnet-bitcanna-api.konsortech.xyz/ +- https://bitcanna-testnet.api.kjnodes.com + +## Wallets / Dashboard +- https://wallet-testnet.bitcanna.io +- https://aviaone.com/keplr-bitcanna-dev-1/ +- http://212.227.151.143:1338/ +- http://212.227.151.143:1337/ + +## State sync +- https://services.kjnodes.com/testnet/bitcanna/state-sync + +## Snapshots +- https://services.kjnodes.com/testnet/bitcanna/snapshot + +## Docs +- [Automatic StateSync Join `bitcanna-dev-1`](README.md) +- [Manually Join `bitcanna-dev-1` by Avione Validator](awesome.md#Manual-setup) +- [Upgrades - Last Upgrade](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc2.md) +- [Setup Cosmovisor from zero](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/cosmovisor_install.md) +- [Node installation instructions by kjnodes](https://services.kjnodes.com/testnet/bitcanna/installation) +- [Node upgrade instructions by kjnodes](https://services.kjnodes.com/testnet/bitcanna/upgrade) +- [Useful commands for node and wallet operation by kjnodes](https://services.kjnodes.com/testnet/bitcanna/useful-commands) + +### Manual-setup +> This instructions was written by Avione Validators, thanks a lot! + +> Please remove `.bcna` folder and bcnad binary if you have participated in previous devnets +``` +############################################################################# +############ +############ BITCANNA --chain bitcanna-dev-1 +############ +############################################################################# + +=================================================== +# Update if needed +sudo apt update && sudo apt upgrade -y + +=================================================== +# Install packages +sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu unzip -y + +=================================================== +# Install GOLANG version 1.19.4 +cd $HOME +ver="1.19.4" +wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" +sudo rm -rf /usr/local/go +sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" +rm "go$ver.linux-amd64.tar.gz" +echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile +source $HOME/.bash_profile +go version + +=================================================== +# Install App and build +cd $HOME +git clone https://github.com/BitCannaGlobal/bcna.git +cd bcna +git checkout v1.5.3 +make install + +#check version and install binary ok or not ? +bcnad version --long + +=================================================== +# Common -> set variables (Chain | Moniker | Wallet_name) +BCNA_CHAIN="bitcanna-dev-1" +BCNA_MONIKER="YOUR_MONIKER" +BCNA_WALLET="Wallet_Testnet_Bitcanna" + +echo 'export BCNA_CHAIN='${BCNA_CHAIN} >> $HOME/.bash_profile +echo 'export BCNA_MONIKER='${BCNA_MONIKER} >> $HOME/.bash_profile +echo 'export BCNA_WALLET='${BCNA_WALLET} >> $HOME/.bash_profile +source $HOME/.bash_profile + +=================================================== +#add seed +seeds="471341f9befeab582e845d5e9987b7a4889c202f@144.91.89.66:26656" +sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.bcna/config/config.toml + +#avoid error and set gas prices +sed -E -i 's/minimum-gas-prices = \".*\"/minimum-gas-prices = \"0.001ubcna\"/' $HOME/.bcna/config/app.toml + +#download genesis +cd $HOME +wget -O $HOME/.bcna/config/genesis.json "https://raw.githubusercontent.com/bitcannaglobal/bcna/main/devnets/bitcanna-dev-1/genesis.json" + +=================================================== +# Clean all before to start the chain +bcnad tendermint unsafe-reset-all --home $HOME/.bcna + +=================================================== +# create service +sudo tee /etc/systemd/system/bcnad.service > /dev/null < Version v1.2 of Cosmovisor and higher now include a new command that will automatically create the required folder structure, reducing the number of steps required to complete the task. + +### 1.) Download the genesis binary of BitCanna devnet-1. + +For Cosmovisor to initiate the required folders automatically, the genesis version of the `bcnad` binary needs to be present in your home directory. + +Download `bcnad` version `v1.5.3`. +``` +cd ~ +rm -f bcnad #deletes previously downloaded binary if it exists to avoid version mixing +wget https://github.com/BitCannaGlobal/bcna/releases/download/v1.5.3/bcna_linux_amd64.tar.gz +``` +Check the sha256sum. +``` +sha256sum bcna_linux_amd64.tar.gz +``` +> It must return: `8a43bdbea31c299db2ca849f232189374286c2168264072358d48c2a6f6aa2da` + +Verify that you have the correct version. +``` +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +./bcnad version +``` +> It must return: `v1.5.3` + +### 2.) Initiate the Cosmovisor folders. + +Edit your `.profile` file to add the required environment variables for Cosmovisor to start. +``` +cd ~ +nano .profile +``` +Add these lines to the bottom of the file: +``` +export DAEMON_NAME=bcnad +export DAEMON_RESTART_AFTER_UPGRADE=true +export DAEMON_HOME=${HOME}/.bcna +export DAEMON_RESTART_DELAY=30s +export UNSAFE_SKIP_BACKUP=true +export DAEMON_LOG_BUFFER_SIZE=512 + +#add this to continue to use bcnad for commands, this is optional +PATH="${HOME}/.bcna/cosmovisor/current/bin:$PATH" +``` +Reload the configuration of your `.profile` file. +``` +source .profile +``` +Start the initial Cosmovisor configuration. +``` +cosmovisor init ./bcnad +``` +The output should contain lines similar to these: +``` +11:46AM INF checking on the genesis/bin directory module=cosmovisor +11:46AM INF creating directory (and any parents): "/Users/test/.bcna/cosmovisor/genesis/bin" module=cosmovisor +11:46AM INF checking on the genesis/bin executable module=cosmovisor +11:46AM INF copying executable into place: "/Users/test/.bcna/cosmovisor/genesis/bin/bcnad" module=cosmovisor +11:46AM INF making sure "/Users/test/.bcna/cosmovisor/genesis/bin/bcnad" is executable module=cosmovisor +11:46AM INF checking on the current symlink and creating it if needed module=cosmovisor +11:46AM INF the current symlink points to: "/Users/t/.bcna/cosmovisor/genesis/bin/bcnad" module=cosmovisor +``` +### 3.) Create designated directories for the current version and next upgrade. + +``` +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow/bin +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow-rc3/bin +``` +### 4.) Download the current and updated `bcnad` binaries and move it to the designated directory. + +This guide explains how to download the pre-compiled binary. If you want to build the binary from the source, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions) + +### 4.1) Download the current `bcnad` version `v1.6.0-rc2`. +> Alternatively, you could also copy your currently running version from the bin directory. +``` +cd ~ +rm -f bcnad #remove the previous downloads +wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-rc2/bcna_linux_amd64.tar.gz +``` +Check the sha256sum. +``` +sha256sum ./bcnad +``` +> It must return: `1df53fc3e0f7d7d5ee0e6e5368634ebc5994f5f43ac05118aad65502bf26e723` + +Verify that you have the correct version. +``` +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +./bcnad version +``` +> It must return: **`v1.6.0-rc2`** + +Move the newly built binary to the designated upgrade directory. +> If you build the binary from the source, move it to the same folder. +``` +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow/bin +``` +### 4.2) Download the upgrade `bcnad` version `v1.6.0-rc3`. +``` +cd ~ +rm -f bcnad #remove the previous downloads +wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-rc3/bcna_linux_amd64.tar.gz +``` +Check the sha256sum. +``` +sha256sum ./bcnad +``` +> It must return: `4ab89e9df3c340acc42b01d52167a676a6daa6749b70e3f0eee8f65808af8bc0` + +Verify that you have the correct version. +``` +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +./bcnad version +``` +> It must return: **`v1.6.0-rc3`** + +Move the newly built binary to the designated upgrade directory. +> If you build the binary from the source, move it to the same folder. +``` +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow-rc3/bin +``` +### 5.) Setup Cosmovisor's current version link. + +Next step is to let Cosmovisor know in which directory the current version of `bcnad` software is located. + +This command creates a symbolic link, pointing `current` to the currently active directory. +``` +ln -sfn ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow ${HOME}/.bcna/cosmovisor/current +``` +### 6.) To see if everything is OK, run: + +``` +ls .bcna/cosmovisor/ -lh +``` +The output should look like this: +``` +total 8.0K +lrwxrwxrwx 1 user user 35 Feb 23 20:16 current -> /home/user/.bcna/cosmovisor/upgrades/vigorous-grow +drwxrwxr-x 3 user user 4.0K Feb 23 20:09 genesis +drwxrwxr-x 4 user user 4.0K Feb 23 20:15 upgrades +``` +## Step 3. Finish the installation and start Cosmovisor + +### 1.) Create a systemd servicefile for Cosmovisor. + +Simply copy and paste everything to create the service unit. +> Optionally enable backup, set the folder location, and name the folder. +``` +echo "[Unit] +Description=Cosmovisor BitCanna Service +After=network-online.target +[Service] +User=${USER} +Environment=DAEMON_NAME=bcnad +Environment=DAEMON_RESTART_AFTER_UPGRADE=true +Environment=DAEMON_HOME=${HOME}/.bcna +Environment=UNSAFE_SKIP_BACKUP=true +Environment=DAEMON_RESTART_DELAY=30s +Environment=DAEMON_LOG_BUFFER_SIZE=512 +#Optional export DAEMON_DATA_BACKUP_DIR=${HOME}/your_chain_backup_folder +ExecStart=$(which cosmovisor) run start +Restart=always +RestartSec=3 +LimitNOFILE=4096 +[Install] +WantedBy=multi-user.target +" >cosmovisor.service +``` +### 2.) Change `bcnad` service for `cosmovisor` service. +> You can skip the 3rd line if you're doing a clean installation and the `bcnad`service doesn't exist. +``` +sudo mv cosmovisor.service /lib/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl stop bcnad.service && sudo systemctl disable bcnad.service +sudo systemctl enable cosmovisor.service && sudo systemctl start cosmovisor.service +``` +### 3.) Check the logs.** (ctrl + C to stop). +``` +sudo journalctl -fu cosmovisor -o cat +``` +> You can speed up the synchronization using a StateSync Server or a snapshot file. + +### 4.) Now let's try Cosmovisor. +If everything is OK, Cosmovisor will take control of the binaries. +Instead of `bcnad` you must use `cosmosvisor run` in your service related commands. + +Show Cosmovisor's version. +``` +cosmovisor run version +``` +This will be **`v1.6.0-rc2` before** the upgrade and **`v1.6.0-rc3` after** the upgrade. + +The output should look like this: + ``` +20:27PM INF running app args=["version"] module=cosmovisor path=/home/user/.bcna/cosmovisor/upgrades/vigorous-grow +1.6.0-rc2 +``` +* Show BitCanna version: `bcnad version` Must show the same version as above +* Show Cosmovisor sync info and status: `cosmovisor run status` + +## Reminder +In the future, you must use the `cosmovisor` command instead of the `bcnad` command if you want to perform **service related** commands. + +For example: +* Start the service: `sudo service cosmovisor start` +* Stop the service: `sudo service cosmovisor stop` +* Restart the service: `sudo service cosmovisor restart` +* Check the logs: `sudo journalctl -u cosmovisor -f` diff --git a/devnets/bitcanna-dev-1/genesis.json b/devnets/bitcanna-dev-1/genesis.json new file mode 100644 index 00000000..3c367399 --- /dev/null +++ b/devnets/bitcanna-dev-1/genesis.json @@ -0,0 +1,316 @@ +{ + "genesis_time": "2022-12-22T14:55:55.413521948Z", + "chain_id": "bitcanna-dev-1", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "-1", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": {} + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "address": "bcna153hxvnx24h07aptul43fsuyeq7kgt2erequ6us", + "pub_key": null, + "account_number": "0", + "sequence": "0" + }, + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "address": "bcna1csyzlg52g2kd8e0xd6f6elckydhr93ukc3wmqt", + "pub_key": null, + "account_number": "0", + "sequence": "0" + } + ] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [ + { + "address": "bcna153hxvnx24h07aptul43fsuyeq7kgt2erequ6us", + "coins": [ + { + "denom": "ubcna", + "amount": "100000000000" + } + ] + }, + { + "address": "bcna1csyzlg52g2kd8e0xd6f6elckydhr93ukc3wmqt", + "coins": [ + { + "denom": "ubcna", + "amount": "232700000000000" + } + ] + } + ], + "supply": [], + "denom_metadata": [] + }, + "bcna": { + "params": {}, + "bitcannaidList": [], + "bitcannaidCount": "0", + "supplychainList": [], + "supplychainCount": "0" + }, + "capability": { + "index": "1", + "owners": [] + }, + "crisis": { + "constant_fee": { + "denom": "ubcna", + "amount": "1000" + } + }, + "distribution": { + "params": { + "community_tax": "0.020000000000000000", + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "evidence": { + "evidence": [] + }, + "feegrant": { + "allowances": [] + }, + "genutil": { + "gen_txs": [ + { + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "Pandora", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "0.200000000000000000", + "max_change_rate": "0.010000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "bcna153hxvnx24h07aptul43fsuyeq7kgt2erequ6us", + "validator_address": "bcnavaloper153hxvnx24h07aptul43fsuyeq7kgt2erqad6xy", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "5ogvh4kvr1C4DgAgB9iEYrimJiqAukZGgWBVOpQRHpc=" + }, + "value": { + "denom": "ubcna", + "amount": "100000000000" + } + } + ], + "memo": "471341f9befeab582e845d5e9987b7a4889c202f@144.91.89.66:26656", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AvzA+AbNIRTVDqKrNFsMYTMK9p0vaNLNu/79XCP93MyK" + }, + "mode_info": { + "single": { + "mode": "SIGN_MODE_DIRECT" + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [], + "gas_limit": "200000", + "payer": "", + "granter": "" + } + }, + "signatures": [ + "+V/+MkzqwiL2xluCrcgGHJ9jzWQkJj8yk4E7POtKhgxQwIlwHNfnLJ3/YOcm9TVj87ujcNit1D+TJap+1SdVBg==" + ] + } + ] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "ubcna", + "amount": "10000000" + } + ], + "max_deposit_period": "172800s" + }, + "voting_params": { + "voting_period": "10800s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "30000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "interchainaccounts": { + "controller_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "ports": [], + "params": { + "controller_enabled": true + } + }, + "host_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "port": "icahost", + "params": { + "host_enabled": true, + "allow_messages": [] + } + } + }, + "mint": { + "minter": { + "inflation": "0.130000000000000000", + "annual_provisions": "0.000000000000000000" + }, + "params": { + "mint_denom": "ubcna", + "inflation_rate_change": "0.130000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "goal_bonded": "0.670000000000000000", + "blocks_per_year": "6311520" + } + }, + "params": null, + "slashing": { + "params": { + "signed_blocks_window": "100", + "min_signed_per_window": "0.500000000000000000", + "downtime_jail_duration": "600s", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": [], + "missed_blocks": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "ubcna" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "upgrade": {}, + "vesting": {} + } +} diff --git a/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc2.md b/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc2.md new file mode 100644 index 00000000..f9adfc21 --- /dev/null +++ b/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc2.md @@ -0,0 +1,107 @@ +# Node operator instructions for "Vigorous-Grow"`v1.6.0-rc2` upgrade on `bitcanna-dev-1` +In this guide, you will find all the instructions required to upgrade a BitCanna node and help us test the latest software version on the DEVNET-1. + +We provide detailed instructions for **manual and automated upgrades**, as well as links to instructions for installing Cosmovisor or building the binaries from the source code. + +If you have any questions or find anything unclear when reading through this guide, don't hesitate to reach out to us on Discord. Also, if you have any suggestions for improvement, we welcome you to make a pull request! + +Let's get started! + +### Governance proposal + +The upgrade is scheduled to take place on **February 22nd around 16:00h CET / 15:00h UTC** +* **Halt-height 956.837** + +https://testnet.ping.pub/bitcanna/gov/2 + +## Download the new binary +1) Download the new binary or [compile it from the source code](#Build-the-binary-from-the-source-code) +``` +cd ~ +rm -f ./bcnad && rm -f ./bcna_linux_amd64.tar.gz #clean the previous downloads +wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-rc2/bcna_linux_amd64.tar.gz +``` +2) Check the sha256sum. +``` +sha256sum bcna_linux_amd64.tar.gz +``` +> It must return: `1df53fc3e0f7d7d5ee0e6e5368634ebc5994f5f43ac05118aad65502bf26e723` + +3) Verify that the version is `v1.6.0-rc2` +``` +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +./bcnad version +``` + +## Option 1. Manual (attended) upgrade. + +This section of the guide shows how to perform a **manual** update of the binaries after a governance proposal has been approved for a chain upgrade. + +Watch your logs when we aproach the halt-height and open an extra terminal to execute the commands. +``` +sudo journalctl -fu bcnad -o cat +``` +1) Stop the bcnad service **after you see** `ERR UPGRADE "vigorous-grow" NEEDED at height: 956.837` in your logs. +``` +sudo service bcnad stop +``` +2) Move the new binary to your machine's PATH and overwrite the previous version. +``` +sudo mv bcnad $(which bcnad) #copy&paste don't replace anything +``` +> If you know the exact destination you could also run: +``` +sudo mv bcnad /usr/local/bin/ #or wherever you have it +``` +3) Start the bcnad service. +``` +sudo service bcnad start +``` + +If you are familiar with the Cosmos environment, you can keep the daemon running while you are downloading or compiling the new binaries. Once the halt-height is reached, you can execute the upgrade in one command: +``` +sudo service bcnad stop && sudo mv bcnad $(which bcnad) && sudo service bcnad start +``` +4) Verify that everything is running properly by inspecting the log files. +``` +sudo journalctl -fu bcnad -o cat +``` + +## Option 2. Cosmovisor (unattended) upgrade. +This section of the guide provides instructions on how to perform an **automated** upgrade of the binaries after a governance proposal has been approved for a chain update. + +For detailed instructions on how to set up Cosmovisor for the first time, please follow [this link](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/cosmovisor_install.md). + +This guide shows how to download the newest binary. If you want to build the binary from the source, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions) for detailed instructions. + +### Setup Cosmovisor folder +Download the upgraded binary as mentioned in the beginning of this guide before continuing with this step. + +1) Create a new directory designated for upgrades. +``` +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow/bin +``` +2) Move the newly downloaded binary to the directory. +``` +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow/bin/ +``` +> If you build the binary from the code source, move it to the same folder. + +3) If you want to know if Cosmovisor handles the correct binary file, execute this command after the upgrade: +``` +sudo service cosmovisor status +``` +And check the path of the binary file. + +## Build the binary from the source code + +For detailed instructions on how to build the binary from the source code, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions). +``` + git clone https://github.com/BitCannaGlobal/bcna.git + cd bcna + git checkout v1.6.0-rc2 + make build && make install +``` + +###### tags: `upgrade` `upgrade_v1.6.0-rc2.md` diff --git a/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc3.md b/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc3.md new file mode 100644 index 00000000..09d53493 --- /dev/null +++ b/devnets/bitcanna-dev-1/upgrade_v1.6.0-rc3.md @@ -0,0 +1,107 @@ +# Node operator instructions for "Vigorous-Grow"`v1.6.0-rc3` upgrade on `bitcanna-dev-1` +In this guide, you will find all the instructions required to upgrade a BitCanna node and help us test the latest software version on the DEVNET-1. + +We provide detailed instructions for **manual and automated upgrades**, as well as links to instructions for installing Cosmovisor or building the binaries from the source code. + +If you have any questions or find anything unclear when reading through this guide, don't hesitate to reach out to us on Discord. Also, if you have any suggestions for improvement, we welcome you to make a pull request! + +Let's get started! + +### Governance proposal + +The upgrade is scheduled to take place on **February 24nd around 16:00h CET / 15:00h UTC** +* **Halt-height 987.757** + +https://testnet.ping.pub/bitcanna/gov/4 + +## Download the new binary +1) Download the new binary or [compile it from the source code](#Build-the-binary-from-the-source-code) +``` +cd ~ +rm -f ./bcnad && rm -f ./bcna_linux_amd64.tar.gz #clean the previous downloads +wget -nc https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.0-rc3/bcna_linux_amd64.tar.gz +``` +2) Check the sha256sum. +``` +sha256sum bcna_linux_amd64.tar.gz +``` +> It must return: `4ab89e9df3c340acc42b01d52167a676a6daa6749b70e3f0eee8f65808af8bc0` + +3) Verify that the version is `v1.6.0-rc3` +``` +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +./bcnad version +``` + +## Option 1. Manual (attended) upgrade. + +This section of the guide shows how to perform a **manual** update of the binaries after a governance proposal has been approved for a chain upgrade. + +Watch your logs when we aproach the halt-height and open an extra terminal to execute the commands. +``` +sudo journalctl -fu bcnad -o cat +``` +1) Stop the bcnad service **after you see** `ERR UPGRADE "vigorous-grow-rc3" NEEDED at height: 987.757` in your logs. +``` +sudo service bcnad stop +``` +2) Move the new binary to your machine's PATH and overwrite the previous version. +``` +sudo mv bcnad $(which bcnad) #copy&paste don't replace anything +``` +> If you know the exact destination you could also run: +``` +sudo mv bcnad /usr/local/bin/ #or wherever you have it +``` +3) Start the bcnad service. +``` +sudo service bcnad start +``` + +If you are familiar with the Cosmos environment, you can keep the daemon running while you are downloading or compiling the new binaries. Once the halt-height is reached, you can execute the upgrade in one command: +``` +sudo service bcnad stop && sudo mv bcnad $(which bcnad) && sudo service bcnad start +``` +4) Verify that everything is running properly by inspecting the log files. +``` +sudo journalctl -fu bcnad -o cat +``` + +## Option 2. Cosmovisor (unattended) upgrade. +This section of the guide provides instructions on how to perform an **automated** upgrade of the binaries after a governance proposal has been approved for a chain update. + +For detailed instructions on how to set up Cosmovisor for the first time, please follow [this link](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/cosmovisor_install.md). + +This guide shows how to download the newest binary. If you want to build the binary from the source, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions) for detailed instructions. + +### Setup Cosmovisor folder +Download the upgraded binary as mentioned in the beginning of this guide before continuing with this step. + +1) Create a new directory designated for upgrades. +``` +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow-rc3/bin +``` +2) Move the newly downloaded binary to the directory. +``` +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow-rc3/bin/ +``` +> If you build the binary from the code source, move it to the same folder. + +3) If you want to know if Cosmovisor handles the correct binary file, execute this command after the upgrade: +``` +sudo service cosmovisor status +``` +And check the path of the binary file. + +## Build the binary from the source code + +For detailed instructions on how to build the binary from the source code, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions). +``` + git clone https://github.com/BitCannaGlobal/bcna.git + cd bcna + git checkout v1.6.0-rc3 + make build && make install +``` + +###### tags: `upgrade` `upgrade_v1.6.0-rc3.md` diff --git a/devnets/bitcanna-dev-1/upgrade_v1.6.1.md b/devnets/bitcanna-dev-1/upgrade_v1.6.1.md new file mode 100644 index 00000000..2579ca23 --- /dev/null +++ b/devnets/bitcanna-dev-1/upgrade_v1.6.1.md @@ -0,0 +1,105 @@ +# Node operator instructions for "Vigorous-Grow-Fix"`v1.6.1` upgrade on `bitcanna-dev-1` +In this guide, you will find all the instructions required to upgrade a BitCanna node and help us test the latest software version on the DEVNET-1. + +We provide detailed instructions for **manual and automated upgrades**, as well as links to instructions for installing Cosmovisor or building the binaries from the source code. + +If you have any questions or find anything unclear when reading through this guide, don't hesitate to reach out to us on Discord. Also, if you have any suggestions for improvement, we welcome you to make a pull request! + +Let's get started! + +### Governance proposal + +The upgrade is scheduled to take place on **March 7th around 16:00h CET / 15:00h UTC** +* **Halt-height 1.159.488** + +https://testnet.ping.pub/bitcanna/gov/8 + +## Download the new binary +1) Download the new binary or [compile it from the source code](#Build-the-binary-from-the-source-code) +``` +cd ~ +rm -f ./bcnad && rm -f ./bcna_linux_amd64.tar.gz #clean the previous downloads +wget https://github.com/BitCannaGlobal/bcna/releases/download/v1.6.1/bcna_linux_amd64.tar.gz +``` +2) Check the sha256sum. +``` +sha256sum bcna_linux_amd64.tar.gz +``` +> It must return: `6937aef187a6e47fb01cbbe1911fc845ffea986aff3e2cdbef982a62426fa610` + +3) Verify that the version is `v1.6.1` +``` +tar zxvf bcna_linux_amd64.tar.gz +rm bcna_linux_amd64.tar.gz +./bcnad version +``` + +## Option 1. Manual (attended) upgrade. + +This section of the guide shows how to perform a **manual** update of the binaries after a governance proposal has been approved for a chain upgrade. + +Watch your logs when we aproach the halt-height and open an extra terminal to execute the commands. +``` +sudo journalctl -fu bcnad -o cat +``` +1) Stop the bcnad service **after you see** `ERR UPGRADE "vigorous-grow-fix" NEEDED at height: 1.159.488` in your logs. +``` +sudo service bcnad stop +``` +2) Move the new binary to your machine's PATH and overwrite the previous version. +``` +sudo mv bcnad $(which bcnad) #copy&paste don't replace anything +``` +> If you know the exact destination you could also run: +``` +sudo mv bcnad /usr/local/bin/ #or wherever you have it +``` +3) Start the bcnad service. +``` +sudo service bcnad start +``` + +If you are familiar with the Cosmos environment, you can keep the daemon running while you are downloading or compiling the new binaries. Once the halt-height is reached, you can execute the upgrade in one command: +``` +sudo service bcnad stop && sudo mv bcnad $(which bcnad) && sudo service bcnad start +``` +4) Verify that everything is running properly by inspecting the log files. +``` +sudo journalctl -fu bcnad -o cat +``` + +## Option 2. Cosmovisor (unattended) upgrade. +This section of the guide provides instructions on how to perform an **automated** upgrade of the binaries after a governance proposal has been approved for a chain update. + +For detailed instructions on how to set up Cosmovisor for the first time, please follow [this link](https://github.com/BitCannaGlobal/bcna/blob/main/devnets/bitcanna-dev-1/cosmovisor_install.md). + +This guide shows how to download the newest binary. If you want to build the binary from the source, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions) for detailed instructions. + +### Setup Cosmovisor folder +Download the upgraded binary as mentioned in the beginning of this guide before continuing with this step. + +1) Create a new directory designated for upgrades. +``` +mkdir -p ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow-fix/bin +``` +2) Move the newly downloaded binary to the directory. +``` +mv ./bcnad ${HOME}/.bcna/cosmovisor/upgrades/vigorous-grow-fix/bin/ +``` +> If you build the binary from the code source, move it to the same folder. + +3) If you want to know if Cosmovisor handles the correct binary file, execute this command after the upgrade: +``` +sudo service cosmovisor status +``` +And check the path of the binary file. + +## Build the binary from the source code + +For detailed instructions on how to build the binary from the source code, please refer to [this link](https://github.com/BitCannaGlobal/bcna/blob/main/1.install-compile.md#option-2-compile-instructions). +``` + git clone https://github.com/BitCannaGlobal/bcna.git + cd bcna + git checkout v1.6.1 + make build && make install +``` diff --git a/devnets/devnet-6/README.md b/devnets/devnet-6/README.md new file mode 100644 index 00000000..3714608c --- /dev/null +++ b/devnets/devnet-6/README.md @@ -0,0 +1 @@ +devnet-6 info diff --git a/go.mod b/go.mod index d1b8e6f4..5b0bbffd 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/BitCannaGlobal/bcna go 1.19 require ( + cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.3 github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/ibc-go/v6 v6.1.0 @@ -26,7 +27,6 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.11.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect - cosmossdk.io/errors v1.0.0-beta.7 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -159,6 +159,10 @@ require ( ) replace ( + // Use cosmos keyring + github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + + // use cosmos style protobufs github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 ) diff --git a/go.sum b/go.sum index 7101ba72..9c19ecfd 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,6 @@ git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFN git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= @@ -376,6 +374,8 @@ github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ibc-go/v6 v6.1.0 h1:o7oXws2vKkKfOFzJI+oNylRn44PCNt5wzHd/zKQKbvQ= github.com/cosmos/ibc-go/v6 v6.1.0/go.mod h1:CY3zh2HLfetRiW8LY6kVHMATe90Wj/UOoY8T6cuB0is= +github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= +github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= diff --git a/last_upgrade.md b/last_upgrade.md index e6cacb23..d15f80ff 100644 --- a/last_upgrade.md +++ b/last_upgrade.md @@ -1,4 +1,75 @@ -# MAINNET `bitcanna-1` Upgrade +# MAINNET `bitcanna-1` Upgrades + +## v1.6.1 codename `vigorous-grow-fix` from v1.6.0-fix + +> (Update scheduled for 10th March 2023 ~ 18.40h CET - 17.40h UTC) +> +> Note: this is a planned upgrade, the chain **will halt** at block **[7585420](https://www.mintscan.io/bitcanna/blocks/7585420)** +> +> **Important note: The tag name required for the upgrade is v1.6.1** + +- Fix Ante handler to prevent spam proposals at Gov module +- Remove OpenAPI dep from Ignite; now included locally. +- Bump Cosmos SDK version to v0.45.14 to mitigate a possible way to [DDoS](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.14) a node. +- Bump Tendermint to v0.34.26 ([InformalSystem fork](https://github.com/informalsystems/tendermint/blob/v0.34.26/CHANGELOG.md#v03426)). +- Bump IBC go version to v.3.4.0 (it will break consensus so a new start/stop is required) +- Bump IAVL version to v0.19.5 +- Fixed BCNA module path & bug with CLI +- Using Cosmos Keyring v1.2.0 + +### For detailed instructions check the release doc: +* https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.1 +### For detailed Cosmovisor install guide: +* [Updated guide](https://github.com/BitCannaGlobal/bcna/blob/main/2.3.cosmovisor.md) + + +---------- +## v1.6.0-fix codename `Vigorous-grow` from v1.5.3 + +> (Update scheduled for 2nd March 2023 ~ 16.20h CET - 15.20h UTC) +> +> Note: this is a planned upgrade, the chain **will halt** at block **7467420** +> +> **Important note: The tag name required for the upgrade is v1.6.0-fix because tag v1.6.0 contains a typo and won't match the Plan (Upgrade) Name** + +- Ante handler to prevent spam proposals at Gov module +- Remove OpenAPI dep from Ignite; now included locally. +- Bump Cosmos SDK version to v0.45.14 to mitigate a possible way to [DDoS](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.14) a node. +- Bump Tendermint to v0.34.26 ([InformalSystem fork](https://github.com/informalsystems/tendermint/blob/v0.34.26/CHANGELOG.md#v03426)). +- Bump IBC go version to v.3.4.0 (it will break consensus so a new start/stop is required) +- Bump IAVL version to v0.19.5 +- Fixed BCNA module path & bug with CLI +- Using Cosmos Keyring v1.2.0 + +### For detailed instructions check the release doc: +* https://github.com/BitCannaGlobal/bcna/releases/tag/v1.6.0-fix +### For detailed Cosmovisor install guide: +* [Updated guide](https://github.com/BitCannaGlobal/bcna/blob/main/2.3.cosmovisor.md) + + +---------- +## v1.5.3 codename `TrichomeMonster-ica` from v1.4.5 +> (Update scheduled for 7 November 2022 ~ 14.00h UTC) +* Source code refactored to deprecate `CosmosCMD` package from Ignite/CLI. +* InterChain Accounts module intregration. +* Last security and stability updates. + +> Note: this is a planned upgrade, chain **will halts** at block **5787420** +### For detailed instructions check the release doc: +* https://github.com/BitCannaGlobal/bcna/releases/tag/v1.5.3 + +## v1.4.5 from v1.4.2 (from Oct. 31th 2022) +We've developed a new version with some updates (regarding SDK, Tendermint & IBC/go) to improve the security (Dragonberry) and stability (forks in IAVL) in our chain. +* Cosmos SDK v0.45.10 +* Tendermint v0.34.22 +* IAVL v0.19.4 +* IBC/go v3.3.1 +* Ledger-go v0.9.3 (now support Ledger Nano Plus) + +> Note: this is not a planned upgrade, chain won't be halted + +### For detailed instructions check the release doc: +* https://github.com/BitCannaGlobal/bcna/releases/tag/v1.4.5 ## v1.4.2 from v1.4.1 (from Sept. 7th 2022) We've developed a new version with some updates (regarding SDK, Tendermint & IBC/go) to improve the security and stability in our chain. diff --git a/peers_seeds_and_services.md b/peers_seeds_and_services.md index 80583b5a..0952b86e 100644 --- a/peers_seeds_and_services.md +++ b/peers_seeds_and_services.md @@ -5,25 +5,9 @@ We'd like to ask you to provide us your ***endpoints*** and/or ***persistent_pee # Persistent_peers -## STAVR -0bf629f4e055af47f7c35bb444cb9013d18b9941@141.95.124.151:21326 - -## EZStaking -bee230fb347722d7f87d22414f57bf9cbe37a410@sentry-1.bcna.ezstaking.io:26039 -90ee680b1738344354c48c23ba1e1fd68e071d80@sentry-2.bcna.ezstaking.io:26696 - -## StakeLab -5eb75c20a77ccf960df396b187b86d6324b40123@51.68.226.61:26656 -11612d58955e5f073a6e70ce83129d63b8f5c654@65.108.139.109:26666 - - ## Stakely -3cdfe02efd4432280707d2949e064a9d8db412b3@178.62.98.158:26656 -d806bb39349751c142627a547c23c586a787ef26@138.68.78.210:26656 - - -## Blockscope -ddb620e7c7a6b5a8a53352037cde927681012ab4@65.21.229.209:37656 +8fa7a04d55ca7d0ab70dc5cbc35d5cf26c5ecfb7@65.108.142.81:26682 +ad820cb2fa85e525538207bb24ee49a61a74eb45@93.115.25.15:26656 ## BloClick be87c9abf1c54e1cc2f37e68d21fcd61679abb4c@65.21.196.90:46656 @@ -45,28 +29,85 @@ ec283da64f69f8c0dee4671021edc419bbeb4034@157.90.179.34:56656 45589e6147e36dda9e429668484d7614fb25b142@bitcanna.nodejumper.io:27656 ## Inter Blockchain Services (former 3Tekos) -ec12bf44fd3c64db457f45f7d0111735c559a37d@185.218.126.71:26657 -79d9c3aa19f61e06c33c54d80d0cda4fa535b28a@161.97.156.216:26657 +57a3e858a5c860e6355683c88add28d52df6c24a@38.242.232.202:26656 +526e4529131070e39134d94edc0e7e48289a64b1@176.191.97.120:27656 + +## STAVR +0bf629f4e055af47f7c35bb444cb9013d18b9941@141.95.124.151:21326 + +## Panthea EU +0a658df9d9fab096983a12e6f878e87281a15ce6@bitcanna-peer.panthea.eu:27656 + +## AlxVoy +803fc66e3bd7b724921ef9c40636067f36e880c6@65.108.199.222:26357 + +## [NODERS]TEAM +9425b897a9726efb1e56111a8b355026a1f3a497@65.108.238.203:46656 + +## bonded.zone +9532a13b05e5f68f2ca01f90b3d1ba9a762af817@team.bonded.zone:21956 + +## KonsorTech +5a048cab1d183de5c465c56b29a16fd93a8bf9bd@mainnet-bitcanna.konsortech.xyz:27656 + +## kjnodes +d9bfa29e0cf9c4ce0cc9c26d98e5d97228f93b0b@bitcanna.rpc.kjnodes.com:42656 + +## cryptech +21f58acd833e3160feb01a6d9a6a6f501e87da80@185.144.99.58:26656 + +## Alkia +2235f1e518c5ea4a412f9dece386348eda356916@bitcanna.alkia.net:26656 # Seeds ## BitCanna (reseted everyday) d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656 -23671067d0fd40aec523290585c7d8e91034a771@seed2.bitcanna.io:26656 +e2e7c704f766ef6b9e2c8dd61d963f8393b87966@seed3.bitcanna.io:26656 + +## Panthea EU +f0e6c86d769bf5c52f78e01864091690e731643f@bitcanna-seed.panthea.eu:37656 + +## kjnodes +400f3d9e30b69e78a7fb891f60d76fa3c73f0ecc@bitcanna.rpc.kjnodes.com:42659 # StateSync Servers and instructions: ## BitCanna oficial: * https://github.com/BitCannaGlobal/bcna/blob/main/2.1.statesync.md + ## Polkachu * https://polkachu.com/state_sync/bitcanna + ## Panthea EU StateSync Server * https://bitcanna-rpc.panthea.eu:443 -## STAVR StateSync - * https://github.com/obajay/StateSync-snapshots/tree/main/Bitcanna#statesync + ## Inter Blockchain Services (former 3Tekos) StateSync Server * https://bcna-rpc.ibs.team:443 + * https://github.com/Inter-Blockchain-Service/Cosmos-StateSync/tree/main/Bitcanna + ## mintthemoon * https://docs.mintthemoon.xyz/bitcanna/statesync +## STAVR StateSync + * https://github.com/obajay/StateSync-snapshots/tree/main/Bitcanna#statesync + +## AlxVoy StateSync + * https://github.com/Voynitskiy/Voynitskiy/blob/main/mainnet/BitCanna/README.md#state-sync + +## [NODERS]TEAM StateSync + * http://bitcanna.statesync.nodersteam.com:46657 + +## bonded.zone StateSync + * https://sync.bonded.zone/mainnets/bitcanna + +## KonsorTech + * https://github.com/konsortech/Node/blob/main/Mainnet/Bitcanna/statesync.md + +## kjnodes + * https://services.kjnodes.com/mainnet/bitcanna/state-sync + +## cryptech StateSync + * https://explorers.cryptech.com.ua/bitcanna/statesync + # Info, doc and other services from BitCanna validators & partners (feel free to make a PR) ### BitCanna Docs * https://docs.bitcanna.io @@ -80,9 +121,6 @@ d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656 ### Polkachu: snapshot service info * https://polkachu.com/tendermint_snapshots/bitcanna -### STAVR : snapshot and state sync services, installation scripts (manual/automation) -* https://github.com/obajay/nodes-Guides/blob/main/Bitcanna/README.md#1-auto_install-script - ### Nodejumper πŸš€: on-chain analytics, snapshot & state sync services, installation scripts (manual/automation), cheat sheet and more. * https://nodejumper.io/bitcanna @@ -94,149 +132,240 @@ d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f@seed1.bitcanna.io:26656 * Node setup guide: https://docs.mintthemoon.xyz/bitcanna/node-guide * Validator setup guide: https://docs.mintthemoon.xyz/bitcanna/validator-guide +### STAVR : snapshot and state sync services, installation scripts (manual/automation) +* https://github.com/obajay/nodes-Guides/blob/main/Bitcanna/README.md#1-auto_install-script + +### AlxVoy : snapshot and state sync services, guide, RPC, API, peer +* https://github.com/Voynitskiy/Voynitskiy/blob/main/mainnet/BitCanna/README.md + +### KonsorTech : Guide, public_endpoint (RPC, API, Peer), state sync +* https://github.com/konsortech/Node/tree/main/Mainnet/Bitcanna + +### kjnodes: +* Peering Services, Public Endpoints, Daily Snapshots, State-Sync, Node Setup Guide, Useful Commands: https://services.kjnodes.com/mainnet/bitcanna +* πŸ€– Free Telegram Proposal Bot: https://services.kjnodes.com/bots/proposal-bot + +### [NODERS]TEAM: Guide, API, RPC, StateSync, Live peer, AdrBook, Useful Commands +* https://nodeservice.nodersteam.com/title/mainnet/bitcanna # RPCs, LCD, GRPC and other endpoints/services ``` - "peers": { - "seeds": [ - { - "id": "d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f", - "address": "seed1.bitcanna.io: 26656", - "provider": "bitcanna" - }, - { - "id": "23671067d0fd40aec523290585c7d8e91034a771", - "address": "seed2.bitcanna.io: 26656", - "provider": "bitcanna" - } - ], - "persistent_peers": [ - { - "id": "bee230fb347722d7f87d22414f57bf9cbe37a410", - "address": "sentry-1.bcna.ezstaking.io:26039", - "provider": "EZStaking.io" - }, - { - "id": "90ee680b1738344354c48c23ba1e1fd68e071d80", - "address": "sentry-2.bcna.ezstaking.io:26696", - "provider": "EZStaking.io" - }, - { - "id": "21484408a7bcf0134689ddf52a7d9c8299cb65b5", - "address": "176.9.139.74:36656", - "provider": "BitCanna" - }, - { - "id": "a4c1e46441164c350f721cf142d52c136215e05c", - "address": "135.181.176.55:36656", - "provider": "BitCanna" - }, - { - "id": "5eb75c20a77ccf960df396b187b86d6324b40123", - "address": "51.68.226.61:26656", - "provider": "StakeLab" - }, - { - "id": "11612d58955e5f073a6e70ce83129d63b8f5c654", - "address": "65.108.139.109:26666", - "provider": "StakeLab" - }, - { - "id": "3cdfe02efd4432280707d2949e064a9d8db412b3", - "address": "178.62.98.158:26656", - "provider": "Stakely" - }, - { - "id": "d806bb39349751c142627a547c23c586a787ef26", - "address": "138.68.78.210:26656", - "provider": "Stakely" - }, - { - "id": "ddb620e7c7a6b5a8a53352037cde927681012ab4", - "address": "65.21.229.209:37656", - "provider": "Blockscope" - }, - { - "id": "df99de6cec9152c517990317b340b8b9a307493c", - "address": "193.34.144.156:26656", - "provider": "ParanormalBrothers" - } - ] - }, - "apis": { - "rpc": [ - { - "address": "https://rpc.bitcanna.io/", - "provider": "bitcanna" - }, - { - "address": "http://bcna.paranorm.pro/", - "provider": "ParanormalBrothers" - }, - { - "address": "https://rpc.bitcanna.ezstaking.io/", - "provider": "ezstaking.io" - }, - { - "address": "https://bcna-rpc.ibs.team/", - "provider": "Inter Blockchain Services (former 3Tekos)" - }, - { - "address": "https://rpc-bitcanna.itastakers.com/", - "provider": "itastakers" - }, - { - "address": "https://bitcanna-rpc.panthea.eu", - "provider": "Panthea EU" - } - { - "address": "https://rpc.bitcanna.sgtstake.com/", - "provider": "SGTstake" - }, - { - "address": "https://rpc-bitcanna.mintthemoon.xyz", - "provider": "mintthemoon" - } - ], - "grpc": [ - { - "address": "https://grpc.bitcanna.io", - "provider": "bitcanna" - } - ], - "rest": [ - { - "address": "https://lcd.bitcanna.io", - "provider": "bitcanna" - }, - { - "address": "https://lcd.bitcanna.ezstaking.io/", - "provider": "ezstaking.io" - }, - { - "address": "https://lcd-bitcanna.itastakers.com/", - "provider": "itastaker" - }, - { - "address": "http://bitcanna.stakelab.fr/", - "provider": "stakelab" - }, - { - "address": "https://bitcanna-api.panthea.eu", - "provider": "Panthea EU" - } - { - "address": "https://api.bitcanna.sgtstake.com/", - "provider": "SGTstake" - }, - { - "address": "https://lcd-bitcanna.mintthemoon.xyz", - "provider": "mintthemoon" - }, - { - "address": "https://bcna-api.ibs.team/", - "provider": "Inter Blockchain Services (former 3Tekos)" - } - ] - } - ``` + + "peers": { + "seeds": [{ + "id": "d6aa4c9f3ccecb0cc52109a95962b4618d69dd3f", + "address": "seed1.bitcanna.io: 26656", + "provider": "bitcanna" + }, + { + "id": "e2e7c704f766ef6b9e2c8dd61d963f8393b87966", + "address": "seed3.bitcanna.io: 26656", + "provider": "bitcanna" + }, + { + "id": "f0e6c86d769bf5c52f78e01864091690e731643f", + "address": "bitcanna-seed.panthea.eu:37656", + "provider": "Panthea EU" + }, + { + "id": "20e1000e88125698264454a884812746c2eb4807", + "address": "seeds.lavenderfive.com:13056", + "provider": "Lavender.Five Nodes 🐝" + } + ], + "persistent_peers": [{ + "id": "21484408a7bcf0134689ddf52a7d9c8299cb65b5", + "address": "176.9.139.74:36656", + "provider": "BitCanna" + }, + { + "id": "a4c1e46441164c350f721cf142d52c136215e05c", + "address": "135.181.176.55:36656", + "provider": "BitCanna" + }, + { + "id": "8fa7a04d55ca7d0ab70dc5cbc35d5cf26c5ecfb7", + "address": "65.108.142.81:26682", + "provider": "Stakely" + }, + { + "id": "ad820cb2fa85e525538207bb24ee49a61a74eb45", + "address": "93.115.25.15:26656", + "provider": "Stakely" + }, + { + "id": "df99de6cec9152c517990317b340b8b9a307493c", + "address": "193.34.144.156:26656", + "provider": "ParanormalBrothers" + }, + { + "id": "0a658df9d9fab096983a12e6f878e87281a15ce6", + "address": "bitcanna-peer.panthea.eu:27656", + "provider": "Panthea EU" + }, + { + "id": "803fc66e3bd7b724921ef9c40636067f36e880c6", + "address": "65.108.199.222:26357", + "provider": "AlxVoy" + }, + { + "id": "9425b897a9726efb1e56111a8b355026a1f3a497", + "address": "65.108.238.203:46656", + "provider": "[NODERS]TEAM" + }, + { + "id": "5a048cab1d183de5c465c56b29a16fd93a8bf9bd", + "address": "mainnet-bitcanna.konsortech.xyz:27656", + "provider": "KonsorTech" + }, + { + "id": "2235f1e518c5ea4a412f9dece386348eda356916", + "address": "bitcanna.alkia.net:26656", + "provider": "ALKIA" + }, + { + "id": "d9bfa29e0cf9c4ce0cc9c26d98e5d97228f93b0b", + "address": "bitcanna.rpc.kjnodes.com:42656", + "provider": "kjnodes" + } + ] + }, + "apis": { + "rpc": [{ + "address": "https://rpc.bitcanna.io/", + "provider": "bitcanna" + }, + { + "address": "http://bcna.paranorm.pro/", + "provider": "ParanormalBrothers" + }, + { + "address": "https://bcna-rpc.ibs.team/", + "provider": "Inter Blockchain Services (former 3Tekos)" + }, + { + "address": "https://bitcanna-rpc.panthea.eu", + "provider": "Panthea EU" + }, + { + "address": "https://rpc.bitcanna.sgtstake.com/", + "provider": "SGTstake" + }, + { + "address": "https://rpc-bitcanna.mintthemoon.xyz", + "provider": "mintthemoon" + }, + { + "address": "https://bitcanna.rpc.m.anode.team", + "provider": "AlxVoy" + }, + { + "address": "http://bitcanna.statesync.nodersteam.com:46657", + "provider": "[NODERS]TEAM" + }, + { + "address": "https://rpc-bcna.kjinc.io/", + "provider": "KJINC.io" + }, + { + "address": "https://mainnet-bitcanna-rpc.konsortech.xyz", + "provider": "KonsorTech" + }, + { + "address": "https://bitcanna.rpc.kjnodes.com", + "provider": "kjnodes" + }, + { + "address": "http://bitcanna.alkia.net:26657", + "provider": "ALKIA" + }, + { + "address": "https://bitcanna-rpc.lavenderfive.com/", + "provider": "Lavender.Five Nodes 🐝" + } + ], + "grpc": [{ + "address": "https://grpc.bitcanna.io", + "provider": "bitcanna" + }, + { + "address": "https://bitcanna-grpc.lavenderfive.com:443/", + "provider": "Lavender.Five Nodes 🐝" + } + ], + "rest": [{ + "address": "https://lcd.bitcanna.io", + "provider": "bitcanna" + }, + { + "address": "https://bitcanna-api.panthea.eu", + "provider": "Panthea EU" + }, + { + "address": "https://api.bitcanna.sgtstake.com/", + "provider": "SGTstake" + }, + { + "address": "https://lcd-bitcanna.mintthemoon.xyz", + "provider": "mintthemoon" + }, + { + "address": "https://bcna-api.ibs.team/", + "provider": "Inter Blockchain Services (former 3Tekos)" + }, + { + "address": "https://bitcanna.api.m.anode.team", + "provider": "AlxVoy" + }, + { + "address": "https://api-bcna.kjinc.io/", + "provider": "KJINC.io" + }, + { + "address": "https://mainnet-bitcanna-api.konsortech.xyz", + "provider": "KonsorTech" + }, + { + "address": "https://bitcanna.api.kjnodes.com", + "provider": "kjnodes" + }, + { + "address": "http://bitcanna.alkia.net:1317/", + "provider": "ALKIA" + }, + { + "address": "https://bitcanna-api.lavenderfive.com/", + "provider": "Lavender.Five Nodes 🐝" + } + ] + }, + "explorers": [{ + "kind": "EZStaking Tools", + "url": "https://ezstaking.tools/bitcanna", + "tx_page": "https://ezstaking.tools/bitcanna/txs/${txHash}", + "account_page": "https://ezstaking.tools/bitcanna/account/${accountAddress}" + }, + { + "kind": "forbole", + "url": "https://cosmos-explorer.bitcanna.io", + "tx_page": "https://cosmos-explorer.bitcanna.io/transactions/${txHash}" + }, + { + "kind": "ping.pub", + "url": "https://ping.pub/bitcanna", + "tx_page": "https://ping.pub/bitcanna/tx/${txHash}" + }, + { + "kind": "mintscan", + "url": "https://www.mintscan.io/bitcanna/", + "tx_page": "https://www.mintscan.io/bitcanna/txs/${txHash}", + "account_page": "https://www.mintscan.io/bitcanna/account/${accountAddress}" + }, + { + "kind": "atomscan", + "url": "https://atomscan.com/bitcanna", + "tx_page": "https://atomscan.com/bitcanna/transactions/${txHash}" + } + ] +} +``` diff --git a/x/bcna/client/cli/tx_bitcannaid_test.go b/x/bcna/client/cli/tx_bitcannaid_test.go index 224d7ed6..5d6af8a0 100644 --- a/x/bcna/client/cli/tx_bitcannaid_test.go +++ b/x/bcna/client/cli/tx_bitcannaid_test.go @@ -8,7 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" "github.com/BitCannaGlobal/bcna/testutil/network" @@ -60,7 +59,7 @@ func TestUpdateBitcannaid(t *testing.T) { val := net.Validators[0] ctx := val.ClientCtx - fields := []string{"xyz", "xyz"} + fields := []string{"xyz1", "xyz2"} common := []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -74,27 +73,30 @@ func TestUpdateBitcannaid(t *testing.T) { require.NoError(t, err) for _, tc := range []struct { - desc string - id string - args []string - code uint32 - err error + desc string + id string + fields []string + args []string + code uint32 + err error }{ { - desc: "valid", - id: "0", - args: common, + desc: "valid", + id: "0", + fields: []string{"Updated1xyz1", "Updated1xyz2"}, + args: common, }, { - desc: "key not found", - id: "1", - args: common, - code: sdkerrors.ErrKeyNotFound.ABCICode(), + desc: "key not found", + id: "1", + fields: []string{"Updated2xyz1", "Updated2xyz2"}, + args: common, + code: 0x44e, //sdkerrors.ErrKeyNotFound.ABCICode(), }, } { t.Run(tc.desc, func(t *testing.T) { args := []string{tc.id} - args = append(args, fields...) + args = append(args, tc.fields...) args = append(args, tc.args...) out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdUpdateBitcannaid(), args) if tc.err != nil { @@ -103,6 +105,7 @@ func TestUpdateBitcannaid(t *testing.T) { require.NoError(t, err) var resp sdk.TxResponse require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + //debug fmt.Printf("Error: %s\n", resp.RawLog) require.Equal(t, tc.code, resp.Code) } }) @@ -144,7 +147,7 @@ func TestDeleteBitcannaid(t *testing.T) { desc: "key not found", id: "1", args: common, - code: sdkerrors.ErrKeyNotFound.ABCICode(), + code: 0x44e, // sdkerrors.ErrKeyNotFound.ABCICode(), }, } { t.Run(tc.desc, func(t *testing.T) { @@ -155,6 +158,7 @@ func TestDeleteBitcannaid(t *testing.T) { require.NoError(t, err) var resp sdk.TxResponse require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + // debug fmt.Printf("Error: %s\n", resp.RawLog) require.Equal(t, tc.code, resp.Code) } }) diff --git a/x/bcna/client/cli/tx_supplychain_test.go b/x/bcna/client/cli/tx_supplychain_test.go index 646633de..29dae519 100644 --- a/x/bcna/client/cli/tx_supplychain_test.go +++ b/x/bcna/client/cli/tx_supplychain_test.go @@ -8,7 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" "github.com/BitCannaGlobal/bcna/testutil/network" @@ -89,7 +88,7 @@ func TestUpdateSupplychain(t *testing.T) { desc: "key not found", id: "1", args: common, - code: sdkerrors.ErrKeyNotFound.ABCICode(), + code: 0x44e, // sdkerrors.ErrKeyNotFound.ABCICode(), }, } { t.Run(tc.desc, func(t *testing.T) { @@ -144,7 +143,7 @@ func TestDeleteSupplychain(t *testing.T) { desc: "key not found", id: "1", args: common, - code: sdkerrors.ErrKeyNotFound.ABCICode(), + code: 0x44e, // sdkerrors.ErrKeyNotFound.ABCICode(), }, } { t.Run(tc.desc, func(t *testing.T) { diff --git a/x/bcna/handler.go b/x/bcna/handler.go index 0122cdb6..e8d5a065 100644 --- a/x/bcna/handler.go +++ b/x/bcna/handler.go @@ -6,7 +6,7 @@ import ( "github.com/BitCannaGlobal/bcna/x/bcna/keeper" "github.com/BitCannaGlobal/bcna/x/bcna/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + // sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewHandler ... @@ -43,7 +43,7 @@ func NewHandler(k keeper.Keeper) sdk.Handler { default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + return nil, types.ErrUnrecognized.Wrapf(errMsg) } } } diff --git a/x/bcna/keeper/msg_server_bitcannaid.go b/x/bcna/keeper/msg_server_bitcannaid.go index af865e2a..8dfa60ca 100644 --- a/x/bcna/keeper/msg_server_bitcannaid.go +++ b/x/bcna/keeper/msg_server_bitcannaid.go @@ -2,11 +2,9 @@ package keeper import ( "context" - "fmt" "github.com/BitCannaGlobal/bcna/x/bcna/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (k msgServer) CreateBitcannaid(goCtx context.Context, msg *types.MsgCreateBitcannaid) (*types.MsgCreateBitcannaidResponse, error) { @@ -14,7 +12,7 @@ func (k msgServer) CreateBitcannaid(goCtx context.Context, msg *types.MsgCreateB // Check if a BitCannaID with the same Bcnaid already exists if k.HasBitcannaidWithBcnaid(ctx, msg.Bcnaid) { - return nil, sdkerrors.Wrapf(types.ErrDuplicateBitcannaid, "BitCannaID with Bcnaid %s already exists", msg.Bcnaid) + return nil, types.ErrDuplicateBitcannaid.Wrapf("BitCannaID with Bcnaid %s already exists", msg.Bcnaid) } var bitcannaid = types.Bitcannaid{ Creator: msg.Creator, @@ -37,7 +35,7 @@ func (k msgServer) UpdateBitcannaid(goCtx context.Context, msg *types.MsgUpdateB // Check if a BitCannaID with the same Bcnaid already exists if k.HasBitcannaidWithBcnaid(ctx, msg.Bcnaid) { - return nil, sdkerrors.Wrapf(types.ErrDuplicateBitcannaid, "BitCannaID with Bcnaid %s already exists", msg.Bcnaid) + return nil, types.ErrDuplicateBitcannaid.Wrapf("BitCannaID with Bcnaid %s already exists", msg.Bcnaid) } var bitcannaid = types.Bitcannaid{ Creator: msg.Creator, @@ -49,12 +47,12 @@ func (k msgServer) UpdateBitcannaid(goCtx context.Context, msg *types.MsgUpdateB // Checks that the element exists val, found := k.GetBitcannaid(ctx, msg.Id) if !found { - return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("key %d doesn't exist", msg.Id)) + return nil, types.ErrKeyNotFound.Wrapf("key doesn't exist: %d", msg.Id) } // Checks if the msg creator is the same as the current owner if msg.Creator != val.Creator { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "incorrect owner") + return nil, types.ErrUnauthorized.Wrapf("Unauthorized: %s,", msg.Creator) } k.SetBitcannaid(ctx, bitcannaid) @@ -68,12 +66,12 @@ func (k msgServer) DeleteBitcannaid(goCtx context.Context, msg *types.MsgDeleteB // Checks that the element exists val, found := k.GetBitcannaid(ctx, msg.Id) if !found { - return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("key %d doesn't exist", msg.Id)) + return nil, types.ErrKeyNotFound.Wrapf("key doesn't exist: %d", msg.Id) } // Checks if the msg creator is the same as the current owner if msg.Creator != val.Creator { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "incorrect owner") + return nil, types.ErrUnauthorized.Wrapf("Unauthorized: %s,", msg.Creator) } k.RemoveBitcannaid(ctx, msg.Id) diff --git a/x/bcna/keeper/msg_server_bitcannaid_test.go b/x/bcna/keeper/msg_server_bitcannaid_test.go index 5f503d53..d42d8e77 100644 --- a/x/bcna/keeper/msg_server_bitcannaid_test.go +++ b/x/bcna/keeper/msg_server_bitcannaid_test.go @@ -1,9 +1,10 @@ package keeper_test import ( + "fmt" + "strconv" "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" "github.com/BitCannaGlobal/bcna/x/bcna/types" @@ -12,8 +13,11 @@ import ( func TestBitcannaidMsgServerCreate(t *testing.T) { srv, ctx := setupMsgServer(t) creator := "A" + for i := 0; i < 5; i++ { - resp, err := srv.CreateBitcannaid(ctx, &types.MsgCreateBitcannaid{Creator: creator}) + concatenated := strconv.Itoa(i) + creator + fmt.Println(concatenated) + resp, err := srv.CreateBitcannaid(ctx, &types.MsgCreateBitcannaid{Creator: creator, Bcnaid: concatenated}) require.NoError(t, err) require.Equal(t, i, int(resp.Id)) } @@ -34,20 +38,21 @@ func TestBitcannaidMsgServerUpdate(t *testing.T) { { desc: "Unauthorized", request: &types.MsgUpdateBitcannaid{Creator: "B"}, - err: sdkerrors.ErrUnauthorized, + err: types.ErrUnauthorized, }, { desc: "Unauthorized", request: &types.MsgUpdateBitcannaid{Creator: creator, Id: 10}, - err: sdkerrors.ErrKeyNotFound, + err: types.ErrKeyNotFound, }, } { t.Run(tc.desc, func(t *testing.T) { srv, ctx := setupMsgServer(t) - _, err := srv.CreateBitcannaid(ctx, &types.MsgCreateBitcannaid{Creator: creator}) + _, err := srv.CreateBitcannaid(ctx, &types.MsgCreateBitcannaid{Creator: creator, Bcnaid: "updated"}) require.NoError(t, err) _, err = srv.UpdateBitcannaid(ctx, tc.request) + if tc.err != nil { require.ErrorIs(t, err, tc.err) } else { @@ -72,12 +77,12 @@ func TestBitcannaidMsgServerDelete(t *testing.T) { { desc: "Unauthorized", request: &types.MsgDeleteBitcannaid{Creator: "B"}, - err: sdkerrors.ErrUnauthorized, + err: types.ErrUnauthorized, }, { desc: "KeyNotFound", request: &types.MsgDeleteBitcannaid{Creator: creator, Id: 10}, - err: sdkerrors.ErrKeyNotFound, + err: types.ErrKeyNotFound, }, } { t.Run(tc.desc, func(t *testing.T) { diff --git a/x/bcna/keeper/msg_server_supplychain.go b/x/bcna/keeper/msg_server_supplychain.go index 4ae5627b..022d92bb 100644 --- a/x/bcna/keeper/msg_server_supplychain.go +++ b/x/bcna/keeper/msg_server_supplychain.go @@ -2,11 +2,9 @@ package keeper import ( "context" - "fmt" "github.com/BitCannaGlobal/bcna/x/bcna/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) func (k msgServer) CreateSupplychain(goCtx context.Context, msg *types.MsgCreateSupplychain) (*types.MsgCreateSupplychainResponse, error) { @@ -45,12 +43,12 @@ func (k msgServer) UpdateSupplychain(goCtx context.Context, msg *types.MsgUpdate // Checks that the element exists val, found := k.GetSupplychain(ctx, msg.Id) if !found { - return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("key %d doesn't exist", msg.Id)) + return nil, types.ErrKeyNotFound.Wrapf("key doesn't exist: %d", msg.Id) } // Checks if the msg creator is the same as the current owner if msg.Creator != val.Creator { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "incorrect owner") + return nil, types.ErrUnauthorized.Wrapf("Unauthorized: %s,", msg.Creator) } k.SetSupplychain(ctx, supplychain) @@ -64,12 +62,12 @@ func (k msgServer) DeleteSupplychain(goCtx context.Context, msg *types.MsgDelete // Checks that the element exists val, found := k.GetSupplychain(ctx, msg.Id) if !found { - return nil, sdkerrors.Wrap(sdkerrors.ErrKeyNotFound, fmt.Sprintf("key %d doesn't exist", msg.Id)) + return nil, types.ErrKeyNotFound.Wrapf("key doesn't exist: %d", msg.Id) } // Checks if the msg creator is the same as the current owner if msg.Creator != val.Creator { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "incorrect owner") + return nil, types.ErrUnauthorized.Wrapf("Unauthorized: %s,", msg.Creator) } k.RemoveSupplychain(ctx, msg.Id) diff --git a/x/bcna/keeper/msg_server_supplychain_test.go b/x/bcna/keeper/msg_server_supplychain_test.go index 54373499..3389d1fd 100644 --- a/x/bcna/keeper/msg_server_supplychain_test.go +++ b/x/bcna/keeper/msg_server_supplychain_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" "github.com/BitCannaGlobal/bcna/x/bcna/types" @@ -34,12 +33,12 @@ func TestSupplychainMsgServerUpdate(t *testing.T) { { desc: "Unauthorized", request: &types.MsgUpdateSupplychain{Creator: "B"}, - err: sdkerrors.ErrUnauthorized, + err: types.ErrUnauthorized, }, { desc: "Unauthorized", request: &types.MsgUpdateSupplychain{Creator: creator, Id: 10}, - err: sdkerrors.ErrKeyNotFound, + err: types.ErrKeyNotFound, }, } { t.Run(tc.desc, func(t *testing.T) { @@ -72,12 +71,12 @@ func TestSupplychainMsgServerDelete(t *testing.T) { { desc: "Unauthorized", request: &types.MsgDeleteSupplychain{Creator: "B"}, - err: sdkerrors.ErrUnauthorized, + err: types.ErrUnauthorized, }, { desc: "KeyNotFound", request: &types.MsgDeleteSupplychain{Creator: creator, Id: 10}, - err: sdkerrors.ErrKeyNotFound, + err: types.ErrKeyNotFound, }, } { t.Run(tc.desc, func(t *testing.T) { diff --git a/x/bcna/module.go b/x/bcna/module.go index 3c87bd01..a9fa7ba1 100644 --- a/x/bcna/module.go +++ b/x/bcna/module.go @@ -69,7 +69,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) //nolint } // GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module diff --git a/x/bcna/types/errors.go b/x/bcna/types/errors.go index 5416707f..b92320db 100644 --- a/x/bcna/types/errors.go +++ b/x/bcna/types/errors.go @@ -1,10 +1,14 @@ package types import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkioerrors "cosmossdk.io/errors" ) // x/bcna module sentinel errors var ( - ErrDuplicateBitcannaid = sdkerrors.Register(ModuleName, 1101, "BitCannaID already exists") + ErrDuplicateBitcannaid = sdkioerrors.Register(ModuleName, 1101, "BitCannaID already exists") + ErrKeyNotFound = sdkioerrors.Register(ModuleName, 1102, "Key doesn't exists") + ErrUnauthorized = sdkioerrors.Register(ModuleName, 1103, "Incorrect owner") + ErrUnrecognized = sdkioerrors.Register(ModuleName, 1104, "Unrecognized messager") + ErrInvalidAddress = sdkioerrors.Register(ModuleName, 1105, "invalid address") ) diff --git a/x/bcna/types/messages_bitcannaid.go b/x/bcna/types/messages_bitcannaid.go index 776c64a4..fb69be23 100644 --- a/x/bcna/types/messages_bitcannaid.go +++ b/x/bcna/types/messages_bitcannaid.go @@ -1,8 +1,10 @@ package types import ( + "errors" + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -45,7 +47,8 @@ func (msg *MsgCreateBitcannaid) GetSignBytes() []byte { func (msg *MsgCreateBitcannaid) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return fmt.Errorf("invalid creator address: %v: %w", err, errors.New("invalid address")) //test + //return fmt.Errorf("invalid creator address: %v: %s", err, "invalid address") } return nil } @@ -85,7 +88,7 @@ func (msg *MsgUpdateBitcannaid) GetSignBytes() []byte { func (msg *MsgUpdateBitcannaid) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return fmt.Errorf("invalid creator address: %v: %w", err, errors.New("invalid address")) } return nil } @@ -122,7 +125,7 @@ func (msg *MsgDeleteBitcannaid) GetSignBytes() []byte { func (msg *MsgDeleteBitcannaid) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return fmt.Errorf("invalid creator address: %v: %w", err, errors.New("invalid address")) } return nil } diff --git a/x/bcna/types/messages_bitcannaid_test.go b/x/bcna/types/messages_bitcannaid_test.go index ecdc3d54..0fcb026e 100644 --- a/x/bcna/types/messages_bitcannaid_test.go +++ b/x/bcna/types/messages_bitcannaid_test.go @@ -31,7 +31,7 @@ func TestMsgCreateBitcannaid_ValidateBasic(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { - require.ErrorIs(t, err, tt.err) + require.Contains(t, err.Error(), tt.err.Error()) return } require.NoError(t, err) @@ -62,7 +62,7 @@ func TestMsgUpdateBitcannaid_ValidateBasic(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { - require.ErrorIs(t, err, tt.err) + require.Contains(t, err.Error(), tt.err.Error()) return } require.NoError(t, err) @@ -93,7 +93,7 @@ func TestMsgDeleteBitcannaid_ValidateBasic(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { - require.ErrorIs(t, err, tt.err) + require.Contains(t, err.Error(), tt.err.Error()) return } require.NoError(t, err) diff --git a/x/bcna/types/messages_supplychain.go b/x/bcna/types/messages_supplychain.go index f0f1a554..cda9723b 100644 --- a/x/bcna/types/messages_supplychain.go +++ b/x/bcna/types/messages_supplychain.go @@ -1,8 +1,10 @@ package types import ( + "errors" + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -47,7 +49,7 @@ func (msg *MsgCreateSupplychain) GetSignBytes() []byte { func (msg *MsgCreateSupplychain) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return fmt.Errorf("invalid creator address: %v: %w", err, errors.New("invalid address")) } return nil } @@ -89,7 +91,7 @@ func (msg *MsgUpdateSupplychain) GetSignBytes() []byte { func (msg *MsgUpdateSupplychain) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return fmt.Errorf("invalid creator address: %v: %w", err, errors.New("invalid address")) } return nil } @@ -126,7 +128,7 @@ func (msg *MsgDeleteSupplychain) GetSignBytes() []byte { func (msg *MsgDeleteSupplychain) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return fmt.Errorf("invalid creator address: %v: %w", err, errors.New("invalid address")) } return nil } diff --git a/x/bcna/types/messages_supplychain_test.go b/x/bcna/types/messages_supplychain_test.go index dc0d033b..2d5775df 100644 --- a/x/bcna/types/messages_supplychain_test.go +++ b/x/bcna/types/messages_supplychain_test.go @@ -31,7 +31,7 @@ func TestMsgCreateSupplychain_ValidateBasic(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { - require.ErrorIs(t, err, tt.err) + require.Contains(t, err.Error(), tt.err.Error()) return } require.NoError(t, err) @@ -62,7 +62,7 @@ func TestMsgUpdateSupplychain_ValidateBasic(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { - require.ErrorIs(t, err, tt.err) + require.Contains(t, err.Error(), tt.err.Error()) return } require.NoError(t, err) @@ -93,7 +93,7 @@ func TestMsgDeleteSupplychain_ValidateBasic(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.msg.ValidateBasic() if tt.err != nil { - require.ErrorIs(t, err, tt.err) + require.Contains(t, err.Error(), tt.err.Error()) return } require.NoError(t, err)