Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

gnoland automatically adds realms #1123

Closed
schollz opened this issue Sep 14, 2023 · 2 comments
Closed

gnoland automatically adds realms #1123

schollz opened this issue Sep 14, 2023 · 2 comments

Comments

@schollz
Copy link
Contributor

schollz commented Sep 14, 2023

Description

I've been out for a few weeks and coming back there is a new change that I wasn't expecting. When I am working on a realm (currently working on /r/demo/art/haiku), I am finding that gnoland is automatically creating a realm before making a transaction.

Reproduce

Create a realm folder (I'm using https://github.com/schollz/gno/tree/realm/haiku with the haiku realm added) and start gnoland. I use the following script to spin-up a fresh gnoland locally:

#!/bin/bash
# run from gno/ folder
pkill -f 'build/gnoland'
pkill -f 'build/gnoweb'
rm -rf gno.land/testdir
cd gno.land && ./build/gnoland start & 
sleep 3
cd gno.land && ./build/gnoweb -bind 0.0.0.0:8888 & 
sleep 3

Now I can query the realm before creating a transaction to add it:

> curl localhost:8888/r/demo/art/haiku

Expected behaviour

Previously, the behavior was that it would produce a response correctly saying it could not find realm:

> curl localhost:8888/r/demo/art/haiku
error querying realm package

Actual behaviour

Now it actually prints out some HTML from a different realm:

> curl localhost:8888/r/demo/art/haiku
<!DOCTYPE html>
<html>
  <head>
    <title>Gno.land</title>
...

Problem

The problem is that I can't seem to add a realm anymore because it "already exists" though it has not actually been added:

> gnokey maketx addpkg --pkgpath "gno.land/r/demo/art/haiku" --pkgdir "examples/gno.land/r/demo/art/haiku" --deposit 100000ugnot --gas-fee 2000000ugnot --gas-wanted 10000000 --broadcast --chainid dev --remote localhost:26657 zzkey1 
Enter password.
--= Error =--
Data: invalid package path
Msg Traces:
    0  /home/zns/Documents/gno/tm2/pkg/crypto/keys/client/addpkg.go:214 - deliver transaction failed: log:msg:0,success:false,log:--= Error =--
Data: vm.InvalidPkgPathError{abciError:vm.abciError{}}
Msg Traces:
    0  /home/zns/Documents/gno2/tm2/pkg/sdk/vm/errors.go:23 - package already exists: gno.land/r/demo/art/haiku

Perhaps this is all expected behavior now? If so, I'm not sure how to add my realm in when starting gnoland.

@thehowl
Copy link
Member

thehowl commented Sep 14, 2023

Yes, expected behaviour. #763 (tl;dr: everything with a gno.mod in examples gets automatically loaded)

Because realm/pkg upgrades are still up for discussion (#694), current behaviour is to reject any addpkg to an existing path. Suggestion is to change the name to something else. (For my own pet-project, I configured an auto-deployer that watches for fs changes, and publishes the realm with a random numerical suffix, ie gno.land/r/demo/chess_1234)

@schollz
Copy link
Contributor Author

schollz commented Sep 14, 2023

Thanks, changing the name works! Also love the auto-deployer, I have something similar in a makefile but yours is much more clever.

@schollz schollz closed this as completed Sep 14, 2023
@moul moul added this to the 🌟 main.gno.land (wanted) milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants