diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..253f0b7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Install Gno + run: | + curl --proto '=https' --tlsv1.2 -sSf \ + https://raw.githubusercontent.com/gnolang/gno/master/misc/install.sh \ + | sh -s -- --from-source + echo "$HOME/.gno/bin" >> "$GITHUB_PATH" + + - name: Test + run: gno test . + + - name: Lint + run: gno lint . diff --git a/Makefile b/Makefile index 7d6bf2b..aa8bc85 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,12 @@ .PHONY: install dev test install: - curl -sSL https://raw.githubusercontent.com/gnolang/gno/master/misc/install.sh | bash - + # --from-source is required: the installer's prebuilt-binary mode looks for + # v* release tags, and gnolang/gno only publishes chain/* tags today. + curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/gnolang/gno/master/misc/install.sh | sh -s -- --from-source + @echo '>> binaries are in $$HOME/.gno/bin — add it to your PATH:' + @echo ' export PATH="$$HOME/.gno/bin:$$PATH"' + dev: gnodev . diff --git a/README.md b/README.md index 03cb75a..7f45f0c 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,21 @@ check out the "Next Steps" section below for links to more advanced resources. make install -This will check if Go is installed and install the required Gno tools. +This clones `gnolang/gno` and builds `gno`, `gnokey`, `gnodev`, `gnobro` and +`gnoweb` into `$HOME/.gno/bin`. It needs Go, git and make, and takes a few +minutes the first time. Add the directory to your `PATH` before continuing: + + export PATH="$HOME/.gno/bin:$PATH" + +(The installer also has a faster prebuilt-binary mode, but it currently looks +for `v*` release tags and `gnolang/gno` only publishes `chain/*` tags, so +`--from-source` is the path that works today.) 3. Start the development server: make dev -4. Open your browser and visit https://localhost:8888 +4. Open your browser and visit http://localhost:8888 ## What's Included @@ -33,6 +41,19 @@ This repository contains a simple Gno realm with: - A `Set` function to update the realm's state - A `Get` function to retrieve the stored message +## Deploying it + +`gnodev` runs a throwaway local chain. When you want your realm on a real +network: + +- **A testnet** — start here. Testnets are renamed and replaced every few + weeks, so look up the current one and its RPC endpoint in + [Gno networks](https://docs.gno.land/resources/gnoland-networks), and get + tokens from the [faucet](https://faucet.gno.land). +- **[Mainnet](https://gno.land)** (`gnoland-1`, + `https://rpc.gno.land:443`) has been live since 12 September 2026. Real + GNOT, no faucet. + ## Next Steps Ready to learn more? Check out these resources: diff --git a/hello.gno b/hello.gno index a1033b1..30b75cd 100644 --- a/hello.gno +++ b/hello.gno @@ -13,7 +13,7 @@ Try it out with gnokey: gnokey add myaccount gnokey list -[And click here](/r/demo/hello$help&func=Set&newMsg=Hello%20from%20Gnokey!) +[And click here](/r/example/hello$help&func=Set&newMsg=Hello%20from%20Gnokey!) ` } diff --git a/hello_test.gno b/hello_test.gno index de2367f..2be6411 100644 --- a/hello_test.gno +++ b/hello_test.gno @@ -4,14 +4,14 @@ import ( "testing" ) -func TestSetAndGet(t *testing.T) { +func TestSetAndGet(cur realm, t *testing.T) { // Test initial state if got := Get(); got != "Hello, Gno!" { t.Errorf("Expected default message, got %s", got) } // Test setting a new message - Set(cross, "Hello, Test!") + Set(cross(cur), "Hello, Test!") if got := Get(); got != "Hello, Test!" { t.Errorf("Expected 'Hello, Test!', got %s", got) }