diff --git a/examples/gno.land/p/demo/groups/z_1_filetest.gno b/examples/gno.land/p/demo/groups/z_1_filetest.gno index 9a423d7a4a0..280b3956ab6 100644 --- a/examples/gno.land/p/demo/groups/z_1_filetest.gno +++ b/examples/gno.land/p/demo/groups/z_1_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test import ( diff --git a/examples/gno.land/r/demo/art/millipede/millipede.gno b/examples/gno.land/r/demo/art/millipede/millipede.gno index dbffd8b3fbb..414941b947b 100644 --- a/examples/gno.land/r/demo/art/millipede/millipede.gno +++ b/examples/gno.land/r/demo/art/millipede/millipede.gno @@ -40,10 +40,10 @@ func Render(path string) string { output := "```\n" + Draw(size) + "```\n" if size > minSize { - output += ufmt.Sprintf("[%d](/r/art/millpede:%d)< ", size-1, size-1) + output += ufmt.Sprintf("[%d](/r/demo/art/millpede:%d)< ", size-1, size-1) } if size < maxSize { - output += ufmt.Sprintf(" >[%d](/r/art/millipede:%d)", size+1, size+1) + output += ufmt.Sprintf(" >[%d](/r/demo/art/millipede:%d)", size+1, size+1) } return output } diff --git a/examples/gno.land/r/demo/art/millipede/millipede_test.gno b/examples/gno.land/r/demo/art/millipede/millipede_test.gno index 38914707b4a..37f9c3c9296 100644 --- a/examples/gno.land/r/demo/art/millipede/millipede_test.gno +++ b/examples/gno.land/r/demo/art/millipede/millipede_test.gno @@ -1,7 +1,6 @@ package millipede import ( - "fmt" "testing" ) @@ -34,7 +33,7 @@ func TestRender(t *testing.T) { ╚═(███)═╝ ╚═(███)═╝ ╚═(███)═╝ -` + "```\n[19](/r/art/millpede:19)< >[21](/r/art/millipede:21)", +` + "```\n[19](/r/demo/art/millpede:19)< >[21](/r/demo/art/millipede:21)", }, { path: "4", @@ -44,7 +43,7 @@ func TestRender(t *testing.T) { ╚═(███)═╝ ╚═(███)═╝ ╚═(███)═╝ -` + "```\n[3](/r/art/millpede:3)< >[5](/r/art/millipede:5)", +` + "```\n[3](/r/demo/art/millpede:3)< >[5](/r/demo/art/millipede:5)", }, } diff --git a/examples/gno.land/r/demo/banktest/README.md b/examples/gno.land/r/demo/banktest/README.md index 4182bfcfe0c..944757f9b12 100644 --- a/examples/gno.land/r/demo/banktest/README.md +++ b/examples/gno.land/r/demo/banktest/README.md @@ -1,6 +1,6 @@ This is a simple test realm contract that demonstrates how to use the banker. -See [gno.land/r/banktest/banktest.go](/r/banktest/banktest.go) to see the original contract code. +See [gno.land/r/demo/banktest/banktest.go](/r/demo/banktest/banktest.go) to see the original contract code. This article will go through each line to explain how it works. @@ -16,8 +16,7 @@ import ( ) ``` -The "std" package is defined by the gno code in stdlibs/std/.
-Self explanatory; and you'll see more usage from std later. +The "std" package is defined by the gno code in stdlibs/std/.
Self explanatory; and you'll see more usage from std later. ```go type activity struct { @@ -37,14 +36,9 @@ func (act *activity) String() string { var latest [10]*activity ``` -This is just maintaining a list of recent activity to this contract. -Notice that the "latest" variable is defined "globally" within -the context of the realm with path "gno.land/r/banktest". +This is just maintaining a list of recent activity to this contract. Notice that the "latest" variable is defined "globally" within the context of the realm with path "gno.land/r/demo/banktest". -This means that calls to functions defined within this package -are encapsulated within this "data realm", where the data is -mutated based on transactions that can potentially cross many -realm and non-realm package boundaries (in the call stack). +This means that calls to functions defined within this package are encapsulated within this "data realm", where the data is mutated based on transactions that can potentially cross many realm and non-realm package boundaries (in the call stack). ```go // Deposit will take the coins (to the realm's pkgaddr) or return them to user. @@ -54,11 +48,7 @@ func Deposit(returnDenom string, returnAmount int64) string { send := std.Coins{{returnDenom, returnAmount}} ``` -This is the beginning of the definition of the contract function named -"Deposit". `std.AssertOriginCall() asserts that this function was called by a -gno transactional Message. The caller is the user who signed off on this -transactional message. Send is the amount of deposit sent along with this -message. +This is the beginning of the definition of the contract function named "Deposit". `std.AssertOriginCall() asserts that this function was called by a gno transactional Message. The caller is the user who signed off on this transactional message. Send is the amount of deposit sent along with this message. ```go // record activity @@ -74,7 +64,7 @@ message. latest[0] = act ``` -Updating the "latest" array for viewing at gno.land/r/banktest: (w/ trailing colon). +Updating the "latest" array for viewing at gno.land/r/demo/banktest: (w/ trailing colon). ```go // return if any. @@ -98,8 +88,7 @@ use a std.Banker instance to return any deposited coins to the original sender. Notice that each realm package has an associated Cosmos address. - -Finally, the results are rendered via an ABCI query call when you visit [/r/banktest:](/r/banktest:). +Finally, the results are rendered via an ABCI query call when you visit [/r/demo/banktest:](/r/demo/banktest:). ```go func Render(path string) string { @@ -124,4 +113,4 @@ func Render(path string) string { } ``` -You can call this contract yourself, by vistiing [/r/banktest](/r/banktest) and the [quickstart guide](/r/boards:gnolang/4). +You can call this contract yourself, by vistiing [/r/demo/banktest](/r/demo/banktest) and the [quickstart guide](/r/demo/boards:gnolang/4). diff --git a/examples/gno.land/r/demo/boards/z_0_a_filetest.gno b/examples/gno.land/r/demo/boards/z_0_a_filetest.gno index 872d01dd793..5e8ff520a54 100644 --- a/examples/gno.land/r/demo/boards/z_0_a_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_0_a_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test import ( diff --git a/examples/gno.land/r/demo/boards/z_0_b_filetest.gno b/examples/gno.land/r/demo/boards/z_0_b_filetest.gno index 9ada8abd0c0..5405a2508ec 100644 --- a/examples/gno.land/r/demo/boards/z_0_b_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_0_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 199000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_0_c_filetest.gno b/examples/gno.land/r/demo/boards/z_0_c_filetest.gno index 36b7bcfda04..99fd339aed8 100644 --- a/examples/gno.land/r/demo/boards/z_0_c_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_0_c_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_0_d_filetest.gno b/examples/gno.land/r/demo/boards/z_0_d_filetest.gno index 2e9e3f1436f..c77e60e3f3a 100644 --- a/examples/gno.land/r/demo/boards/z_0_d_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_0_d_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_0_e_filetest.gno b/examples/gno.land/r/demo/boards/z_0_e_filetest.gno index a06713fcbe3..6db036e87ba 100644 --- a/examples/gno.land/r/demo/boards/z_0_e_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_0_e_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_0_filetest.gno b/examples/gno.land/r/demo/boards/z_0_filetest.gno index f5611d3d6c3..1debeecba04 100644 --- a/examples/gno.land/r/demo/boards/z_0_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_0_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_10_a_filetest.gno b/examples/gno.land/r/demo/boards/z_10_a_filetest.gno index 8ec2e45421a..ad57283bfcf 100644 --- a/examples/gno.land/r/demo/boards/z_10_a_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_10_a_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_10_b_filetest.gno b/examples/gno.land/r/demo/boards/z_10_b_filetest.gno index 0981d85a57f..58ecbecabdf 100644 --- a/examples/gno.land/r/demo/boards/z_10_b_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_10_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_10_c_filetest.gno b/examples/gno.land/r/demo/boards/z_10_c_filetest.gno index 51c597d7998..8555af0b576 100644 --- a/examples/gno.land/r/demo/boards/z_10_c_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_10_c_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_10_filetest.gno b/examples/gno.land/r/demo/boards/z_10_filetest.gno index f32d69c8056..548b5865f65 100644 --- a/examples/gno.land/r/demo/boards/z_10_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_10_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_11_a_filetest.gno b/examples/gno.land/r/demo/boards/z_11_a_filetest.gno index fd62a884efa..50bcfac355c 100644 --- a/examples/gno.land/r/demo/boards/z_11_a_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_11_a_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_11_b_filetest.gno b/examples/gno.land/r/demo/boards/z_11_b_filetest.gno index 63907146f82..9a067f5aac5 100644 --- a/examples/gno.land/r/demo/boards/z_11_b_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_11_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_11_c_filetest.gno b/examples/gno.land/r/demo/boards/z_11_c_filetest.gno index ba40fa39021..524b626ff6d 100644 --- a/examples/gno.land/r/demo/boards/z_11_c_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_11_c_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_11_d_filetest.gno b/examples/gno.land/r/demo/boards/z_11_d_filetest.gno index b3803c505f2..33e6ca1eea9 100644 --- a/examples/gno.land/r/demo/boards/z_11_d_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_11_d_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_11_filetest.gno b/examples/gno.land/r/demo/boards/z_11_filetest.gno index 937673c8bd4..9e85b8ace8c 100644 --- a/examples/gno.land/r/demo/boards/z_11_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_11_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_12_a_filetest.gno b/examples/gno.land/r/demo/boards/z_12_a_filetest.gno index 82fc4b44a8c..909be880efa 100644 --- a/examples/gno.land/r/demo/boards/z_12_a_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_12_a_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_12_b_filetest.gno b/examples/gno.land/r/demo/boards/z_12_b_filetest.gno index af2f66594db..6b2166895c0 100644 --- a/examples/gno.land/r/demo/boards/z_12_b_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_12_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_12_c_filetest.gno b/examples/gno.land/r/demo/boards/z_12_c_filetest.gno index 6cb6d34bf49..7397c487d7d 100644 --- a/examples/gno.land/r/demo/boards/z_12_c_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_12_c_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_12_d_filetest.gno b/examples/gno.land/r/demo/boards/z_12_d_filetest.gno index eb21e8dd5ba..37b6473f7ac 100644 --- a/examples/gno.land/r/demo/boards/z_12_d_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_12_d_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_12_filetest.gno b/examples/gno.land/r/demo/boards/z_12_filetest.gno index 59ab07d17d8..4ea75b27753 100644 --- a/examples/gno.land/r/demo/boards/z_12_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_12_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_1_filetest.gno b/examples/gno.land/r/demo/boards/z_1_filetest.gno index b5c7bb863e1..ba0a277e2f1 100644 --- a/examples/gno.land/r/demo/boards/z_1_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_1_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_2_filetest.gno b/examples/gno.land/r/demo/boards/z_2_filetest.gno index 2a6b937c875..f0d53204e38 100644 --- a/examples/gno.land/r/demo/boards/z_2_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_2_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_3_filetest.gno b/examples/gno.land/r/demo/boards/z_3_filetest.gno index 0d25dae08ae..021ae10b825 100644 --- a/examples/gno.land/r/demo/boards/z_3_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_3_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_4_filetest.gno b/examples/gno.land/r/demo/boards/z_4_filetest.gno index 8209daba521..bb98fa289ba 100644 --- a/examples/gno.land/r/demo/boards/z_4_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_4_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot @@ -962,4 +962,4 @@ func main() { // switchrealm["gno.land/r/demo/users"] // switchrealm["gno.land/r/demo/users"] // switchrealm["gno.land/r/demo/boards"] -// switchrealm["gno.land/r/boards_test"] +// switchrealm["gno.land/r/demo/boards_test"] diff --git a/examples/gno.land/r/demo/boards/z_5_filetest.gno b/examples/gno.land/r/demo/boards/z_5_filetest.gno index 76fb4ee432c..c326d961c91 100644 --- a/examples/gno.land/r/demo/boards/z_5_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_5_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_6_filetest.gno b/examples/gno.land/r/demo/boards/z_6_filetest.gno index c1cd84d35a7..b7de2d08bf9 100644 --- a/examples/gno.land/r/demo/boards/z_6_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_6_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_7_filetest.gno b/examples/gno.land/r/demo/boards/z_7_filetest.gno index 343ec8f909e..7a6b4d89eec 100644 --- a/examples/gno.land/r/demo/boards/z_7_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_7_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_8_filetest.gno b/examples/gno.land/r/demo/boards/z_8_filetest.gno index 226dae62b3f..e7f94a78746 100644 --- a/examples/gno.land/r/demo/boards/z_8_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_8_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 2000000000ugnot diff --git a/examples/gno.land/r/demo/boards/z_9_a_filetest.gno b/examples/gno.land/r/demo/boards/z_9_a_filetest.gno index 9ba9786c519..8d07ba0e710 100644 --- a/examples/gno.land/r/demo/boards/z_9_a_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_9_a_filetest.gno @@ -1,11 +1,9 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot import ( - "strconv" - "gno.land/r/demo/boards" "gno.land/r/demo/users" ) diff --git a/examples/gno.land/r/demo/boards/z_9_b_filetest.gno b/examples/gno.land/r/demo/boards/z_9_b_filetest.gno index 4d53f60f10f..68daf770b4f 100644 --- a/examples/gno.land/r/demo/boards/z_9_b_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_9_b_filetest.gno @@ -1,11 +1,9 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot import ( - "strconv" - "gno.land/r/demo/boards" "gno.land/r/demo/users" ) diff --git a/examples/gno.land/r/demo/boards/z_9_filetest.gno b/examples/gno.land/r/demo/boards/z_9_filetest.gno index f2703bc1622..10a1444fd35 100644 --- a/examples/gno.land/r/demo/boards/z_9_filetest.gno +++ b/examples/gno.land/r/demo/boards/z_9_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/boards_test +// PKGPATH: gno.land/r/demo/boards_test package boards_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/groups/misc.gno b/examples/gno.land/r/demo/groups/misc.gno index 2d578627632..24834b7b60c 100644 --- a/examples/gno.land/r/demo/groups/misc.gno +++ b/examples/gno.land/r/demo/groups/misc.gno @@ -78,9 +78,9 @@ func summaryOf(str string, length int) string { func displayAddressMD(addr std.Address) string { user := users.GetUserByAddress(addr) if user == nil { - return "[" + addr.String() + "](/r/users:" + addr.String() + ")" + return "[" + addr.String() + "](/r/demo/users:" + addr.String() + ")" } - return "[@" + user.Name + "](/r/users:" + user.Name + ")" + return "[@" + user.Name + "](/r/demo/users:" + user.Name + ")" } func usernameOf(addr std.Address) string { diff --git a/examples/gno.land/r/demo/groups/render.gno b/examples/gno.land/r/demo/groups/render.gno index ca5566ae28d..5af714b1ef5 100644 --- a/examples/gno.land/r/demo/groups/render.gno +++ b/examples/gno.land/r/demo/groups/render.gno @@ -27,7 +27,7 @@ func Render(path string) string { } parts := strings.Split(path, "/") if len(parts) == 1 { - // /r/Groups:Group_NAME + // /r/demo/groups:Group_NAME name := parts[0] groupI, exists := gGroupsByName.Get(name) if !exists { diff --git a/examples/gno.land/r/demo/groups/z_0_a_filetest.gno b/examples/gno.land/r/demo/groups/z_0_a_filetest.gno index 41d515b9d0a..49ebb5219ec 100644 --- a/examples/gno.land/r/demo/groups/z_0_a_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_0_a_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test import ( diff --git a/examples/gno.land/r/demo/groups/z_0_b_filetest.gno b/examples/gno.land/r/demo/groups/z_0_b_filetest.gno index ca74c599130..49e4167ae1a 100644 --- a/examples/gno.land/r/demo/groups/z_0_b_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_0_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test import ( diff --git a/examples/gno.land/r/demo/groups/z_0_c_filetest.gno b/examples/gno.land/r/demo/groups/z_0_c_filetest.gno index 10a4771c529..cf5902928db 100644 --- a/examples/gno.land/r/demo/groups/z_0_c_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_0_c_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/groups/z_1_a_filetest.gno b/examples/gno.land/r/demo/groups/z_1_a_filetest.gno index 460fb79afbb..95d13c6f241 100644 --- a/examples/gno.land/r/demo/groups/z_1_a_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_1_a_filetest.gno @@ -1,11 +1,10 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot import ( "std" - "strconv" "gno.land/p/demo/testutils" "gno.land/r/demo/groups" diff --git a/examples/gno.land/r/demo/groups/z_1_b_filetest.gno b/examples/gno.land/r/demo/groups/z_1_b_filetest.gno index 3271e74e287..31a036d4e41 100644 --- a/examples/gno.land/r/demo/groups/z_1_b_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_1_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/groups/z_1_c_filetest.gno b/examples/gno.land/r/demo/groups/z_1_c_filetest.gno index 93cd3b39d5f..6eaabb07cdf 100644 --- a/examples/gno.land/r/demo/groups/z_1_c_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_1_c_filetest.gno @@ -1,15 +1,13 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot import ( "std" - "strconv" "gno.land/p/demo/testutils" "gno.land/r/demo/groups" - "gno.land/r/demo/users" ) var gid groups.GroupID diff --git a/examples/gno.land/r/demo/groups/z_2_a_filetest.gno b/examples/gno.land/r/demo/groups/z_2_a_filetest.gno index f4a96905fc8..d9bee0e2edc 100644 --- a/examples/gno.land/r/demo/groups/z_2_a_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_2_a_filetest.gno @@ -1,11 +1,10 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot import ( "std" - "strconv" "gno.land/p/demo/testutils" "gno.land/r/demo/groups" diff --git a/examples/gno.land/r/demo/groups/z_2_b_filetest.gno b/examples/gno.land/r/demo/groups/z_2_b_filetest.gno index bf10939c66f..fd8e485f16f 100644 --- a/examples/gno.land/r/demo/groups/z_2_b_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_2_b_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/groups/z_2_d_filetest.gno b/examples/gno.land/r/demo/groups/z_2_d_filetest.gno index 95f22f4ec4b..3caa726cbd3 100644 --- a/examples/gno.land/r/demo/groups/z_2_d_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_2_d_filetest.gno @@ -1,11 +1,10 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot import ( "std" - "strconv" "gno.land/p/demo/testutils" "gno.land/r/demo/groups" diff --git a/examples/gno.land/r/demo/groups/z_2_e_filetest.gno b/examples/gno.land/r/demo/groups/z_2_e_filetest.gno index 270ddb8aa34..cbfff97c7a7 100644 --- a/examples/gno.land/r/demo/groups/z_2_e_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_2_e_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/groups/z_2_f_filetest.gno b/examples/gno.land/r/demo/groups/z_2_f_filetest.gno index 4ec0ec211f2..4fddb768e08 100644 --- a/examples/gno.land/r/demo/groups/z_2_f_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_2_f_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot diff --git a/examples/gno.land/r/demo/groups/z_2_g_filetest.gno b/examples/gno.land/r/demo/groups/z_2_g_filetest.gno index 8f98cfeb2dd..6230b110c74 100644 --- a/examples/gno.land/r/demo/groups/z_2_g_filetest.gno +++ b/examples/gno.land/r/demo/groups/z_2_g_filetest.gno @@ -1,11 +1,10 @@ -// PKGPATH: gno.land/r/groups_test +// PKGPATH: gno.land/r/demo/groups_test package groups_test // SEND: 200000000ugnot import ( "std" - "strconv" "gno.land/p/demo/testutils" "gno.land/r/demo/groups" diff --git a/examples/gno.land/r/demo/nft/README.md b/examples/gno.land/r/demo/nft/README.md index 2b4bc827e88..766035b5c41 100644 --- a/examples/gno.land/r/demo/nft/README.md +++ b/examples/gno.land/r/demo/nft/README.md @@ -2,10 +2,10 @@ NFT's are all the rage these days, for various reasons. I read over EIP-721 which appears to be the de-facto NFT standard on Ethereum. Then, made a sample implementation of EIP-721 (let's here called GRC-721). The implementation isn't complete, but it demonstrates the main functionality. - - [EIP-721](https://eips.ethereum.org/EIPS/eip-721) - - [gno.land/r/nft/nft.go](https://gno.land/r/nft/nft.go) - - [zrealm_nft3.go test](https://github.com/gnolang/gno/blob/master/tests/files2/zrealm_nft3.gno) +- [EIP-721](https://eips.ethereum.org/EIPS/eip-721) +- [gno.land/r/demo/nft/nft.go](https://gno.land/r/demo/nft/nft.go) +- [zrealm_nft3.go test](https://github.com/gnolang/gno/blob/master/tests/files2/zrealm_nft3.gno) In short, this demonstrates how to implement Ethereum contract interfaces in Gno.land; by using only standard Go language features. -Please leave a comment ([guide](https://gno.land/r/boards:gnolang/1)). +Please leave a comment ([guide](https://gno.land/r/demo/boards:gnolang/1)). diff --git a/examples/gno.land/r/demo/nft/z_0_filetest.gno b/examples/gno.land/r/demo/nft/z_0_filetest.gno index 973d5f95eab..9e8010abaf5 100644 --- a/examples/gno.land/r/demo/nft/z_0_filetest.gno +++ b/examples/gno.land/r/demo/nft/z_0_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/nft_test +// PKGPATH: gno.land/r/demo/nft_test package nft_test import ( @@ -220,4 +220,4 @@ func main() { // } // } // switchrealm["gno.land/r/demo/nft"] -// switchrealm["gno.land/r/nft_test"] +// switchrealm["gno.land/r/demo/nft_test"] diff --git a/examples/gno.land/r/demo/nft/z_1_filetest.gno b/examples/gno.land/r/demo/nft/z_1_filetest.gno index 15b0a9a7785..990120d127a 100644 --- a/examples/gno.land/r/demo/nft/z_1_filetest.gno +++ b/examples/gno.land/r/demo/nft/z_1_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/nft_test +// PKGPATH: gno.land/r/demo/nft_test package nft_test import ( diff --git a/examples/gno.land/r/demo/nft/z_2_filetest.gno b/examples/gno.land/r/demo/nft/z_2_filetest.gno index 00d6eb0c0f0..91c48bd5957 100644 --- a/examples/gno.land/r/demo/nft/z_2_filetest.gno +++ b/examples/gno.land/r/demo/nft/z_2_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/nft_test +// PKGPATH: gno.land/r/demo/nft_test package nft_test import ( diff --git a/examples/gno.land/r/demo/nft/z_3_filetest.gno b/examples/gno.land/r/demo/nft/z_3_filetest.gno index 00a4d00291b..d0210c8ba4d 100644 --- a/examples/gno.land/r/demo/nft/z_3_filetest.gno +++ b/examples/gno.land/r/demo/nft/z_3_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/nft_test +// PKGPATH: gno.land/r/demo/nft_test package nft_test import ( diff --git a/examples/gno.land/r/demo/nft/z_4_filetest.gno b/examples/gno.land/r/demo/nft/z_4_filetest.gno index 773444ff8fa..b38ce8ea190 100644 --- a/examples/gno.land/r/demo/nft/z_4_filetest.gno +++ b/examples/gno.land/r/demo/nft/z_4_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/nft_test +// PKGPATH: gno.land/r/demo/nft_test package nft_test import ( diff --git a/examples/gno.land/r/demo/users/z_10_filetest.gno b/examples/gno.land/r/demo/users/z_10_filetest.gno index 0065d907e47..878fa296fdd 100644 --- a/examples/gno.land/r/demo/users/z_10_filetest.gno +++ b/examples/gno.land/r/demo/users/z_10_filetest.gno @@ -1,4 +1,4 @@ -// PKGPATH: gno.land/r/users_test +// PKGPATH: gno.land/r/demo/users_test package users_test import ( diff --git a/gno.land/genesis/cleanup.sh b/gno.land/genesis/cleanup.sh index 84857c902dc..2f448f9cd5b 100755 --- a/gno.land/genesis/cleanup.sh +++ b/gno.land/genesis/cleanup.sh @@ -8,11 +8,11 @@ TARGET=genesis_txs.jsonl # first, bank transfers, without faucet cat $SRC | grep /bank.MsgSend | grep -v g1f4v282mwyhu29afke4vq5r2xzcm6z3ftnugcnv >> $TARGET -# then, r/users's invites -cat $SRC | grep '"pkg_path":"gno.land/r/users","func":"Invite"' >> $TARGET +# then, r/demo/users's invites +cat $SRC | grep '"pkg_path":"gno.land/r/demo/users","func":"Invite"' >> $TARGET -# then, r/users's registers -cat $SRC | grep '"pkg_path":"gno.land/r/users","func":"Register"' >> $TARGET +# then, r/demo/users's registers +cat $SRC | grep '"pkg_path":"gno.land/r/demo/users","func":"Register"' >> $TARGET ADMIN_ADDR=g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj JAE_ADDR=g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 @@ -21,7 +21,7 @@ JAE_ADDR=g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5 cat $SRC | grep '"func":"CreateBoard","args":\["gnolang"\]' | sed "s/$JAE_ADDR/$ADMIN_ADDR/" >> $TARGET # r/boards:gnolang/xxx by jae, admin -cat $SRC | grep "caller\":\"$JAE_ADDR" | grep 'gno.land/r/boards","func":"CreateThread","args":\["1"' | sed "s/$JAE_ADDR/$ADMIN_ADDR/" >> $TARGET -cat $SRC | grep "caller\":\"$ADMIN_ADDR" | grep 'gno.land/r/boards","func":"CreateThread","args":\["1"' >> $TARGET +cat $SRC | grep "caller\":\"$JAE_ADDR" | grep 'gno.land/r/demo/boards","func":"CreateThread","args":\["1"' | sed "s/$JAE_ADDR/$ADMIN_ADDR/" >> $TARGET +cat $SRC | grep "caller\":\"$ADMIN_ADDR" | grep 'gno.land/r/demo/boards","func":"CreateThread","args":\["1"' >> $TARGET wc -l $SRC $TARGET diff --git a/gno.land/genesis/genesis_txs.jsonl b/gno.land/genesis/genesis_txs.jsonl index 61b15e932ca..04ec61b4e5d 100644 --- a/gno.land/genesis/genesis_txs.jsonl +++ b/gno.land/genesis/genesis_txs.jsonl @@ -10,7 +10,7 @@ {"msg":[{"@type":"/vm.m_call","caller":"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateBoard","args":["testboard"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"vzlSxEFh5jOkaSdv3rsV91v/OJKEF2qSuoCpri1u5tRWq62T7xr3KHRCF5qFnn4aQX/yE8g8f/Y//WPOCUGhJw=="}],"memo":""} {"msg":[{"@type":"/vm.m_call","caller":"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateThread","args":["1","Hello World","This is a demo of Gno smart contract programming. This document was\nconstructed by Gno onto a smart contract hosted on the data Realm \nname [\"gno.land/r/demo/boards\"](https://gno.land/r/demo/boards/)\n([github](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/demo/boards)).\n\n## Starting the `gnoland` node node/validator.\n\nNOTE: Where you see `--remote %%REMOTE%%` here, that flag can be replaced\nwith `--remote localhost:26657` for local testnets.\n\n### build gnoland.\n\n```bash\ngit clone git@github.com:gnolang/gno.git\ncd ./gno\nmake \n```\n\n### add test account.\n\n```bash\n./build/gnokey add test1 --recover\n```\n\nUse this mnemonic:\n\u003e source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast\n\n### start gnoland validator node.\n\n```bash\n./build/gnoland\n```\n\n(This can be reset with `make reset`).\n\n### start gnoland web server (optional).\n\n```bash\ngo run ./gnoland/website\n```\n\n## Signing and broadcasting transactions.\n\n### publish the \"gno.land/p/demo/avl\" package.\n\n```bash\n./build/gnokey maketx addpkg test1 --pkgpath \"gno.land/p/demo/avl\" --pkgdir \"examples/gno.land/p/demo/avl\" --deposit 100ugnot --gas-fee 1ugnot --gas-wanted 2000000 \u003e addpkg.avl.unsigned.txt\n./build/gnokey query \"auth/accounts/g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5\"\n./build/gnokey sign test1 --txpath addpkg.avl.unsigned.txt --chainid \"%%CHAINID%%\" --number 0 --sequence 0 \u003e addpkg.avl.signed.txt\n./build/gnokey broadcast addpkg.avl.signed.txt --remote %%REMOTE%%\n```\n\n### publish the \"gno.land/r/demo/boards\" realm package.\n\n```bash\n./build/gnokey maketx addpkg test1 --pkgpath \"gno.land/r/demo/boards\" --pkgdir \"examples/gno.land/r/demo/boards\" --deposit 100ugnot --gas-fee 1ugnot --gas-wanted 300000000 \u003e addpkg.boards.unsigned.txt\n./build/gnokey sign test1 --txpath addpkg.boards.unsigned.txt --chainid \"%%CHAINID%%\" --number 0 --sequence 1 \u003e addpkg.boards.signed.txt\n./build/gnokey broadcast addpkg.boards.signed.txt --remote %%REMOTE%%\n```\n\n### create a board with a smart contract call.\n\n```bash\n./build/gnokey maketx call test1 --pkgpath \"gno.land/r/demo/boards\" --func CreateBoard --args \"testboard\" --gas-fee 1ugnot --gas-wanted 2000000 \u003e createboard.unsigned.txt\n./build/gnokey sign test1 --txpath createboard.unsigned.txt --chainid \"%%CHAINID%%\" --number 0 --sequence 2 \u003e createboard.signed.txt\n./build/gnokey broadcast createboard.signed.txt --remote %%REMOTE%%\n```\nNext, query for the permanent board ID by querying (you need this to create a new post):\n\n```bash\n./build/gnokey query \"vm/qeval\" --data \"gno.land/r/demo/boards\nGetBoardIDFromName(\\\"testboard\\\")\"\n```\n\n### create a post of a board with a smart contract call.\n\n```bash\n./build/gnokey maketx call test1 --pkgpath \"gno.land/r/demo/boards\" --func CreatePost --args 1 --args \"Hello World\" --args#file \"./examples/gno.land/r/demo/boards/README.md\" --gas-fee 1ugnot --gas-wanted 2000000 \u003e createpost.unsigned.txt\n./build/gnokey sign test1 --txpath createpost.unsigned.txt --chainid \"%%CHAINID%%\" --number 0 --sequence 3 \u003e createpost.signed.txt\n./build/gnokey broadcast createpost.signed.txt --remote %%REMOTE%%\n```\n\n### create a comment to a post.\n\n```bash\n./build/gnokey maketx call test1 --pkgpath \"gno.land/r/demo/boards\" --func CreateReply --args 1 --args 1 --args \"A comment\" --gas-fee 1ugnot --gas-wanted 2000000 \u003e createcomment.unsigned.txt\n./build/gnokey sign test1 --txpath createcomment.unsigned.txt --chainid \"%%CHAINID%%\" --number 0 --sequence 4 \u003e createcomment.signed.txt\n./build/gnokey broadcast createcomment.signed.txt --remote %%REMOTE%%\n```\n\n```bash\n./build/gnokey query \"vm/qrender\" --data \"gno.land/r/demo/boards\ntestboard/1\"\n```\n\n### render page with optional path expression.\n\nThe contents of `https://gno.land/r/demo/boards:` and `https://gno.land/r/demo/boards:testboard` are rendered by calling\nthe `Render(path string)` function like so:\n\n```bash\n./build/gnokey query \"vm/qrender\" --data \"gno.land/r/demo/boards\ntestboard\"\n```\n"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"V43B1waFxhzheW9TfmCpjLdrC4dC1yjUGES5y3J6QsNar6hRpNz4G1thzWmWK7xXhg8u1PCIpxLxGczKQYhuPw=="}],"memo":""} {"msg":[{"@type":"/vm.m_call","caller":"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateThread","args":["1","NFT example","NFT's are all the rage these days, for various reasons.\n\nI read over EIP-721 which appears to be the de-facto NFT standard on Ethereum. Then, made a sample implementation of EIP-721 (let's here called GRC-721). The implementation isn't complete, but it demonstrates the main functionality.\n\n - [EIP-721](https://eips.ethereum.org/EIPS/eip-721)\n - [gno.land/r/demo/nft/nft.gno](https://gno.land/r/demo/nft/nft.gno)\n - [zrealm_nft3.gno test](https://github.com/gnolang/gno/blob/master/examples/gno.land/r/demo/nft/z_3_filetest.gno)\n\nIn short, this demonstrates how to implement Ethereum contract interfaces in Gno.land; by using only standard Go language features.\n\nPlease leave a comment ([guide](https://gno.land/r/demo/boards:testboard/1)).\n"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"ZXfrTiHxPFQL8uSm+Tv7WXIHPMca9okhm94RAlC6YgNbB1VHQYYpoP4w+cnL3YskVzGrOZxensXa9CAZ+cNNeg=="}],"memo":""} -{"msg":[{"@type":"/vm.m_call","caller":"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateThread","args":["1","Simple echo example with coins","This is a simple test realm contract that demonstrates how to use the banker.\n\nSee [gno.land/r/demo/banktest/banktest.gno](/r/banktest/banktest.gno) to see the original contract code.\n\nThis article will go through each line to explain how it works.\n\n```go\npackage banktest\n```\n\nThis package is locally named \"banktest\" (could be anything).\n\n```go\nimport (\n\t\"std\"\n)\n```\n\nThe \"std\" package is defined by the gno code in stdlibs/std/. \u003c/br\u003e\nSelf explanatory; and you'll see more usage from std later.\n\n```go\ntype activity struct {\n\tcaller std.Address\n\tsent std.Coins\n\treturned std.Coins\n\ttime std.Time\n}\n\nfunc (act *activity) String() string {\n\treturn act.caller.String() + \" \" +\n\t\tact.sent.String() + \" sent, \" +\n\t\tact.returned.String() + \" returned, at \" +\n\t\tstd.FormatTimestamp(act.time, \"2006-01-02 3:04pm MST\")\n}\n\nvar latest [10]*activity\n```\n\nThis is just maintaining a list of recent activity to this contract.\nNotice that the \"latest\" variable is defined \"globally\" within\nthe context of the realm with path \"gno.land/r/demo/banktest\".\n\nThis means that calls to functions defined within this package\nare encapsulated within this \"data realm\", where the data is \nmutated based on transactions that can potentially cross many\nrealm and non-realm packge boundaries (in the call stack).\n\n```go\n// Deposit will take the coins (to the realm's pkgaddr) or return them to user.\nfunc Deposit(returnDenom string, returnAmount int64) string {\n\tstd.AssertOriginCall()\n\tcaller := std.GetOrigCaller()\n\tsend := std.Coins{{returnDenom, returnAmount}}\n```\n\nThis is the beginning of the definition of the contract function named\n\"Deposit\". `std.AssertOriginCall() asserts that this function was called by a\ngno transactional Message. The caller is the user who signed off on this\ntransactional message. Send is the amount of deposit sent along with this\nmessage.\n\n```go\n\t// record activity\n\tact := \u0026activity{\n\t\tcaller: caller,\n\t\tsent: std.GetOrigSend(),\n\t\treturned: send,\n\t\ttime: std.GetTimestamp(),\n\t}\n\tfor i := len(latest) - 2; i \u003e= 0; i-- {\n\t\tlatest[i+1] = latest[i] // shift by +1.\n\t}\n\tlatest[0] = act\n```\n\nUpdating the \"latest\" array for viewing at gno.land/r/demo/banktest: (w/ trailing colon).\n\n```go\n\t// return if any.\n\tif returnAmount \u003e 0 {\n```\n\nIf the user requested the return of coins...\n\n```go\n\t\tbanker := std.GetBanker(std.BankerTypeOrigSend)\n```\n\nuse a std.Banker instance to return any deposited coins to the original sender.\n\n```go\n\t\tpkgaddr := std.GetOrigPkgAddr()\n\t\t// TODO: use std.Coins constructors, this isn't generally safe.\n\t\tbanker.SendCoins(pkgaddr, caller, send)\n\t\treturn \"returned!\"\n```\n\nNotice that each realm package has an associated Cosmos address.\n\n\nFinally, the results are rendered via an ABCI query call when you visit [/r/banktest:](/r/banktest:).\n\n```go\nfunc Render(path string) string {\n\t// get realm coins.\n\tbanker := std.GetBanker(std.BankerTypeReadonly)\n\tcoins := banker.GetCoins(std.GetOrigPkgAddr())\n\n\t// render\n\tres := \"\"\n\tres += \"## recent activity\\n\"\n\tres += \"\\n\"\n\tfor _, act := range latest {\n\t\tif act == nil {\n\t\t\tbreak\n\t\t}\n\t\tres += \" * \" + act.String() + \"\\n\"\n\t}\n\tres += \"\\n\"\n\tres += \"## total deposits\\n\"\n\tres += coins.String()\n\treturn res\n}\n```\n\nYou can call this contract yourself, by vistiing [/r/banktest](/r/banktest) and the [quickstart guide](/r/boards:testboard/4).\n"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"iZX/llZlNTdZMLv1goCTgK2bWqzT8enlTq56wMTCpVxJGA0BTvuEM5Nnt9vrnlG6Taqj2GuTrmEnJBkDFTmt9g=="}],"memo":""} +{"msg":[{"@type":"/vm.m_call","caller":"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateThread","args":["1","Simple echo example with coins","This is a simple test realm contract that demonstrates how to use the banker.\n\nSee [gno.land/r/demo/banktest/banktest.gno](/r/demo/banktest/banktest.gno) to see the original contract code.\n\nThis article will go through each line to explain how it works.\n\n```go\npackage banktest\n```\n\nThis package is locally named \"banktest\" (could be anything).\n\n```go\nimport (\n\t\"std\"\n)\n```\n\nThe \"std\" package is defined by the gno code in stdlibs/std/. \u003c/br\u003e\nSelf explanatory; and you'll see more usage from std later.\n\n```go\ntype activity struct {\n\tcaller std.Address\n\tsent std.Coins\n\treturned std.Coins\n\ttime std.Time\n}\n\nfunc (act *activity) String() string {\n\treturn act.caller.String() + \" \" +\n\t\tact.sent.String() + \" sent, \" +\n\t\tact.returned.String() + \" returned, at \" +\n\t\tstd.FormatTimestamp(act.time, \"2006-01-02 3:04pm MST\")\n}\n\nvar latest [10]*activity\n```\n\nThis is just maintaining a list of recent activity to this contract.\nNotice that the \"latest\" variable is defined \"globally\" within\nthe context of the realm with path \"gno.land/r/demo/banktest\".\n\nThis means that calls to functions defined within this package\nare encapsulated within this \"data realm\", where the data is \nmutated based on transactions that can potentially cross many\nrealm and non-realm packge boundaries (in the call stack).\n\n```go\n// Deposit will take the coins (to the realm's pkgaddr) or return them to user.\nfunc Deposit(returnDenom string, returnAmount int64) string {\n\tstd.AssertOriginCall()\n\tcaller := std.GetOrigCaller()\n\tsend := std.Coins{{returnDenom, returnAmount}}\n```\n\nThis is the beginning of the definition of the contract function named\n\"Deposit\". `std.AssertOriginCall() asserts that this function was called by a\ngno transactional Message. The caller is the user who signed off on this\ntransactional message. Send is the amount of deposit sent along with this\nmessage.\n\n```go\n\t// record activity\n\tact := \u0026activity{\n\t\tcaller: caller,\n\t\tsent: std.GetOrigSend(),\n\t\treturned: send,\n\t\ttime: std.GetTimestamp(),\n\t}\n\tfor i := len(latest) - 2; i \u003e= 0; i-- {\n\t\tlatest[i+1] = latest[i] // shift by +1.\n\t}\n\tlatest[0] = act\n```\n\nUpdating the \"latest\" array for viewing at gno.land/r/demo/banktest: (w/ trailing colon).\n\n```go\n\t// return if any.\n\tif returnAmount \u003e 0 {\n```\n\nIf the user requested the return of coins...\n\n```go\n\t\tbanker := std.GetBanker(std.BankerTypeOrigSend)\n```\n\nuse a std.Banker instance to return any deposited coins to the original sender.\n\n```go\n\t\tpkgaddr := std.GetOrigPkgAddr()\n\t\t// TODO: use std.Coins constructors, this isn't generally safe.\n\t\tbanker.SendCoins(pkgaddr, caller, send)\n\t\treturn \"returned!\"\n```\n\nNotice that each realm package has an associated Cosmos address.\n\n\nFinally, the results are rendered via an ABCI query call when you visit [/r/demo/banktest:](/r/demo/banktest:).\n\n```go\nfunc Render(path string) string {\n\t// get realm coins.\n\tbanker := std.GetBanker(std.BankerTypeReadonly)\n\tcoins := banker.GetCoins(std.GetOrigPkgAddr())\n\n\t// render\n\tres := \"\"\n\tres += \"## recent activity\\n\"\n\tres += \"\\n\"\n\tfor _, act := range latest {\n\t\tif act == nil {\n\t\t\tbreak\n\t\t}\n\t\tres += \" * \" + act.String() + \"\\n\"\n\t}\n\tres += \"\\n\"\n\tres += \"## total deposits\\n\"\n\tres += coins.String()\n\treturn res\n}\n```\n\nYou can call this contract yourself, by vistiing [/r/demo/banktest](/r/demo/banktest) and the [quickstart guide](/r/demo/boards:testboard/4).\n"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"A+FhNtsXHjLfSJk1lB8FbiL4mGPjc50Kt81J7EKDnJ2y"},"signature":"iZX/llZlNTdZMLv1goCTgK2bWqzT8enlTq56wMTCpVxJGA0BTvuEM5Nnt9vrnlG6Taqj2GuTrmEnJBkDFTmt9g=="}],"memo":""} {"msg":[{"@type":"/vm.m_call","caller":"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateThread","args":["1","TASK: Describe in your words","Describe in an essay (250+ words), on your favorite medium, why you are interested in gno.land and gnolang.\n\nReply here with a URL link to your written piece as a comment, for rewards.\n"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"AmG6kzznyo1uNqWPAYU6wDpsmzQKDaEOrVRaZ08vOyX0"},"signature":"4HBNtrta8HdeHj4JTN56PBTRK8GOe31NMRRXDiyYtjozuyRdWfOGEsGjGgHWcoBUJq6DepBgD4FetdqfhZ6TNQ=="}],"memo":""} {"msg":[{"@type":"/vm.m_call","caller":"g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq","send":"","pkg_path":"gno.land/r/demo/boards","func":"CreateThread","args":["1","Getting Started","This is a demo of Gno smart contract programming. This document was\nconstructed by Gno onto a smart contract hosted on the data Realm\nname [\"gno.land/r/demo/boards\"](https://gno.land/r/demo/boards/)\n([github](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/demo/boards)).\n\n\n\n## Build `gnokey`, create your account, and interact with Gno.\n\nNOTE: Where you see `--remote %%REMOTE%%` here, that flag can be replaced\nwith `--remote localhost:26657` for local testnets.\n\n### Build `gnokey`.\n\n```bash\ngit clone git@github.com:gnolang/gno.git\ncd ./gno\nmake\n```\n\n### Generate a seed/mnemonic code.\n\n```bash\n./build/gnokey generate\n```\n\nNOTE: You can generate 24 words with any good bip39 generator.\n\n### Create a new account using your mnemonic.\n\n```bash\n./build/gnokey add KEYNAME --recover\n```\n\nNOTE: `KEYNAME` is your key identifier, and should be changed.\n\n### Verify that you can see your account locally.\n\n```bash\n./build/gnokey list\n```\n\n## Interact with the blockchain:\n\n### Get your current balance, account number, and sequence number.\n\n```bash\n./build/gnokey query auth/accounts/ACCOUNT_ADDR --remote %%REMOTE%%\n```\n\nNOTE: you can retrieve your `ACCOUNT_ADDR` with `./build/gnokey list`.\n\n### Acquire testnet tokens using the official faucet.\n\nGo to https://gno.land/faucet\n\n### Create a board with a smart contract call.\n\nNOTE: `BOARDNAME` will be the slug of the board, and should be changed.\n\n```bash\n./build/gnokey maketx call KEYNAME --pkgpath \"gno.land/r/demo/boards\" --func \"CreateBoard\" --args \"BOARDNAME\" --gas-fee \"1000000ugnot\" --gas-wanted \"2000000\" --broadcast=true --chainid %%CHAINID%% --remote %%REMOTE%%\n```\n\nInteractive documentation: https://gno.land/r/demo/boards?help\u0026__func=CreateBoard\n\nNext, query for the permanent board ID by querying (you need this to create a new post):\n\n```bash\n./build/gnokey query \"vm/qeval\" --data \"gno.land/r/demo/boards\nGetBoardIDFromName(\\\"BOARDNAME\\\")\" --remote %%REMOTE%%\n```\n\n### Create a post of a board with a smart contract call.\n\nNOTE: If a board was created successfully, your SEQUENCE_NUMBER would have increased.\n\n```bash\n./build/gnokey maketx call KEYNAME --pkgpath \"gno.land/r/demo/boards\" --func \"CreateThread\" --args BOARD_ID --args \"Hello gno.land\" --args\\#file \"./examples/gno.land/r/demo/boards/example_post.md\" --gas-fee 1000000ugnot --gas-wanted 2000000 --broadcast=true --chainid %%CHAINID%% --remote %%REMOTE%%\n```\n\nInteractive documentation: https://gno.land/r/demo/boards?help\u0026__func=CreateThread\n\n### Create a comment to a post.\n\n```bash\n./build/gnokey maketx call KEYNAME --pkgpath \"gno.land/r/demo/boards\" --func \"CreateReply\" --args \"BOARD_ID\" --args \"1\" --args \"1\" --args \"Nice to meet you too.\" --gas-fee 1000000ugnot --gas-wanted 2000000 --broadcast=true --chainid %%CHAINID%% --remote %%REMOTE%%\n```\n\nInteractive documentation: https://gno.land/r/demo/boards?help\u0026__func=CreateReply\n\n```bash\n./build/gnokey query \"vm/qrender\" --data \"gno.land/r/demo/boards\nBOARDNAME/1\" --remote %%REMOTE%%\n```\n\n### Render page with optional path expression.\n\nThe contents of `https://gno.land/r/demo/boards:` and `https://gno.land/r/demo/boards:gnolang` are rendered by calling\nthe `Render(path string)` function like so:\n\n```bash\n./build/gnokey query \"vm/qrender\" --data \"gno.land/r/demo/boards\ngnolang\"\n```\n\n## Starting a local `gnoland` node:\n\n### Add test account.\n\n```bash\n./build/gnokey add test1 --recover\n```\n\nUse this mneonic:\n\u003e source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast\n\n### Start `gnoland` node.\n\n```bash\n./build/gnoland\n```\n\nNOTE: This can be reset with `make reset`\n\n### Publish the \"gno.land/p/demo/avl\" package.\n\n```bash\n./build/gnokey maketx addpkg test1 --pkgpath \"gno.land/p/demo/avl\" --pkgdir \"examples/gno.land/p/demo/avl\" --deposit 100000000ugnot --gas-fee 1000000ugnot --gas-wanted 2000000 --broadcast=true --chainid %%CHAINID%% --remote localhost:26657\n```\n\n### Publish the \"gno.land/r/demo/boards\" realm package.\n\n```bash\n./build/gnokey maketx addpkg test1 --pkgpath \"gno.land/r/demo/boards\" --pkgdir \"examples/gno.land/r/demo/boards\" --deposit 100000000ugnot --gas-fee 1000000ugnot --gas-wanted 300000000 --broadcast=true --chainid %%CHAINID%% --remote localhost:26657\n```\n"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"AnK+a6mcFDjY6b/v6p7r8QFW1M1PgIoQxBgrwOoyY7v3"},"signature":"sHjOGXZEi9wt2FSXFHmkDDoVQyepvFHKRDDU0zgedHYnCYPx5/YndyihsDD5Y2Z7/RgNYBh4JlJwDMGFNStzBQ=="}],"memo":""} {"msg":[{"@type":"/vm.m_call","caller":"g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq","send":"","pkg_path":"gno.land/r/gnoland/blog","func":"ModAddPost","args":["post1","First post","Lorem Ipsum","2022-05-20T13:17:22Z","","tag1,tag2"]}],"fee":{"gas_wanted":"2000000","gas_fee":"1000000ugnot"},"signatures":[{"pub_key":{"@type":"/tm.PubKeySecp256k1","value":"AnK+a6mcFDjY6b/v6p7r8QFW1M1PgIoQxBgrwOoyY7v3"},"signature":"sHjOGXZEi9wt2FSXFHmkDDoVQyepvFHKRDDU0zgedHYnCYPx5/YndyihsDD5Y2Z7/RgNYBh4JlJwDMGFNStzBQ=="}],"memo":""} diff --git a/gnovm/pkg/transpiler/transpiler_test.go b/gnovm/pkg/transpiler/transpiler_test.go index 81ea4b0dfcc..b9e9b218675 100644 --- a/gnovm/pkg/transpiler/transpiler_test.go +++ b/gnovm/pkg/transpiler/transpiler_test.go @@ -98,7 +98,7 @@ func hello() string { source: ` package foo -import "gno.land/r/users" +import "gno.land/r/demo/users" func foo() { _ = users.Register} `, @@ -108,7 +108,7 @@ func foo() { _ = users.Register} //line foo.gno:1:1 package foo -import "github.com/gnolang/gno/examples/gno.land/r/users" +import "github.com/gnolang/gno/examples/gno.land/r/demo/users" func foo() { _ = users.Register } `, @@ -117,9 +117,9 @@ func foo() { _ = users.Register } Path: &ast.BasicLit{ ValuePos: 21, Kind: 9, - Value: `"github.com/gnolang/gno/examples/gno.land/r/users"`, + Value: `"github.com/gnolang/gno/examples/gno.land/r/demo/users"`, }, - EndPos: 39, + EndPos: 44, }, }, },