Skip to content

Commit

Permalink
Merge branch 'master' into devx/feature/boardsv2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi authored Nov 15, 2024
2 parents 4c7d16b + 6c5329d commit 8874e8e
Show file tree
Hide file tree
Showing 90 changed files with 9,544 additions and 551 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: coursier/cache-action@v6.4.6

- name: Set up JDK 17
uses: coursier/setup-action@v1.3.6
uses: coursier/setup-action@v1.3.8
with:
jvm: temurin:1.17

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaser-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache: true

- uses: sigstore/cosign-installer@v3.7.0
- uses: anchore/sbom-action/download-syft@v0.17.5
- uses: anchore/sbom-action/download-syft@v0.17.7

- uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaser-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cache: true

- uses: sigstore/cosign-installer@v3.7.0
- uses: anchore/sbom-action/download-syft@v0.17.5
- uses: anchore/sbom-action/download-syft@v0.17.7

- uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cache: true

- uses: sigstore/cosign-installer@v3.7.0
- uses: anchore/sbom-action/download-syft@v0.17.5
- uses: anchore/sbom-action/download-syft@v0.17.7

- uses: docker/login-action@v3
with:
Expand Down
32 changes: 32 additions & 0 deletions docs/reference/gno-js-client/gno-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,38 @@ id: gno-js-provider
The `Gno Provider` is an extension on the `tm2-js-client` `Provider`,
outlined [here](../tm2-js-client/Provider/provider.md). Both JSON-RPC and WS providers are included with the package.

## Instantiation

### new GnoWSProvider

Creates a new instance of the Gno WebSocket Provider, based on [`tm2-js-client` `WSProvider`](../tm2-js-client/Provider/ws-provider.md).

#### Parameters

Same as [`tm2-js-client` `WSProvider`](../tm2-js-client/Provider/ws-provider.md).

#### Usage

```ts
new GnoWSProvider('ws://staging.gno.land:26657/ws');
// provider with WS connection is created
```

### new GnoJSONRPCProvider

Creates a new instance of the Gno JSON-RPC Provider, based on [`tm2-js-client` `JSONRPCProvider`](../tm2-js-client/Provider/json-rpc-provider.md).

#### Parameters

Same as [`tm2-js-client` `JSONRPCProvider`](../tm2-js-client/Provider/json-rpc-provider.md).

#### Usage

```ts
new GnoJSONRPCProvider('http://staging.gno.land:36657');
// provider is created
```

## Realm Methods

### getRenderOutput
Expand Down
46 changes: 31 additions & 15 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
# Gnolang examples
# Examples

This folder showcases Gnolang realms and library demos. These examples not only aid in engine testing but also provide a glimpse into the potential of Gnolang's capabilities.
This folder showcases example Gno realms (smart contracts) and pure packages (libraries).
These examples provide a glimpse into the potential of gno.land and the capabilities of Gno,
while also serving as a test suite for the GnoVM.

While sharing contracts here can enhance engine testing, it's not mandatory. If considering a separate repository for contracts, be aware that this might restrict the experience due to the continuous efforts around `gno mod` support. A key point to note is that the main repository cannot reference separate code, which might pose developmental challenges.
Pure packages and realms in this folder are pre-deployed to gno.land testnets,
making them readily available for on-chain use. However, **there is no guarantee
that the code is bug-free, so it should be used with caution and an understanding of potential risks.**

## Personal Realms & Shared Content

**Prioritizing Shared Content:** As we expand our examples and use-cases, it's essential to prioritize shared content that benefits the broader community. These examples serve as a foundation and reference for all users.

**Personal Realms Inclusion:** We're open to personal realms, but they must exemplify best practices and inspire others. To maintain our repository's organization, we may decline some realms. If so, consider uploading onchain and keeping source code separately. For higher acceptance odds, offer useful or original examples.
## Structure

**Recommended Approach:**
- Use `r/demo` and `p/demo` for generic examples and components that can be imported by others. These are meant to be easily referenced and utilized by the community.
- Personal realms are welcomed if they are easily maintainable with the Continuous Integration (CI) system. If a personal realm becomes cumbersome to maintain or doesn't align with the CI's checks, it might be relocated to a less prominent location or even removed.
This folder mimics the gno.land package path system; the "root" of the system is
the `gno.land` folder. Next, it branches out to `p/` and `r/`, which contain
pure packages and realms, respectively.

