Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ sudo apt update && sudo apt install snapd
# Install Go (Snap)
sudo snap install go --channel=1.23/stable --classic

# Clean module cache
go clean -modcache

# Install Base
sudo apt install make gcc git jq wget

Expand Down Expand Up @@ -80,9 +77,6 @@ gh auth login
# Golang
brew install go

# Clean module cache
go clean -modcache

# Docker
brew install --cask docker
open -a Docker # start docker desktop
Expand Down Expand Up @@ -110,9 +104,6 @@ GO_VERSION=1.23.0
wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz

# Clean module cache
go clean -modcache

# Docker
sudo apt -y install docker.io

Expand Down
20 changes: 18 additions & 2 deletions docs/versioned_docs/version-v0.50.x/01-setup/03-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ If the above does not work, your user or directory permissions may not be setup.

If using WSL, try https://superuser.com/questions/1352207/windows-wsl-ubuntu-sees-wrong-permissions-on-files-in-mounted-disk.

---

## Windows / WSL

### make: /mnt/c/Program: No such file or directory

Delete your GOMODCACHE directory: `rm -rf $(go env GOMODCACHE)` or run the direct command `go clean -modcache`.
Delete your GOMODCACHE directory: `go clean -modcache` or run the direct command `rm -rf $(go env GOMODCACHE)`.

---

## Docker

Expand All @@ -50,7 +54,7 @@ Start the docker daemon. Run [docker engine](https://docs.docker.com/engine/) or

### docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

You don't have permissions to interact with the Docker daemon. Run the following command to fix this.
You don't have permissions to interact with the Docker daemon.

1) Install properly with https://docs.docker.com/get-started/get-docker/

Expand All @@ -64,3 +68,15 @@ reboot # if you still get the error
```

Technically you can also `sudo chmod 666 /var/run/docker.sock` but this is NOT advised. -->

## Generation

### remote: Repository not found. fatal: reposity not found

This error is due to not having properly `make proto-gen`ed the project. View the [Application](#running-the-binary-gives-me-panic-reflect-newnil) section for the solution.

## Application

### Running the binary gives me `panic: reflect: New(nil)`

The `make proto-gen` command was either not run, or is causing issues. This could be due to your users permissions or the filesystem. By default, the protoc docker image uses your current users id and group. Try switching as a super user (i.e. `su -`) or fixing your permissions. A very ugly hack is to run `chmod a+rwx -R ./rollchain` where `./rollchain` is the project you generated. This will cause git to change all files, but it does fix it. Unsure of the long term side effects that may come up from this.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,17 @@ cd rollchain
# scaffolds your new nameservice module
spawn module new nameservice

go clean -modcache

go mod tidy
# proto-gen proto files to go
#
# If you get a /.cache permission error, run:
# sudo chmod -R 777 $(pwd)/.cache
# sudo chown -R $USER $(pwd)/.cache
#
# If you get a cannot find module error
# go clean -modcache
#

make proto-gen
```

This creates a new template module with the name `nameservice` in the `x` and `proto` directories. It also automatically connected to your application and is ready for use.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ proto/nameservice/v1/query.proto
These .proto file templates will be converted into Golang source code for you to use. Build the Go source code using the command:

```bash
go clean -modcache

make proto-gen
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ For example; transfer to transfer, nsibc to nsibc, but transfer to nsibc can not
These values are found in the keys.go file as the module name. By default version is just the module name + "-1".
:::

Execute the command on the testnet to connect the two chains with the IBC module.
Execute the command on the testnet to connect the two chains with the IBC module with the relayer.

```bash
# This will take a minute.
Expand Down Expand Up @@ -228,7 +228,7 @@ You just build an IBC module that interacts with your other nameservice module!

## What you Learned

* Scaffolding ab IBC module
* Scaffolding an IBC module
* Importing another module
* Adding business logic for an IBC request
* Connecting two chains with a custom IBC protocol
Expand Down
6 changes: 5 additions & 1 deletion simapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,13 @@ mod-tidy:
###############################################################################
### Protobuf ###
###############################################################################
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)

protoVer=0.13.2
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
# $(CURDIR)/.cache:/.cache:rw is macOS specific due to buf saving to a read-only directory
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace:rw -v $(CURDIR)/.cache:/.cache:rw --user ${CURRENT_UID}:${CURRENT_GID} --workdir /workspace $(protoImageName)

proto-all: proto-format proto-lint proto-gen format

Expand Down
4 changes: 2 additions & 2 deletions simapp/scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rm -rf github.com

# Copy files over for dep injection
rm -rf api && mkdir api
custom_modules=$(find . -name 'module' -type d -not -path "./proto/*")
custom_modules=$(find . -name 'module' -type d -not -path "./proto/*" -not -path "./.cache/*")

# get the 1 up directory (so ./cosmos/mint/module becomes ./cosmos/mint)
# remove the relative path starter from base namespaces. so ./cosmos/mint becomes cosmos/mint
Expand All @@ -47,4 +47,4 @@ for module in $base_namespace; do
find api/$module -type f -name '*.go' -exec sed -i -e 's|types1 "github.com/cosmos/cosmos-sdk/x/bank/types"|types1 "cosmossdk.io/api/cosmos/bank/v1beta1"|g' {} \;

rm -rf $module
done
done