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

Update write-package.mdx #21390

Merged
merged 2 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions docs/content/guides/developer/first-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ title: Your First Sui dApp
description: Build your first dApp and publish it on chain. These guides demonstrate the basics you need to know to start your development journey on Sui.
---

Before you can create your first dApp, you must have [Sui installed](./getting-started/sui-install.mdx).
Before you can create your first dApp on the Sui network, you must have [Sui installed](./getting-started/sui-install.mdx).

You use Move to write packages that live on chain, meaning they exist on the Sui network you publish them to. The instructions in this section walk you through writing a basic package, debugging and testing your code, and publishing. You need to follow these instructions in order to complete the exercise.
dApp stands for "decentralized application", which is an application that runs on a blockchain or decentralized network instead of a centralized server. Typical dApps do not run solely on the blockchain, but instead are composed of different pieces, like a TypeScript frontend that interacts with code that lives on a blockchain. Sui needs code written in Move for the pieces of a dApp that live on chain. These pieces are referred to as packages, modules, or smart contracts.

The instructions in this section walk you through writing a basic package, debugging and testing your code, and publishing. You need to follow these instructions in the order they appear to complete the exercise.

You use the `move` Sui CLI command for some instructions. The Sui CLI installs with the binaries, so you have it on your system if you follow the install instructions. To verify you have it installed, run the following command in a terminal or console.

Expand Down
8 changes: 2 additions & 6 deletions docs/content/guides/developer/first-app/write-package.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ The manifest file contents include available sections of the manifest and commen

### Defining the package

You have a package now but it doesn't do anything. To make your package useful, you must add logic contained in `.move` source files that define _modules_. Use a text editor or the command line to create your first package source file named `example.move` in the `sources` directory of the package:

```sh
$ touch my_first_package/sources/example.move
```
You have a package now but it doesn't do anything. To make your package useful, you must add logic contained in `.move` source files that define _modules_. The `sui move new` command creates a .move file in the `sources` directory that defaults to the same name as your project (`my_first_package.move` in this case). For the purpose of this guide, rename the file to `example.move` and open it with a text editor.

Populate the `example.move` file with the following code:

Expand All @@ -49,4 +45,4 @@ After you save the file, you have a complete Move package.

- [Build and Test Packages](./build-test.mdx): Continue this example to build and test your package to get it ready for publishing.
- [Sui Move CLI](../../../references/cli/move.mdx): Available Move commands the CLI provides.
- [Sui Move Book](https://move-book.com/): A comprehensive guide to the Move programming language and the Sui blockchain.
- [Sui Move Book](https://move-book.com/): A comprehensive guide to the Move programming language and the Sui blockchain.
5 changes: 5 additions & 0 deletions docs/content/guides/developer/getting-started/sui-install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ The prerequisites needed for the macOS operating system include:
- CMake
- libpq (optional)
- Git CLI
- PostgreSQL

macOS includes a version of cURL you can use to install Homebrew. Use Homebrew to install other tools, including a newer version of cURL.

Expand Down Expand Up @@ -371,6 +372,10 @@ $ brew install git

After installing Git, download and install the [Git command line interface](https://git-scm.com/download/).

#### PostgreSQL

Visit the official [PostgreSQL website](https://wiki.postgresql.org/wiki/Main_Page) for instructions on downloading PostgreSQL.

</TabItem>

<TabItem value="win" label="Windows">
Expand Down
Loading