## Usage

Our recommendation is to use the [gno](../gnovm/cmd/gno) utility to develop contracts locally before publishing them on-chain. This approach offers a faster and streamlined workflow, along with additional debugging features. Simply fork or create new contracts and refer to the Makefile. Once everything looks good locally, you can then publish it on a localnet or testnet.
## Personal Realms & Shared Content

For further guidance and insights, please refer to the [`awesome-gno` tutorials](https://github.com/gnolang/awesome-gno#tutorials).
**Prioritizing Shared Content:** As we expand our examples and use-cases, it's
essential to prioritize shared content that benefits the broader community.
These examples serve as a foundation and reference for all users.

**Personal Realms & Pure Packages:** We welcome personal realms that
exemplify best practices and inspire others. To maintain the organization
of the monorepo, some submissions may be declined. If so, consider uploading
[permissionlessly](../docs/gno-tooling/cli/gnokey/state-changing-calls.md#addpackage)
and storing the source code in a separate repo. For higher
acceptance odds, offer useful and original examples.

**Recommended Approach:**
- Use `r/demo` and `p/demo` for generic examples and components that can be
imported by others. These are meant to be easily referenced and utilized by the
community.
- Packages under personal namespaces, such as in [r/leon](./gno.land/r/leon),
are welcome if they are easily maintainable with the Continuous Integration (CI)
system. If a personal realm becomes cumbersome to maintain or doesn't align with
the CI's checks, it might be relocated to a less prominent location or even removed.
11 changes: 8 additions & 3 deletions examples/gno.land/p/demo/fqname/fqname.gno
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
// package-level declaration.
package fqname

import "strings"
import (
"strings"
)

// Parse splits a fully qualified identifier into its package path and name
// components. It handles cases with and without slashes in the package path.
Expand Down Expand Up @@ -43,9 +45,9 @@ func Parse(fqname string) (pkgpath, name string) {

// Construct a qualified identifier.
//
// fqName := fqname.Construct("gno.land/r/demo/foo20", "GRC20")
// fqName := fqname.Construct("gno.land/r/demo/foo20", "Token")
// fmt.Println("Fully Qualified Name:", fqName)
// // Output: gno.land/r/demo/foo20.GRC20
// // Output: gno.land/r/demo/foo20.Token
func Construct(pkgpath, name string) string {
// TODO: ensure pkgpath is valid - and as such last part does not contain a dot.
if name == "" {
Expand All @@ -63,10 +65,13 @@ func RenderLink(pkgPath, slug string) string {
if slug != "" {
return "[" + pkgPath + "](" + pkgLink + ")." + slug
}

return "[" + pkgPath + "](" + pkgLink + ")"
}

if slug != "" {
return pkgPath + "." + slug
}

return pkgPath
}
4 changes: 2 additions & 2 deletions examples/gno.land/p/demo/fqname/fqname_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestConstruct(t *testing.T) {
name string
expected string
}{
{"gno.land/r/demo/foo20", "GRC20", "gno.land/r/demo/foo20.GRC20"},
{"gno.land/r/demo/foo20", "Token", "gno.land/r/demo/foo20.Token"},
{"gno.land/r/demo/foo20", "", "gno.land/r/demo/foo20"},
{"path", "", "path"},
{"path", "Split", "path.Split"},
Expand All @@ -62,7 +62,7 @@ func TestRenderLink(t *testing.T) {
{"gno.land/p/demo/avl", "", "[gno.land/p/demo/avl](/p/demo/avl)"},
{"github.com/a/b", "C", "github.com/a/b.C"},
{"example.com/pkg", "Func", "example.com/pkg.Func"},
{"gno.land/r/demo/foo20", "GRC20", "[gno.land/r/demo/foo20](/r/demo/foo20).GRC20"},
{"gno.land/r/demo/foo20", "Token", "[gno.land/r/demo/foo20](/r/demo/foo20).Token"},
{"gno.land/r/demo/foo20", "", "[gno.land/r/demo/foo20](/r/demo/foo20)"},
{"", "", ""},
}
Expand Down
215 changes: 0 additions & 215 deletions examples/gno.land/p/demo/grc/grc20/banker.gno

This file was deleted.

Loading

0 comments on commit 8874e8e

Please sign in to comment.