forked from cerc-io/laconicd-deprecated
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
984db173f0 | ||
|
|
89b64fffef | ||
|
|
05a3eec1d6 | ||
|
|
c236863bad | ||
|
|
680d585084 | ||
|
|
17480f2716 | ||
|
|
e8b3ca8cae | ||
|
|
15c09c0157 | ||
|
|
5c495e4edb | ||
|
|
79078fdf7b | ||
|
|
f9bc170fb8 | ||
|
|
35888ad0bf | ||
|
|
659e771780 | ||
|
|
16936d3315 | ||
|
|
0fd0b284d6 | ||
|
|
b38c7f3ec7 |
@@ -1,28 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "10:00"
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- fedekunze
|
||||
- khoslaventures
|
||||
labels:
|
||||
- dependencies
|
||||
- package-ecosystem: docker
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "10:00"
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- fedekunze
|
||||
- khoslaventures
|
||||
- package-ecosystem: gomod
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "10:00"
|
||||
open-pull-requests-limit: 10
|
||||
@@ -13,18 +13,64 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.18
|
||||
- uses: actions/checkout@v3
|
||||
- uses: technote-space/get-diff-action@v6.0.1
|
||||
- uses: technote-space/get-diff-action@v6.1.0
|
||||
with:
|
||||
SUFFIX_FILTER: |
|
||||
.go
|
||||
.mod
|
||||
.sum
|
||||
- uses: golangci/golangci-lint-action@v2.5.2
|
||||
PATTERNS: |
|
||||
**/**.go
|
||||
go.mod
|
||||
go.sum
|
||||
- uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
||||
version: v1.42.1
|
||||
version: v1.48.0
|
||||
args: --timeout 10m
|
||||
github-token: ${{ secrets.github_token }}
|
||||
# Check only if there are differences in the source code
|
||||
if: "env.GIT_DIFF"
|
||||
markdown-lint:
|
||||
name: Run markdown-lint
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: technote-space/get-diff-action@v6.1.0
|
||||
with:
|
||||
PATTERNS: |
|
||||
docs/**/*.md
|
||||
x/**/*.md
|
||||
README.md
|
||||
- uses: articulate/actions-markdownlint@v1.1.0
|
||||
# Check only if there are differences in the source code
|
||||
if: env.GIT_DIFF
|
||||
python-lint:
|
||||
name: Run flake8 on python integration tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
name: ethermint
|
||||
- uses: technote-space/get-diff-action@v6.1.0
|
||||
with:
|
||||
PATTERNS: |
|
||||
**/**.py
|
||||
- run: |
|
||||
nix-shell -I nixpkgs=./nix -p test-env --run "make lint-py"
|
||||
if: env.GIT_DIFF
|
||||
gomod2nix:
|
||||
name: Check gomod2nix.toml file is up to date
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
name: ethermint
|
||||
- name: run gomod2nix
|
||||
run: |
|
||||
nix run -f ./nix gomod2nix
|
||||
git diff --no-ext-diff --exit-code
|
||||
+8
-14
@@ -13,38 +13,30 @@ linters:
|
||||
- errcheck
|
||||
- goconst
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- gofumpt
|
||||
- revive
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
# - lll TODO: enable
|
||||
- lll
|
||||
- misspell
|
||||
- nakedret
|
||||
- prealloc
|
||||
- exportloopref
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- stylecheck
|
||||
# - typecheck #TODO: enable
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unparam
|
||||
- unused
|
||||
- varcheck
|
||||
- nolintlint
|
||||
- asciicheck
|
||||
# - exhaustive
|
||||
- exportloopref
|
||||
- gofumpt
|
||||
- gomodguard
|
||||
# - nestif
|
||||
# - nlreturn
|
||||
- noctx
|
||||
- rowserrcheck
|
||||
# - whitespace
|
||||
# - wsl
|
||||
- whitespace
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
@@ -57,6 +49,8 @@ issues:
|
||||
max-same-issues: 50
|
||||
|
||||
linters-settings:
|
||||
lll:
|
||||
line-length: 150
|
||||
dogsled:
|
||||
max-blank-identifiers: 3
|
||||
golint:
|
||||
@@ -71,7 +65,7 @@ linters-settings:
|
||||
require-explanation: false
|
||||
require-specific: false
|
||||
gofumpt:
|
||||
lang-version: "1.17"
|
||||
lang-version: "1.18"
|
||||
gomodguard:
|
||||
blocked:
|
||||
versions: # List of blocked module version constraints
|
||||
@@ -80,4 +74,4 @@ linters-settings:
|
||||
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
|
||||
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
|
||||
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
|
||||
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
|
||||
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
|
||||
@@ -1,78 +1,25 @@
|
||||
<!--
|
||||
parent:
|
||||
order: false
|
||||
-->
|
||||
|
||||
<div align="center">
|
||||
<h1> Ethermint </h1>
|
||||
</div>
|
||||
|
||||

|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/tharsis/ethermint/releases/latest">
|
||||
<img alt="Version" src="https://img.shields.io/github/tag/tharsis/ethermint.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/tharsis/ethermint/blob/main/LICENSE">
|
||||
<img alt="License: Apache-2.0" src="https://img.shields.io/github/license/tharsis/ethermint.svg" />
|
||||
</a>
|
||||
<a href="https://pkg.go.dev/github.com/tharsis/ethermint">
|
||||
<img alt="GoDoc" src="https://godoc.org/github.com/tharsis/ethermint?status.svg" />
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/tharsis/ethermint">
|
||||
<img alt="Go report card" src="https://goreportcard.com/badge/github.com/tharsis/ethermint"/>
|
||||
</a>
|
||||
<a href="https://bestpractices.coreinfrastructure.org/projects/5018">
|
||||
<img alt="Lines of code" src="https://img.shields.io/tokei/lines/github/tharsis/ethermint">
|
||||
</a>
|
||||
</div>
|
||||
<div align="center">
|
||||
<a href="https://discord.gg/trje9XuAmy">
|
||||
<img alt="Discord" src="https://img.shields.io/discord/809048090249134080.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/tharsis/ethermint/actions?query=branch%3Amain+workflow%3ALint">
|
||||
<img alt="Lint Status" src="https://github.com/tharsis/ethermint/actions/workflows/lint.yml/badge.svg?branch=main" />
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/tharsis/ethermint">
|
||||
<img alt="Code Coverage" src="https://codecov.io/gh/tharsis/ethermint/branch/main/graph/badge.svg" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) which runs on top of [Tendermint Core](https://github.com/tendermint/tendermint) consensus engine.
|
||||
# Laconic Network
|
||||
The Source of Proof. Laconic is a next generation data availability & verifiability layer with cryptographic proofs, powering internet-scale Web3 applications, built on Proof-of-Stake with fast-finality using the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) which runs on top of [Tendermint Core](https://github.com/tendermint/tendermint) consensus engine.
|
||||
|
||||
**Note**: Requires [Go 1.17+](https://golang.org/dl/)
|
||||
|
||||
## Installation
|
||||
|
||||
For prerequisites and detailed build instructions please read the Evmos [Installation](https://evmos.dev/quickstart/installation.html) instructions. Once the dependencies are installed, run:
|
||||
|
||||
```bash
|
||||
make install
|
||||
```
|
||||
|
||||
Or check out the latest [release](https://github.com/tharsis/ethermint/releases).
|
||||
|
||||
## Quick Start
|
||||
|
||||
To learn how the Ethermint works from a high-level perspective, go to the [Introduction](https://evmos.dev/intro/overview.html) section from the documentation. You can also check the instructions to [Run a Node](https://evmos.dev/quickstart/run_node.html).
|
||||
|
||||
For an example on how Ethermint can be used on any Cosmos-SDK chain, please refer to [Evmos](https://www.github.com/tharsis/evmos).
|
||||
|
||||
## Community
|
||||
|
||||
The following chat channels and forums are a great spot to ask questions about Ethermint:
|
||||
|
||||
- [Evmos Twitter](https://twitter.com/EvmosOrg)
|
||||
- [Evmos Discord](https://discord.gg/trje9XuAmy)
|
||||
- [Evmos Telegram](https://t.me/EvmosOrg)
|
||||
- [Tharsis Twitter](https://twitter.com/TharsisHQ)
|
||||
- [Laconic Twitter](https://twitter.com/laconicnetwork)
|
||||
- [Discord](https://discord.com/invite/ukhbBemyxY)
|
||||
- [Website](https://laconic.com)
|
||||
|
||||
## Contributing
|
||||
|
||||
Looking for a good place to start contributing? Check out some [`good first issues`](https://github.com/tharsis/ethermint/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
|
||||
Looking for a good place to start contributing? Check out some [`good first issues`](https://github.com/cerc-io/laconicd/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
|
||||
|
||||
For additional instructions, standards and style guides, please refer to the [Contributing](./CONTRIBUTING.md) document.
|
||||
|
||||
## Careers
|
||||
|
||||
See our open positions on [Cosmos Jobs](https://jobs.cosmos.network/project/evmos-d0sk1uxuh-remote/), [Notion](https://tharsis.notion.site), or feel free to [reach out](mailto:careers@thars.is) via email.
|
||||
|
||||
@@ -126,7 +126,6 @@ func (avd EthAccountVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx
|
||||
if err := evmkeeper.CheckSenderBalance(sdk.NewIntFromBigInt(acct.Balance), txData); err != nil {
|
||||
return ctx, sdkerrors.Wrap(err, "failed to check sender balance")
|
||||
}
|
||||
|
||||
}
|
||||
return next(ctx, tx, simulate)
|
||||
}
|
||||
|
||||
+4
-3
@@ -156,8 +156,10 @@ var (
|
||||
mint.AppModuleBasic{},
|
||||
distr.AppModuleBasic{},
|
||||
gov.NewAppModuleBasic(
|
||||
[]govclient.ProposalHandler{paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler,
|
||||
ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler},
|
||||
[]govclient.ProposalHandler{
|
||||
paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler,
|
||||
ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler,
|
||||
},
|
||||
),
|
||||
params.AppModuleBasic{},
|
||||
crisis.AppModuleBasic{},
|
||||
@@ -491,7 +493,6 @@ func NewEthermintApp(
|
||||
transferModule := transfer.NewAppModule(app.TransferKeeper)
|
||||
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)
|
||||
|
||||
//Create static IBC router, add transfer route, then set and seal it
|
||||
ibcRouter := porttypes.NewRouter()
|
||||
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
|
||||
app.IBCKeeper.SetRouter(ibcRouter)
|
||||
|
||||
+2
-3
@@ -121,7 +121,6 @@ func NewTestAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOpti
|
||||
|
||||
// Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp.
|
||||
func Setup(t *testing.T, isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState) *EthermintApp {
|
||||
|
||||
t.Helper()
|
||||
|
||||
privVal := mock.NewPV()
|
||||
@@ -202,7 +201,8 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, patchGen
|
||||
}
|
||||
|
||||
func genesisStateWithValSet(t *testing.T, app *EthermintApp, genesisState simapp.GenesisState,
|
||||
valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) simapp.GenesisState {
|
||||
valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance,
|
||||
) simapp.GenesisState {
|
||||
// set genesis accounts
|
||||
authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
|
||||
genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis)
|
||||
@@ -232,7 +232,6 @@ func genesisStateWithValSet(t *testing.T, app *EthermintApp, genesisState simapp
|
||||
}
|
||||
validators = append(validators, validator)
|
||||
delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec()))
|
||||
|
||||
}
|
||||
// set validators and delegations
|
||||
stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations)
|
||||
|
||||
@@ -40,7 +40,7 @@ func SetBech32Prefixes(config *sdk.Config) {
|
||||
func SetBip44CoinType(config *sdk.Config) {
|
||||
config.SetCoinType(ethermint.Bip44CoinType)
|
||||
config.SetPurpose(sdk.Purpose) // Shared
|
||||
config.SetFullFundraiserPath(ethermint.BIP44HDPath) // nolint: staticcheck
|
||||
config.SetFullFundraiserPath(ethermint.BIP44HDPath) //nolint: staticcheck
|
||||
}
|
||||
|
||||
// RegisterDenoms registers the base and display denominations to the SDK.
|
||||
|
||||
@@ -309,7 +309,6 @@ func traverseFields(
|
||||
}
|
||||
|
||||
if fieldType.Kind() == reflect.Struct {
|
||||
|
||||
var fieldTypedef string
|
||||
|
||||
if isCollection {
|
||||
|
||||
@@ -125,7 +125,6 @@ func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueI
|
||||
All: (all != nil && *all),
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -142,7 +141,6 @@ func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueI
|
||||
}
|
||||
|
||||
return gqlResponse, nil
|
||||
|
||||
}
|
||||
|
||||
func (q queryResolver) GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error) {
|
||||
|
||||
+2
-1
@@ -2,12 +2,13 @@ package gql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/99designs/gqlgen/graphql/handler"
|
||||
"github.com/99designs/gqlgen/graphql/playground"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/spf13/viper"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Server configures and starts the GQL server.
|
||||
|
||||
@@ -38,6 +38,7 @@ func getGQLCoins(coins sdk.Coins) []*Coin {
|
||||
|
||||
return gqlCoins
|
||||
}
|
||||
|
||||
func GetGQLNameAuthorityRecord(record *nstypes.NameAuthority) (*AuthorityRecord, error) {
|
||||
if record == nil {
|
||||
return nil, nil
|
||||
|
||||
@@ -55,7 +55,6 @@ func (e *EVMBackend) SetTxDefaults(args evmtypes.TransactionArgs) (evmtypes.Tran
|
||||
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
|
||||
return args, fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
|
||||
}
|
||||
|
||||
} else {
|
||||
if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil {
|
||||
return args, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
|
||||
|
||||
@@ -284,7 +284,7 @@ func (a *API) BlockProfile(file string, nsec uint) error {
|
||||
|
||||
// CpuProfile turns on CPU profiling for nsec seconds and writes
|
||||
// profile data to file.
|
||||
func (a *API) CpuProfile(file string, nsec uint) error { // nolint: golint, stylecheck, revive
|
||||
func (a *API) CpuProfile(file string, nsec uint) error { //nolint: golint, stylecheck, revive
|
||||
a.logger.Debug("debug_cpuProfile", "file", file, "nsec", nsec)
|
||||
if err := a.StartCPUProfile(file); err != nil {
|
||||
return err
|
||||
|
||||
@@ -127,7 +127,7 @@ func (e *PublicAPI) ProtocolVersion() hexutil.Uint {
|
||||
}
|
||||
|
||||
// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
|
||||
func (e *PublicAPI) ChainId() (*hexutil.Big, error) { // nolint
|
||||
func (e *PublicAPI) ChainId() (*hexutil.Big, error) { //nolint
|
||||
e.logger.Debug("eth_chainId")
|
||||
// if current block is at or past the EIP-155 replay-protection fork block, return chainID from config
|
||||
bn, err := e.backend.BlockNumber()
|
||||
|
||||
@@ -45,7 +45,7 @@ func NewRangeFilter(logger log.Logger, backend Backend, begin, end int64, addres
|
||||
// Flatten the address and topic filter clauses into a single bloombits filter
|
||||
// system. Since the bloombits are not positional, nil topics are permitted,
|
||||
// which get flattened into a nil byte slice.
|
||||
var filtersBz [][][]byte // nolint: prealloc
|
||||
var filtersBz [][][]byte //nolint: prealloc
|
||||
if len(addresses) > 0 {
|
||||
filter := make([][]byte, len(addresses))
|
||||
for i, address := range addresses {
|
||||
|
||||
@@ -82,7 +82,6 @@ func MountGRPCWebServices(
|
||||
logger tmlog.Logger,
|
||||
) {
|
||||
for _, res := range grpcResources {
|
||||
|
||||
logger.Info("[GRPC Web] HTTP POST mounted", "resource", res)
|
||||
|
||||
s := router.Methods("POST").Subrouter()
|
||||
|
||||
@@ -88,7 +88,7 @@ server_name: chibaclonkd
|
||||
**Not required if you have already initialized before**
|
||||
|
||||
```
|
||||
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-1
|
||||
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-2
|
||||
```
|
||||
|
||||
On running the above command, node will be initialized with default configuration. (config files will be saved in node's
|
||||
|
||||
+144
-101
@@ -1,42 +1,51 @@
|
||||
# Setting up a Genesis Validator for Vulcanize chibaclonk Testnet (chibaclonk_81337-1)
|
||||
# Validator Guide for chibaclonk_81337-4 Testnet
|
||||
|
||||
Hardware
|
||||
---
|
||||
## Hardware Prerequisites
|
||||
|
||||
#### Supported
|
||||
### Supported
|
||||
|
||||
- **Operating System (OS):** Ubuntu 20.04
|
||||
- **CPU:** 1 core
|
||||
- **RAM:** 2GB
|
||||
- **Storage:** 25GB SSD
|
||||
|
||||
#### Recommended
|
||||
### Recommended
|
||||
|
||||
- **Operating System (OS):** Ubuntu 20.04
|
||||
- **CPU:** 2 core
|
||||
- **RAM:** 4GB
|
||||
- **Storage:** 50GB SSD
|
||||
|
||||
# A) Setup
|
||||
## Network Prerequisites
|
||||
|
||||
## 1) Install Golang (go)
|
||||
- **TCP 26656** for Peer-to-Peer Network Communication
|
||||
- **TCP 26660** for Prometheus Metrics (doesn't have to be exposed publicly)
|
||||
|
||||
1.1) Remove any existing installation of `go`
|
||||
# Validator Setup
|
||||
|
||||
## Install required software packages
|
||||
|
||||
```sh
|
||||
# Update Ubuntu
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Install required software packages
|
||||
sudo apt install git curl build-essential make jq -y
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Install Go
|
||||
|
||||
```sh
|
||||
# Remove any existing installation of `go`
|
||||
sudo rm -rf /usr/local/go
|
||||
```
|
||||
|
||||
1.2) Install latest/required Go version (installing `go1.17.2`)
|
||||
# Install Go version 1.17.2
|
||||
curl https://dl.google.com/go/go1.17.2.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
|
||||
|
||||
```
|
||||
curl -O https://golang.org/dl/go1.17.2.linux-amd64.tar.gz
|
||||
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
1.3) Update env variables to include `go`
|
||||
|
||||
```
|
||||
# Update env variables to include go
|
||||
cat <<'EOF' >>$HOME/.profile
|
||||
export GOROOT=/usr/local/go
|
||||
export GOPATH=$HOME/go
|
||||
@@ -47,131 +56,168 @@ EOF
|
||||
source $HOME/.profile
|
||||
```
|
||||
|
||||
1.4) Check the version of go installed
|
||||
Check the version of go installed
|
||||
|
||||
```
|
||||
```sh
|
||||
go version
|
||||
|
||||
# Should return something like: go version go1.17.2 linux/amd64
|
||||
```
|
||||
|
||||
### 2) Install required software packages
|
||||
---
|
||||
|
||||
```
|
||||
sudo apt-get update && sudo apt-get install git curl build-essential make jq -y
|
||||
```
|
||||
## Install `chibaclonk`
|
||||
|
||||
### 3) Install `chibaclonk`
|
||||
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/vulcanize/chiba-clonk.git
|
||||
cd chiba-clonk
|
||||
|
||||
# Checkout main branch
|
||||
git fetch --all
|
||||
git checkout main
|
||||
|
||||
# Build and install chibaclonk
|
||||
make install
|
||||
```
|
||||
|
||||
### 4) Verify your installation
|
||||
Verify your installation
|
||||
|
||||
```
|
||||
```sh
|
||||
chibaclonkd version --long
|
||||
```
|
||||
|
||||
On running the above command, you should see a similar response like this. Make sure that the *version* and *commit
|
||||
hash* are accurate
|
||||
|
||||
```
|
||||
```sh
|
||||
name: chibaclonk
|
||||
server_name: chibaclonkd
|
||||
```
|
||||
|
||||
### 5) Initialize Node
|
||||
---
|
||||
|
||||
## Initialize Validator Node
|
||||
|
||||
**Not required if you have already initialized before**
|
||||
|
||||
```
|
||||
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-1
|
||||
```sh
|
||||
# Initialize the validator node
|
||||
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-4
|
||||
```
|
||||
|
||||
On running the above command, node will be initialized with default configuration. (config files will be saved in node's
|
||||
default home directory (~/.chibaclonkd/config)
|
||||
Running the above commands will initialize the validator node with default configuration. The config files will be saved in the default location (`~/.chibaclonkd/config`).
|
||||
|
||||
NOTE: Backup node and validator keys. You will need to use these keys at a later point in time.
|
||||
**NOTE:** Backup your node and validator keys. You will need to use these keys at a later point in time.
|
||||
|
||||
---
|
||||
|
||||
## 6) Create Account keys
|
||||
## Overwrite Validator Initialization from previous testnet
|
||||
|
||||
if you have participated in previous testnet and have mnemonic phrase, use below command to recover your account
|
||||
**Required for `chibaclonk_81337-4`**
|
||||
|
||||
First we have to reset the previous genesis state (only because the `chibaclonk_81337-3` testnet failed) whereafter we can initialize the validator node for `chibaclonk_81337-4`
|
||||
|
||||
```sh
|
||||
# Stop your node (in case it was still running)
|
||||
systemctl stop chibaclonkd
|
||||
|
||||
# Keep a backup of your old validator directory
|
||||
cp -a ~/.chibaclonkd ~/backup-chibaclonk_81337-2
|
||||
|
||||
# Reset the state of your validator
|
||||
chibaclonkd tendermint unsafe-reset-all --home $HOME/.chibaclonkd
|
||||
|
||||
# Remove your previous genesis transactions
|
||||
rm $HOME/.chibaclonkd/config/gentx/gentx*.json
|
||||
|
||||
# Overwrite your genesis state with the new chain-id
|
||||
chibaclonkd init --overwrite <your-node-moniker> --chain-id chibaclonk_81337-4
|
||||
```
|
||||
|
||||
Running the above commands will re-initialize the validator node with default configuration. The config files will be saved in the default location (`~/.chibaclonkd/config`).
|
||||
|
||||
**NOTE:** Backup your node and validator keys. You will need to use these keys at a later point in time.
|
||||
|
||||
---
|
||||
|
||||
## Create Account keys
|
||||
|
||||
If you have participated in a previous testnet and have a mnemonic phrase, use below command to recover your account:
|
||||
|
||||
```sh
|
||||
chibaclonkd keys add <key-name> --recover
|
||||
```
|
||||
|
||||
to create new account
|
||||
To create a new account use:
|
||||
|
||||
```
|
||||
```sh
|
||||
chibaclonkd keys add <key-name>
|
||||
```
|
||||
|
||||
NOTE: Save `mnemonic` and related account details (public key). You will need to use the need mnemonic/private key to
|
||||
recover accounts at a later point in time.
|
||||
**NOTE:** Save the `mnemonic` and related account details (public key). You will need to use the mnemonic and / or private key to recover accounts at a later point in time.
|
||||
|
||||
## 7) Add Genesis Account
|
||||
**Note: don't add more than 12,000 CHK , if you add more than that, your gentx will be ignored.**
|
||||
```
|
||||
chibaclonkd add-genesis-account <key-name> 12000000000000000000000achk --keyring-backend os
|
||||
---
|
||||
|
||||
## Add Genesis Account
|
||||
|
||||
**NOTE:** Don't add more than 12,900 CHK , if you add more than that, your gentx will be ignored.
|
||||
|
||||
```sh
|
||||
chibaclonkd add-genesis-account <key-name> 12900000000000000000000achk --keyring-backend os
|
||||
```
|
||||
|
||||
## 8) Create Your `gentx`
|
||||
Create Your `gentx` transaction file
|
||||
|
||||
```
|
||||
chibaclonkd gentx <key-name> 12000000000000000000000achk \
|
||||
```sh
|
||||
chibaclonkd gentx <key-name> 12900000000000000000000achk \
|
||||
--pubkey=$(chibaclonkd tendermint show-validator) \
|
||||
--chain-id="chibaclonk_81337-1" \
|
||||
--moniker="YOUR_MONIKER_NAME" \
|
||||
--website="https://yourweb.site" \
|
||||
--details="description of my validator" \
|
||||
--chain-id="chibaclonk_81337-4" \
|
||||
--moniker="<your-moniker-name>" \
|
||||
--website="<your-validator-website>" \
|
||||
--details="<your-validator-description>" \
|
||||
--identity="<your-keybase-public-key>" \
|
||||
--commission-rate="0.10" \
|
||||
--commission-max-rate="0.20" \
|
||||
--commission-max-change-rate="0.01" \
|
||||
--min-self-delegation="1"
|
||||
```
|
||||
|
||||
Note:
|
||||
**NOTE:**
|
||||
|
||||
- `<key-name>` and `chain-id` are required. other flags are optional
|
||||
- Don't change amount value while creating your gentx
|
||||
- Don't change the amount value while creating your gentx
|
||||
- Genesis transaction file will be saved in `~/.chibaclonkd/config/gentx` folder
|
||||
|
||||
## 9) Submit Your gentx
|
||||
|
||||
Submit your `gentx` file to the [testnets]() in the format of
|
||||
`<validator-moniker>-gentx.json`
|
||||
|
||||
NOTE: (Do NOT use space in the file name)
|
||||
|
||||
To submit the gentx file, follow the below process:
|
||||
|
||||
- Fork the [testnets]() repository
|
||||
- Upload your gentx file in `chibaclonk_81337-1/config/gentxs` folder
|
||||
- Submit Pull Request to [testnets]() with name `ADD <your-moniker> gentx`
|
||||
|
||||
---
|
||||
|
||||
**Execute below instructions only after publishing of final genesis file**
|
||||
## Submit Your gentx
|
||||
|
||||
genesis file will be published to [testnets/chibaclonk_9000-1]()
|
||||
Submit your `gentx` file to the [https://github.com/vulcanize/laconic-testnet]() repository in the following format:
|
||||
`<validator-moniker>-gentx.json`
|
||||
|
||||
# B) Starting the validator
|
||||
**NOTE:** (Do NOT use spaces in the file name)
|
||||
|
||||
TBU
|
||||
To submit the gentx file, follow the below process:
|
||||
|
||||
## 3) Start the Node
|
||||
- Fork the [https://github.com/vulcanize/laconic-testnet]() repository
|
||||
- Upload your gentx file in the `chibaclonk_81337-4/config/gentxs` folder
|
||||
- Submit Pull Request to [https://github.com/vulcanize/laconic-testnet]() with name `ADD <your-moniker> gentx`
|
||||
|
||||
#### 3.1) Start node as `systemctl` service
|
||||
The genesis file will be published in the `chibaclonk_81337-4/config/` folder within the [https://github.com/vulcanize/laconic-testnet]() repository.
|
||||
|
||||
3.1.1) Create the service file Note: this step is not required if you did setup before
|
||||
# CONTINUE WITH BELOW STEPS ONLY AFTER GENESIS FILE HAS BEEN PUBLISHED
|
||||
|
||||
```
|
||||
## Adjust validator node configuration
|
||||
|
||||
```sh
|
||||
# Set seed & peers variable
|
||||
seeds="<seeds node list here>"
|
||||
peers="<peers node list here>"
|
||||
|
||||
# Update seeds, persistent_peers and prometheus parameters in config.toml
|
||||
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/; s/^prometheus *=.*/prometheus = true/" $HOME/.chibaclonkd/config/config.toml
|
||||
|
||||
# Create systemd validator service
|
||||
sudo tee /etc/systemd/system/chibaclonkd.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=chibaclonkd Daemon
|
||||
@@ -179,7 +225,7 @@ After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=$USER
|
||||
ExecStart=$(which chibaclonkd) start
|
||||
ExecStart=$(which chibaclonkd) start --mode validator --gql-playground --gql-server --log_level=warn
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
LimitNOFILE=65535
|
||||
@@ -187,45 +233,42 @@ LimitNOFILE=65535
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
```
|
||||
|
||||
3.1.2) Load service and start
|
||||
|
||||
```
|
||||
#Reload systemd and start the validator node
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable chibaclonkd
|
||||
sudo systemctl start chibaclonkd
|
||||
```
|
||||
|
||||
3.1.3) Check status of service
|
||||
Check status of service
|
||||
|
||||
```
|
||||
```sh
|
||||
sudo systemctl status chibaclonkd
|
||||
```
|
||||
|
||||
`NOTE:`
|
||||
A helpful command here is `journalctl` that can be used to:
|
||||
---
|
||||
|
||||
a) check logs
|
||||
## Helpful Commands
|
||||
|
||||
```
|
||||
journalctl -u chibaclonkd
|
||||
```
|
||||
```sh
|
||||
# Check logs
|
||||
journalctl -u chibaclonkd
|
||||
|
||||
b) most recent logs
|
||||
# Most recent logs
|
||||
journalctl -xeu chibaclonkd
|
||||
|
||||
```
|
||||
journalctl -xeu chibaclonkd
|
||||
```
|
||||
# Logs from previous day
|
||||
journalctl --since "1 day ago" -u chibaclonkd
|
||||
|
||||
c) logs from previous day
|
||||
# Check logs with follow flag
|
||||
journalctl -f -u chibaclonkd
|
||||
|
||||
```
|
||||
journalctl --since "1 day ago" -u chibaclonkd
|
||||
```
|
||||
# Check discovered peers
|
||||
curl http://localhost:26657/net_info
|
||||
|
||||
d) Check logs with follow flag
|
||||
# Check network consensus state
|
||||
curl http://localhost:26657/consensus_state
|
||||
|
||||
```
|
||||
journalctl -f -u chibaclonkd
|
||||
```
|
||||
# Check the sync status of your validator node
|
||||
chibaclonkd status | jq .SyncInfo
|
||||
```
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
### 1.Run Full Node
|
||||
|
||||
- Check "[Run Full Node](full-node.md)" section to Run a Full Node
|
||||
- Check "[Run Full Node](full_node.md)" section to Run a Full Node
|
||||
|
||||
### 2. Create Account & Get test tokens
|
||||
|
||||
@@ -42,7 +42,7 @@ chibaclonkd tx staking create-validator \
|
||||
--moniker="my-moniker" \
|
||||
--website="https://myweb.site" \
|
||||
--details="description of your validator" \
|
||||
--chain-id="chibaclonk_81337-1" \
|
||||
--chain-id="chibaclonk_81337-2" \
|
||||
--commission-rate="0.10" \
|
||||
--commission-max-rate="0.20" \
|
||||
--commission-max-change-rate="0.01" \
|
||||
|
||||
@@ -431,7 +431,6 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
|
||||
stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()),
|
||||
sdk.OneInt(),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -253,12 +253,12 @@ func WriteFile(name string, dir string, contents []byte) error {
|
||||
writePath := filepath.Join(dir)
|
||||
file := filepath.Join(writePath, name)
|
||||
|
||||
err := tmos.EnsureDir(writePath, 0755)
|
||||
err := tmos.EnsureDir(writePath, 0o755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(file, contents, 0644) // nolint: gosec
|
||||
err = ioutil.WriteFile(file, contents, 0o644) //nolint: gosec
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ func GenerateHash(json map[string]interface{}) (string, []byte, error) {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
//cid, err := CIDFromJSONBytes(content)
|
||||
cidString, err := CIDFromJSONBytesUsingIpldPrime(content)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ func GenerateMnemonic() (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
mnemonic, err := bip39.NewMnemonic(entropySeed[:])
|
||||
mnemonic, err := bip39.NewMnemonic(entropySeed)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ func GetCmdCommitBid() *cobra.Command {
|
||||
}
|
||||
|
||||
// Save reveal file.
|
||||
ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0600)
|
||||
ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0o600)
|
||||
|
||||
msg := types.NewMsgCommitBid(auctionID, commitHash, clientCtx.GetFromAddress())
|
||||
err = msg.ValidateBasic()
|
||||
|
||||
@@ -382,7 +382,7 @@ func (k Keeper) CommitBid(ctx sdk.Context, msg types.MsgCommitBid) (*types.Bid,
|
||||
return &bid, nil
|
||||
}
|
||||
|
||||
// RevealBid reeals a bid comitted earlier.
|
||||
// RevealBid reeals a bid committed earlier.
|
||||
func (k Keeper) RevealBid(ctx sdk.Context, msg types.MsgRevealBid) (*types.Auction, error) {
|
||||
if !k.HasAuction(ctx, msg.AuctionId) {
|
||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Auction not found.")
|
||||
@@ -561,7 +561,6 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) {
|
||||
|
||||
ctx.Logger().Info(fmt.Sprintf("Updated 1st bid %s %s", highestBid.BidderAddress, highestBid.BidAmount.String()))
|
||||
ctx.Logger().Info(fmt.Sprintf("Updated 2nd bid %s %s", secondHighestBid.BidderAddress, secondHighestBid.BidAmount.String()))
|
||||
|
||||
} else if secondHighestBid == nil || secondHighestBid.BidAmount.IsLT(bid.BidAmount) {
|
||||
ctx.Logger().Info(fmt.Sprintf("New 2nd highest bid %s %s", bid.BidderAddress, bid.BidAmount.String()))
|
||||
|
||||
@@ -588,7 +587,6 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) {
|
||||
ctx.Logger().Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddress))
|
||||
ctx.Logger().Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBid.String()))
|
||||
ctx.Logger().Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String()))
|
||||
|
||||
} else {
|
||||
ctx.Logger().Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id))
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ func (s msgServer) CommitBid(c context.Context, msg *types.MsgCommitBid) (*types
|
||||
return &types.MsgCommitBidResponse{Bid: resp}, nil
|
||||
}
|
||||
|
||||
//RevealBid is the command for revealing a bid
|
||||
func (s msgServer) RevealBid(c context.Context, msg *types.MsgRevealBid) (*types.MsgRevealBidResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEnc
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
|
||||
}
|
||||
// Once json successfully marshalled, passes along to genesis.go
|
||||
// Once json successfully marshaled, passes along to genesis.go
|
||||
return ValidateGenesis(data)
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ func (msg MsgCreateAuction) GetSigners() []sdk.AccAddress {
|
||||
|
||||
// NewMsgCommitBid is the constructor function for MsgCommitBid.
|
||||
func NewMsgCommitBid(auctionID string, commitHash string, signer sdk.AccAddress) MsgCommitBid {
|
||||
|
||||
return MsgCommitBid{
|
||||
AuctionId: auctionID,
|
||||
CommitHash: commitHash,
|
||||
@@ -107,7 +106,6 @@ func (msg MsgCommitBid) GetSigners() []sdk.AccAddress {
|
||||
|
||||
// NewMsgRevealBid is the constructor function for MsgRevealBid.
|
||||
func NewMsgRevealBid(auctionID string, reveal string, signer sdk.AccAddress) MsgRevealBid {
|
||||
|
||||
return MsgRevealBid{
|
||||
AuctionId: auctionID,
|
||||
Reveal: reveal,
|
||||
|
||||
@@ -104,7 +104,7 @@ func WithdrawBondCmd() *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
// CancelBondCmd is the CLI command for cancelling a bond.
|
||||
// CancelBondCmd is the CLI command for canceling a bond.
|
||||
func CancelBondCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "cancel [bond Id]",
|
||||
|
||||
@@ -28,7 +28,6 @@ func (s *IntegrationTestSuite) TestGRPCGetBonds() {
|
||||
true,
|
||||
"",
|
||||
func() {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -87,7 +86,6 @@ func (s *IntegrationTestSuite) TestGRPCGetBondsByOwner() {
|
||||
fmt.Sprintf(reqUrl, "asdasd"),
|
||||
true,
|
||||
func() {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -251,7 +251,6 @@ func (s *IntegrationTestSuite) TestGetQueryBondListsByOwner() {
|
||||
},
|
||||
true,
|
||||
func() {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import (
|
||||
// InitGenesis initializes genesis state based on exported genesis
|
||||
func InitGenesis(
|
||||
ctx sdk.Context,
|
||||
k keeper.Keeper, data types.GenesisState) []abci.ValidatorUpdate {
|
||||
|
||||
k keeper.Keeper, data types.GenesisState,
|
||||
) []abci.ValidatorUpdate {
|
||||
k.SetParams(ctx, data.Params)
|
||||
|
||||
for _, bond := range data.Bonds {
|
||||
|
||||
@@ -2,6 +2,7 @@ package keeper
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/tharsis/ethermint/x/bond/types"
|
||||
)
|
||||
|
||||
@@ -2,6 +2,7 @@ package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/tharsis/ethermint/x/bond/types"
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
|
||||
@@ -3,6 +3,7 @@ package types
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
)
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ func (log *Log) ToEthereum() *ethtypes.Log {
|
||||
}
|
||||
|
||||
func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log {
|
||||
var logs []*Log // nolint: prealloc
|
||||
var logs []*Log //nolint: prealloc
|
||||
for _, ethlog := range ethlogs {
|
||||
logs = append(logs, NewLogFromEth(ethlog))
|
||||
}
|
||||
@@ -99,7 +99,7 @@ func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log {
|
||||
|
||||
// LogsToEthereum casts the Ethermint Logs to a slice of Ethereum Logs.
|
||||
func LogsToEthereum(logs []*Log) []*ethtypes.Log {
|
||||
var ethLogs []*ethtypes.Log // nolint: prealloc
|
||||
var ethLogs []*ethtypes.Log //nolint: prealloc
|
||||
for i := range logs {
|
||||
ethLogs = append(ethLogs, logs[i].ToEthereum())
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const (
|
||||
// prefix bytes for the feemarket persistent store
|
||||
const (
|
||||
prefixBlockGasUsed = iota + 1
|
||||
deprecatedPrefixBaseFee // nolint
|
||||
deprecatedPrefixBaseFee //nolint
|
||||
)
|
||||
|
||||
// KVStore key prefixes
|
||||
|
||||
@@ -266,7 +266,6 @@ $ %s query %s query-by-bond [bond id]
|
||||
return err
|
||||
}
|
||||
return clientCtx.PrintProto(res)
|
||||
|
||||
},
|
||||
}
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
|
||||
@@ -371,7 +371,6 @@ $ %s tx %s delete-name [crn]
|
||||
return cmd
|
||||
}
|
||||
|
||||
//GetPayloadFromFile Load payload object from YAML file.
|
||||
func GetPayloadFromFile(filePath string) (*types.PayloadType, error) {
|
||||
var payload types.PayloadType
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/whois/%s"
|
||||
var authorityName = "QueryWhoIS"
|
||||
authorityName := "QueryWhoIS"
|
||||
testCases := []struct {
|
||||
name string
|
||||
url string
|
||||
@@ -78,7 +78,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
||||
true,
|
||||
"",
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -132,7 +131,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/lookup?crn=%s"
|
||||
var authorityName = "QueryLookUp"
|
||||
authorityName := "QueryLookUp"
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
@@ -147,7 +146,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
||||
true,
|
||||
"",
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -199,7 +197,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
||||
true,
|
||||
"",
|
||||
func(bondId string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -271,7 +268,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
||||
true,
|
||||
"",
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -307,7 +303,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
||||
if !tc.expectErr {
|
||||
tc.preRun("QueryAuthorityExpiryQueue")
|
||||
}
|
||||
// wait 12 seconds to name authorites expires
|
||||
// wait 12 seconds to name authorities expires
|
||||
time.Sleep(time.Second * 12)
|
||||
|
||||
resp, _ := rest.GetRequest(tc.url)
|
||||
@@ -343,7 +339,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
||||
true,
|
||||
"",
|
||||
func(bondId string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -483,7 +478,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
||||
true,
|
||||
"",
|
||||
func(bondId string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -538,7 +532,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
|
||||
true,
|
||||
"",
|
||||
func(bondId string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -590,7 +583,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
||||
true,
|
||||
"",
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -66,7 +66,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
||||
true,
|
||||
0,
|
||||
func() {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -235,7 +234,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
||||
func (s *IntegrationTestSuite) TestGetCmdWhoIs() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "test2"
|
||||
authorityName := "test2"
|
||||
testCases := []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -249,7 +248,6 @@ func (s *IntegrationTestSuite) TestGetCmdWhoIs() {
|
||||
true,
|
||||
1,
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -306,7 +304,7 @@ func (s *IntegrationTestSuite) TestGetCmdWhoIs() {
|
||||
func (s *IntegrationTestSuite) TestGetCmdLookupCRN() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "test1"
|
||||
authorityName := "test1"
|
||||
testCases := []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -320,7 +318,6 @@ func (s *IntegrationTestSuite) TestGetCmdLookupCRN() {
|
||||
true,
|
||||
0,
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -400,7 +397,7 @@ func (s *IntegrationTestSuite) TestGetCmdLookupCRN() {
|
||||
func (s *IntegrationTestSuite) GetRecordExpiryQueue() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "GetRecordExpiryQueue"
|
||||
authorityName := "GetRecordExpiryQueue"
|
||||
|
||||
testCasesForRecordsExpiry := []struct {
|
||||
name string
|
||||
@@ -415,7 +412,6 @@ func (s *IntegrationTestSuite) GetRecordExpiryQueue() {
|
||||
true,
|
||||
0,
|
||||
func(authorityName string, s *IntegrationTestSuite) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -451,10 +447,11 @@ func (s *IntegrationTestSuite) GetRecordExpiryQueue() {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationTestSuite) TestGetAuthorityExpiryQueue() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "TestGetAuthorityExpiryQueue"
|
||||
authorityName := "TestGetAuthorityExpiryQueue"
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
@@ -467,7 +464,6 @@ func (s *IntegrationTestSuite) TestGetAuthorityExpiryQueue() {
|
||||
[]string{"invalid", fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
true,
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
|
||||
func (s *IntegrationTestSuite) SetupSuite() {
|
||||
s.T().Log("setting up integration test suite")
|
||||
|
||||
var genesisState = s.cfg.GenesisState
|
||||
genesisState := s.cfg.GenesisState
|
||||
var nsData nstypes.GenesisState
|
||||
s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[nstypes.ModuleName], &nsData))
|
||||
|
||||
@@ -222,7 +222,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
||||
func (s *IntegrationTestSuite) TestGetCmdReserveName() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "testtest"
|
||||
authorityName := "testtest"
|
||||
testCases := []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -289,7 +289,7 @@ func (s *IntegrationTestSuite) TestGetCmdReserveName() {
|
||||
func (s *IntegrationTestSuite) TestGetCmdSetName() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "TestGetCmdSetName"
|
||||
authorityName := "TestGetCmdSetName"
|
||||
testCases := []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -307,7 +307,6 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
|
||||
},
|
||||
true,
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -394,7 +393,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
|
||||
func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "TestGetCmdSetAuthorityBond"
|
||||
authorityName := "TestGetCmdSetAuthorityBond"
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
@@ -413,7 +412,6 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
||||
},
|
||||
true,
|
||||
func(authorityName string) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -480,7 +478,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
||||
func (s *IntegrationTestSuite) TestGetCmdDeleteName() {
|
||||
val := s.network.Validators[0]
|
||||
sr := s.Require()
|
||||
var authorityName = "TestGetCmdDeleteName"
|
||||
authorityName := "TestGetCmdDeleteName"
|
||||
testCasesForDeletingName := []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -498,7 +496,6 @@ func (s *IntegrationTestSuite) TestGetCmdDeleteName() {
|
||||
},
|
||||
true,
|
||||
func(authorityName string, s *IntegrationTestSuite) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -564,7 +561,6 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
||||
return ""
|
||||
},
|
||||
func(recordId string, s *IntegrationTestSuite) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -659,7 +655,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
||||
}
|
||||
|
||||
//
|
||||
//func (s *IntegrationTestSuite) TestGetCmdDissociateRecords() {
|
||||
// func (s *IntegrationTestSuite) TestGetCmdDissociateRecords() {
|
||||
// val := s.network.Validators[0]
|
||||
// sr := s.Require()
|
||||
// testCasesForDeletingName := []struct {
|
||||
@@ -807,7 +803,6 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
||||
return "", ""
|
||||
},
|
||||
func(recordId, bondId string, s *IntegrationTestSuite) {
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -17,7 +17,6 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState)
|
||||
|
||||
// Add to record expiry queue if expiry time is in the future.
|
||||
expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -33,7 +32,6 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState)
|
||||
}
|
||||
|
||||
for _, authority := range data.Authorities {
|
||||
//Only import authorities that are marked active.
|
||||
if authority.Entry.Status == types.AuthorityActive {
|
||||
keeper.SetNameAuthority(ctx, authority.Name, authority.Entry)
|
||||
|
||||
|
||||
@@ -7,11 +7,10 @@ import (
|
||||
"encoding/gob"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
set "github.com/deckarep/golang-set"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
|
||||
"sort"
|
||||
|
||||
set "github.com/deckarep/golang-set"
|
||||
wnsUtils "github.com/tharsis/ethermint/utils"
|
||||
)
|
||||
|
||||
func StringToBytes(val string) []byte {
|
||||
@@ -62,7 +61,6 @@ func MarshalMapToJSONBytes(val map[string]interface{}) (bytes []byte) {
|
||||
func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} {
|
||||
var val map[string]interface{}
|
||||
err := json.Unmarshal(bytes, &val)
|
||||
|
||||
if err != nil {
|
||||
panic("Marshal error.")
|
||||
}
|
||||
@@ -72,12 +70,7 @@ func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} {
|
||||
|
||||
// GetCid gets the content ID.
|
||||
func GetCid(content []byte) (string, error) {
|
||||
node, err := cbor.FromJSON(bytes.NewReader(content), mh.SHA2_256, -1)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return node.Cid().String(), nil
|
||||
return wnsUtils.CIDFromJSONBytesUsingIpldPrime(content)
|
||||
}
|
||||
|
||||
// BytesToBase64 encodes a byte array as a base64 string.
|
||||
|
||||
@@ -15,8 +15,8 @@ func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) {
|
||||
// (2) associated bond exists, if bondID is not null.
|
||||
func RecordInvariants(k Keeper) sdk.Invariant {
|
||||
return func(ctx sdk.Context) (string, bool) {
|
||||
//store := ctx.KVStore(k.storeKey)
|
||||
//itr := sdk.KVStorePrefixIterator(store, PrefixCIDToRecordIndex)
|
||||
// store := ctx.KVStore(k.storeKey)
|
||||
// itr := sdk.KVStorePrefixIterator(store, PrefixCIDToRecordIndex)
|
||||
//defer itr.Close()
|
||||
//for ; itr.Valid(); itr.Next() {
|
||||
// bz := store.Get(itr.Key())
|
||||
|
||||
@@ -73,7 +73,8 @@ type Keeper struct {
|
||||
|
||||
// NewKeeper creates new instances of the nameservice Keeper
|
||||
func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, recordKeeper RecordKeeper,
|
||||
bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace) Keeper {
|
||||
bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace,
|
||||
) Keeper {
|
||||
// set KeyTable if it has not already been set
|
||||
if !ps.HasKeyTable() {
|
||||
ps = ps.WithKeyTable(types.ParamKeyTable())
|
||||
@@ -295,7 +296,6 @@ func (k Keeper) GetRecordExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Ti
|
||||
// InsertRecordExpiryQueue inserts a record CID to the appropriate timeslice in the record expiry queue.
|
||||
func (k Keeper) InsertRecordExpiryQueue(ctx sdk.Context, val types.Record) {
|
||||
expiryTime, err := time.Parse(time.RFC3339, val.ExpiryTime)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -308,7 +308,6 @@ func (k Keeper) InsertRecordExpiryQueue(ctx sdk.Context, val types.Record) {
|
||||
// DeleteRecordExpiryQueue deletes a record CID from the record expiry queue.
|
||||
func (k Keeper) DeleteRecordExpiryQueue(ctx sdk.Context, record types.Record) {
|
||||
expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -344,7 +343,6 @@ func (k Keeper) GetAllExpiredRecords(ctx sdk.Context, currTime time.Time) (expir
|
||||
|
||||
for ; itr.Valid(); itr.Next() {
|
||||
timeslice, err := helpers.BytesArrToStringArr(itr.Value())
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -426,7 +424,6 @@ func recordObjToRecord(store sdk.KVStore, codec codec.BinaryCodec, record types.
|
||||
|
||||
if store.Has(reverseNameIndexKey) {
|
||||
names, err := helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey))
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -653,7 +653,6 @@ func (k Keeper) GetAllExpiredAuthorities(ctx sdk.Context, currTime time.Time) (e
|
||||
for ; itr.Valid(); itr.Next() {
|
||||
timeslice := []string{}
|
||||
timeslice, err := helpers.BytesArrToStringArr(itr.Value())
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -162,7 +162,6 @@ func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) er
|
||||
// Check if renewal is required (i.e. expired record marked as deleted).
|
||||
record := k.GetRecord(ctx, msg.RecordId)
|
||||
expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -182,7 +181,6 @@ func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) er
|
||||
|
||||
// ProcessAssociateBond associates a record with a bond.
|
||||
func (k Keeper) ProcessAssociateBond(ctx sdk.Context, msg types.MsgAssociateBond) error {
|
||||
|
||||
if !k.HasRecord(ctx, msg.RecordId) {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record not found.")
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
@@ -105,7 +106,6 @@ func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier {
|
||||
}
|
||||
|
||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||
|
||||
querier := keeper.Querier{Keeper: am.keeper}
|
||||
types.RegisterQueryServer(cfg.QueryServer(), querier)
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ func (msg MsgSetName) Type() string { return "set-name" }
|
||||
|
||||
// ValidateBasic Implements Msg.
|
||||
func (msg MsgSetName) ValidateBasic() error {
|
||||
|
||||
if msg.Crn == "" {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "CRN is required.")
|
||||
}
|
||||
@@ -76,7 +75,6 @@ func (msg MsgReserveAuthority) Type() string { return "reserve-authority" }
|
||||
|
||||
// ValidateBasic Implements Msg.
|
||||
func (msg MsgReserveAuthority) ValidateBasic() error {
|
||||
|
||||
if len(msg.Name) == 0 {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name is required.")
|
||||
}
|
||||
|
||||
@@ -3,9 +3,10 @@ package types
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Default parameter values.
|
||||
@@ -75,8 +76,8 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
||||
func NewParams(recordRent sdk.Coin, recordRentDuration time.Duration,
|
||||
authorityRent sdk.Coin, authorityRentDuration time.Duration, authorityGracePeriod time.Duration,
|
||||
authorityAuctionEnabled bool, commitsDuration time.Duration, revealsDuration time.Duration,
|
||||
commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params {
|
||||
|
||||
commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin,
|
||||
) Params {
|
||||
return Params{
|
||||
RecordRent: recordRent,
|
||||
RecordRentDuration: recordRentDuration,
|
||||
|
||||
@@ -22,7 +22,7 @@ type PayloadType struct {
|
||||
// ToPayload converts PayloadType to Payload object.
|
||||
// Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
|
||||
func (payloadObj *PayloadType) ToPayload() Payload {
|
||||
var payload = Payload{
|
||||
payload := Payload{
|
||||
Record: &Record{
|
||||
Deleted: false,
|
||||
Owners: nil,
|
||||
|
||||
Reference in New Issue
Block a user