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

feat: official documentation #1046

Merged
merged 74 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
d8f1599
Add base Docusaurus setup
zivkovicmilos Aug 9, 2023
0c84b03
Remove docs README
zivkovicmilos Aug 9, 2023
b473202
Add content for the Overview
zivkovicmilos Aug 10, 2023
b4e3f7c
Update Installation doc
zivkovicmilos Aug 10, 2023
57a9e7b
Update the Create a private key section
zivkovicmilos Aug 10, 2023
a10d126
Update the Create a private key section
zivkovicmilos Aug 10, 2023
955042a
Update the Premining Balances tutorial
zivkovicmilos Aug 11, 2023
630be8f
Update the Running a Faucet tutorial
zivkovicmilos Aug 11, 2023
badb5d9
Update the Setting up a Local Chain doc
zivkovicmilos Aug 15, 2023
c7f611d
Update the Browsing Gno Source code doc
zivkovicmilos Aug 15, 2023
8845314
Add guide on creating a simple Realm
zivkovicmilos Sep 4, 2023
e93b74b
Add guide on creating a simple Package
zivkovicmilos Sep 4, 2023
019650a
Add guide on running tests
zivkovicmilos Sep 4, 2023
3a40dd4
Merge branch 'master' into feature/official-docs
zivkovicmilos Oct 3, 2023
da1fe7b
feat: add grc20 + grc721 guides (#16)
waymobetta Oct 8, 2023
c940c2c
feat: index from dev portal (#18)
r3v4s Oct 10, 2023
e2343c6
feat: add contents from portal (#19)
dongwon8247 Oct 10, 2023
a324ce5
feat: add howto - deploy & write-simple-dapp (#17)
leohhhn Oct 10, 2023
ab9c39a
initial explaination doc for gno modules (#20)
harry-hov Oct 11, 2023
db983b9
style: customize doc styles (#21)
alexiscolin Oct 12, 2023
22c0cde
Drop some docs temporarily
zivkovicmilos Oct 12, 2023
23a747f
Reorganize the docs, so they are framework agnostic
zivkovicmilos Oct 12, 2023
cfc4459
Clean up config
zivkovicmilos Oct 12, 2023
38d9a12
Merge branch 'master' into feature/official-docs
zivkovicmilos Oct 12, 2023
679fa08
Update docs/explanation/gno-language.md
zivkovicmilos Oct 17, 2023
7842672
Update docs/explanation/gno-language.md
zivkovicmilos Oct 17, 2023
4ec69ee
Update docs/explanation/gno-modules.md
zivkovicmilos Oct 17, 2023
7ae2920
Update docs/explanation/gno-modules.md
zivkovicmilos Oct 17, 2023
9f7ab77
Update docs/explanation/gno-test.md
zivkovicmilos Oct 17, 2023
4ba996d
Update docs/explanation/gno-tooling/cli/gnofaucet.md
zivkovicmilos Oct 17, 2023
67f73b8
Update docs/how-to-guides/Interact-with-gnoland.md
zivkovicmilos Oct 17, 2023
21283a8
Update docs/explanation/realms.md
zivkovicmilos Oct 17, 2023
35942e6
Update docs/explanation/realms.md
zivkovicmilos Oct 17, 2023
cd33a9c
Update docs/getting-started/working-with-key-pairs.md
zivkovicmilos Oct 17, 2023
ee0a7ff
Update docs/explanation/tendermint2.md
zivkovicmilos Oct 17, 2023
acaf2aa
Update docs/explanation/realms.md
zivkovicmilos Oct 17, 2023
d004bb1
Merge branch 'master' into feature/official-docs
zivkovicmilos Oct 21, 2023
6d3e57c
Rephrase sentence
zivkovicmilos Oct 21, 2023
531642c
Rephase Ethereum section
zivkovicmilos Oct 21, 2023
db5eda0
Fix typo
zivkovicmilos Oct 21, 2023
e4ee8a0
Update docs/explanation/gno-language.md
leohhhn Oct 31, 2023
43384c5
Update docs/explanation/gno-language.md
leohhhn Oct 31, 2023
b6089ba
Update docs/explanation/gno-language.md
leohhhn Oct 31, 2023
458598d
Update docs/explanation/gno-modules.md
leohhhn Oct 31, 2023
40fa990
Rephrase gno-language.md sentence
zivkovicmilos Nov 8, 2023
00cbe6d
Drop common params doc
zivkovicmilos Nov 8, 2023
6bf83af
Improve gnofaucet.md
zivkovicmilos Nov 8, 2023
3603681
Add disclaimer for Adena
zivkovicmilos Nov 8, 2023
7254544
Swap test3 for staging
zivkovicmilos Nov 8, 2023
72e20b1
Update docs/getting-started/setting-up-a-local-chain.md
zivkovicmilos Nov 8, 2023
ecdb870
Merge branch 'feature/official-docs' of https://github.com/zivkovicmi…
zivkovicmilos Nov 8, 2023
969e914
Add form GUI explanation
zivkovicmilos Nov 8, 2023
e89d450
Rename file
zivkovicmilos Nov 8, 2023
1e627ef
Rename installation to local setup
zivkovicmilos Nov 8, 2023
fba2029
Add link to Gnolang
zivkovicmilos Nov 8, 2023
824816e
Rename Packages to Pure Packages
zivkovicmilos Nov 8, 2023
ef941e0
Add disclaimer for chain id
zivkovicmilos Nov 8, 2023
e8f1460
Update tm2 doc
zivkovicmilos Nov 8, 2023
d6ee4da
Add code embed support
zivkovicmilos Nov 8, 2023
43d4dba
Rename lang shorthand
zivkovicmilos Nov 8, 2023
b949947
Update docs/explanation/gno-modules.md
zivkovicmilos Nov 8, 2023
7da892e
Update docs/explanation/gno-modules.md
zivkovicmilos Nov 8, 2023
2206eac
Rephrase
zivkovicmilos Nov 8, 2023
4b6fa24
Update docs/explanation/gno-modules.md
zivkovicmilos Nov 8, 2023
3c67978
Update docs/explanation/gno-modules.md
zivkovicmilos Nov 8, 2023
f888653
Update docs/explanation/gno-modules.md
zivkovicmilos Nov 8, 2023
b1ac173
Remove duplicate compatibility doc
zivkovicmilos Nov 8, 2023
6b68949
Merge branch 'master' into feature/official-docs
zivkovicmilos Nov 8, 2023
8ba08b8
Add devrels to own the docs
zivkovicmilos Nov 8, 2023
90922f5
Fix hanging references
zivkovicmilos Nov 9, 2023
408f0fa
Update docs/explanation/gnovm.md
zivkovicmilos Nov 9, 2023
9073308
Update docs/explanation/gnovm.md
zivkovicmilos Nov 9, 2023
34de86c
Merge branch 'master' into feature/official-docs
zivkovicmilos Nov 9, 2023
5e9b9d2
Merge branch 'feature/official-docs' of https://github.com/zivkovicmi…
zivkovicmilos Nov 9, 2023
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
20 changes: 20 additions & 0 deletions docs/gno-docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
3 changes: 3 additions & 0 deletions docs/gno-docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/gno-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: gno-doc
---

# Gno Doc

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/gno-language.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: gno-language
---

# The Gno Language

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/gno-modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: gno-modules
---

# Gno Modules

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/gno-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: gno-test
---

# Gno Test

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/gno-tooling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: gno-tooling
---

# Gno Tooling

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/gnovm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: gnovm
---

# GnoVM

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/ibc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: ibc
---

# IBC

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: packages
---

# Packages

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/realms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: realms
---

# Realms

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/standard-library.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: explain-standard-library
---

# Gno Standard Library

TODO
7 changes: 7 additions & 0 deletions docs/gno-docs/docs/explanation/tendermint2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: tendermint2
---

# Tendermint2

TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: browsing-gno-source-code
---

# Browsing Gno Source Code

TODO
111 changes: 111 additions & 0 deletions docs/gno-docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
id: installation
---

# Installation

## Overview

In this tutorial, you will learn how to set up the Gno development environment locally, so you
can get up and running writing Gno code. You will download and install all the necessary tooling,
and validate that they are correctly configured to run on your machine.

## Prerequisites

- **Git**
- **`make` (for running Makefiles)**
- **Go 19+**

## 1. Cloning the repository

To get started with a local Gno.land development environment, you must clone the GitHub repository
somewhere on disk:

```bash
git clone https://github.com/gnolang/gno.git
```

## 2. Installing the `gno` development toolkit

Next, we are going to build and install the `gno` development toolkit.
`gno` provides ample functionality to the user, among which is running, precompiling, testing and building `.gno` files.

To install the toolkit, navigate to the `gnovm` folder from the repository root, and run the `build` make directive:

```bash
cd gnovm
make build
```

This will build out the necessary `gno` binary into the `gnovm/cmd` sub-folder:

![gno tool build](../../static/img/getting-started/installation/make-build-gnovm.gif)

Next, to make development easier, we need to make the binary available system-wide.
From the same `gnovm` sub-folder, you can run:

```bash
make install
```

To verify the `gno` binary is installed system-wide, you can run:

```bash
gno --help
```

You should get the help output from the command:

![gno help](../../static/img/getting-started/installation/gno-help.gif)

Alternatively, if you don't want to have the binary callable system-wide, you can run the binary directly:

```bash
go run ./cmd/gno --help
```

## 3. Installing other `gno` tools

The next step is to install several other tools that are required for the Gno development environment, like

- `gnoland` - the Gno [blockchain node](setting-up-a-local-chain.md)
- `gnokey` - the Gno [private key manager](creating-a-key-pair.md)
- `gnoweb` - the Gno [source code viewer](browsing-gno-source-code.md)
- `gnofaucet` - the Gno [native currency faucet](setting-up-funds/running-a-faucet.md)

To build these tools, from the root directory navigate to the `gno.land` sub-folder, and run the `build` make
directive:

```bash
cd gno.land
make build
```

This will build out the necessary binaries into the `gno.land/cmd` sub-folder:

![gno tools build](../../static/img/getting-started/installation/make-build-gnoland.gif)

Same as with the `gno` tool, we can make these binaries available system-wide.
From the same `gno.land` sub-folder, you can run:

```bash
make install
```

To verify that, for example, the `gnokey` binary is installed system-wide, you can run:

```bash
gnokey --help
```

You should get the help output from the command:

![gnokey help](../../static/img/getting-started/installation/gnokey-help.gif)

## Conclusion

That's it 🎉

You have successfully built out and installed the necessary tools for Gno development!

In further documents, you will gain a better understanding on how they are used to make Gno work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
id: setting-up-a-local-chain
---

# Setting up a Local Chain

TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
id: premining-balances
---

# Premining Balances

## Overview

In this tutorial, you will gain an understanding on how to premine native currency on a local Gno.land chain.
Additionally, you will understand how to query the account balance after you premine it.

Premining balance is the process of making sure some accounts (addresses) have specific funds when the chain initially
launches. In the context of local chain deployments, premine balances are used to ensure the user accounts (developers)
have ample funds to interact with the chain and facilitate contract deployments.

## Prerequisites

- **`gnoland` and `gnokey` set up. Reference the [Installation](../installation.md#3-installing-other-gno-tools) guide
for steps**

## 1. Clean chain data

In order for us to premine funds on a fresh chain, we need to make sure we do not have any leftover blockchain data
from previous chain runs.

The blockchain node, when it runs, works with an embedded DB locally on disk to store execution data (such as
configuration files, or the state DB). For Gno blockchain nodes, this working directory is labeled as `testdir` by
default.

To clean out old blockchain data, navigate to the `gno.land` folder and run the appropriate make command:

```bash
cd gno.land
make fclean
```

## 2. Change the `genesis_balances.txt` file

When the Gno node boots up, among other things, it reads a file called `genesis_balances.txt` to generate the initial
balance set for the blockchain.

An example of how this looks like in the initial `genesis.json` file after the chain starts:

```bash
"app_state": {
"@type": "/gno.GenesisState",
"balances": [
"g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5=10000000000000ugnot",
"g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj=10000000000000ugnot",
"g1f4v282mwyhu29afke4vq5r2xzcm6z3ftnugcnv=1000000000000ugnot",
"g127jydsh6cms3lrtdenydxsckh23a8d6emqcvfa=1000000000000ugnot"
],
```

The `genesis_balances.txt` file is located at `./gno.land/genesis/genesis_balances.txt`.

To add a new entry to the premine table, simply append a line to the end of the file:

```bash
g1qpymzwx4l4cy6cerdyajp9ksvjsf20rk5y9rtt=10000000000ugnot # My address
```

Replace `g1qpymzwx4l4cy6cerdyajp9ksvjsf20rk5y9rtt` with the address you want balance on, and `10000000000ugnot` with the
desired `ugnot` balance.

## 3. Start the local chain

Now that our address and the desired premine balance is located in the `genesis_balances.txt` file, we can start the
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
local Gno node.

To run the local Gno node, make sure you are in the `gno.land` sub-folder, and run the appropriate make command:

```bash
cd gno.land
gnoland start
```

This command will initialize the Gno node, generate the `genesis.json` with our newly added premine information, and
start the chain.

![gnoland start](../../../static/img/getting-started/setting-up-funds/gnoland-start.gif)

## 3. Check the account balance

To check the balance of any account (or the account we just premined), we can use the following ABCI query:

```bash
gnokey query --remote localhost:26657 bank/balances/g1qpymzwx4l4cy6cerdyajp9ksvjsf20rk5y9rtt
```

Let's break down this command:

- **`--remote`** - the JSON-RPC URL of the running Gno node. In the case of a local deployment, the default value
is `localhost:26657`
- **`bank/balances/g1qpymzwx4l4cy6cerdyajp9ksvjsf20rk5y9rtt`** - the ABCI query targets the `bank` module to find
the `balances` for address `g1qpymzwx4l4cy6cerdyajp9ksvjsf20rk5y9rtt`. Replace the address with your desired address

![gnokey query](../../../static/img/getting-started/setting-up-funds/gnokey-query.gif)

## Conclusion

That's it 🎉

You have successfully premined a native currency balance on a locally-running Gno chain!
Additionally, you have also learned how to query the native currency balance for an address, using built-in ABCI queries
and the `gnokey` tool.
Loading
Loading