Skip to content

Commit

Permalink
fix(devx): apply suggestion from review.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-tortora committed Aug 5, 2024
1 parent 48626f7 commit 7dfd565
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 67 deletions.
85 changes: 42 additions & 43 deletions docs/content/developer/getting-started/connect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,9 @@ import AlphaNet from "../../_snippets/alphanet.mdx";

# Connect to an IOTA Network

You can use the following networks to develop on IOTA. If you are still developing your application, you should use the
Devnet or Testnet, as these networks provide convenient faucets for test tokens.

## Alphanet

A temporary network while still in early development, used before public launch of IOTA Rebased. Will be replaced by the Testnet afterwards.

<AlphaNet />

## Devnet

The latest stable release. As such, it has the latest features that were tested in the `development` branch of the
repository.

## Testnet

Once a release has been battle-tested in the Devnet, it moves to the Testnet. You can use this network to
test your software in real-world conditions.

<DataWipe />

:::info Testnet node validators

The IOTA Alphanet, Testnet and Devnet networks consist of four validator nodes operated by the IOTA Foundation.

:::

## Mainnet

The fully operational production network, with data persistence and where tokens have real value.

<DataWipe />

:::tip Local Networks

You can also spin up a [local IOTA network](local-network.mdx) for local development.

:::

## IOTA CLI

IOTA provides [IOTA command line interface (CLI)](/references/cli/client.mdx) to interact with IOTA networks:
IOTA provides [IOTA command line interface (CLI)](/references/cli/client.mdx) to interact with [IOTA networks](#iota-networks):

- Create and manage your private keys
- Create example NFTs
Expand Down Expand Up @@ -138,7 +99,7 @@ Secret Recovery Phrase : [hat become demise beyond history wood stage add nice l

The [IOTA CLI Client](../../references/cli/client.mdx) allows you to add any number of network environments.

:::tip Check the current Network ENVs
### Check the Current Network ENVs

You can easily check the currently configured environments using the following command, which will output the
environment `alias` and URL, as well as indicate the currently active environment:
Expand All @@ -152,7 +113,6 @@ The command outputs the available environment aliases, with `(active)` denoting
localnet => http://0.0.0.0:9000 (active)
alphanet => https://api.iota-rebased-alphanet.iota.cafe:443
```
:::

<AlphaNet />

Expand All @@ -171,4 +131,43 @@ You can switch the current environment using the following command:
iota client switch --env <EnvAlias>
```

* Where `<EnvAlias>` is one of your currently set environments.
* Where `<EnvAlias>` is one of your currently set environments.
You can use the following networks to develop on IOTA. If you are still developing your application, you should use the
Devnet or Testnet, as these networks provide convenient faucets for test tokens.

## IOTA Networks

### Alphanet

A temporary network while still in early development, used before public launch of IOTA Rebased. Will be replaced by the Testnet afterwards.

<AlphaNet />

### Devnet

The latest stable release. As such, it has the latest features that were tested in the `development` branch of the
repository.

### Testnet

Once a release has been battle-tested in the Devnet, it moves to the Testnet. You can use this network to
test your software in real-world conditions.

<DataWipe />

:::info Testnet node validators

The IOTA Alphanet, Testnet and Devnet networks consist of four validator nodes operated by the IOTA Foundation.

:::

### Mainnet

The fully operational production network, with data persistence and where tokens have real value.


:::tip Local Networks

You can also spin up a [local IOTA network](local-network.mdx) for local development.

:::
2 changes: 1 addition & 1 deletion docs/content/developer/getting-started/create-a-module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags: [IOTA, Move, module, smart contract, development]

# Create a Move Module

A [package](create-a-package.mdx) by itself doesn't do much; its utility is defined by its modules. A module contains the logic for your package. You can create any number of modules per package. To add a module, create a `.move` file in the `sources` directory. For this guide, create a file called `my_module.move` and add the following content:
A [package](create-a-package.mdx)'s utility is defined by its modules. A module contains the logic for your package. You can create any number of modules per package. To add a module, create a `.move` file in the `sources` directory. For this guide, create a file called `my_module.move` and add the following content:

:::tip Comments in `.move` files

Expand Down
60 changes: 37 additions & 23 deletions docs/content/developer/getting-started/create-a-package.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
---
description: How to create a Move package in IOTA
tags: [Move, Package Creation, .toml, manifest]
tags: [ Move, Package Creation, .toml, manifest ]
---

# Create a Move Package

Once you have [installed IOTA](iota-install.mdx), you are ready to create your first IOTA Move [package](../iota-101/iota-move-concepts/packages/packages.mdx). Use the following command to create a standard package:
Once you have [installed IOTA](iota-install.mdx), you are ready to create your first IOTA
Move [package](../iota-101/iota-move-concepts/packages/packages.mdx). In IOTA, packages are the way to organize
the [modules](create-a-module.mdx) that make up your smart contract program. When you publish a package to any IOTA
network, it will be assigned an address you can use to interact with the package by
issuing [transactions](../iota-101/transactions/transactions.mdx).

Use the following command to create a standard package:

```shell
iota move new <PACKAGE_NAME>
iota move new my_first_package
```

* **Where** `<PACKAGE_NAME>` is the name you want for your package. This guide uses `my_first_package`.

The command will create and populate the `my_first_package` directory with a skeleton for an IOTA Move project, consisting of the following files and directories:
The command will create and populate the `my_first_package` directory with a skeleton for an IOTA Move project,
consisting of the following files and directories:

## `Move.toml`

Expand Down Expand Up @@ -65,79 +70,88 @@ my_first_package = "0x0"

### Package

The `[package]` section describes the package. By default, the `iota move new` command populates only the `name` value of the metadata.
The `[package]` section describes the package. By default, the `iota move new` command populates only the `name` value
of the metadata.

- `name`: The package name when it is imported.
- `version`: The package version. It can be used in release management.
- `edition`: The edition of the Move language; currently, the only valid value is `2024`.

### Dependencies

The `[dependencies]` section specifies the dependencies of the project. The dependency specification can be a git repository URL or a path to the local directory.
The `[dependencies]` section specifies the dependencies of the project. The dependency specification can be a git
repository URL or a path to the local directory.

```toml
```rust
# git repository
iota = { git = "https://github.com/iotaledger/iota.git", subdir = "crates/iota-framework/packages/iota-framework", rev = "framework/testnet" }

# local directory
MyPackage = { local = "../my-package" }
```

Packages also import addresses from other packages. For example, the IOTA dependency adds the `std` and `iota` addresses to the project. These addresses can be used in the code as aliases for the addresses.
Packages also import addresses from other packages. For example, the IOTA dependency adds the `std` and `iota` addresses
to the project. These addresses can be used in the code as aliases for the addresses.

### Resolving Version Conflicts with `override`

If you have two dependencies that use different versions of the same package, you can override the dependency in the `[dependencies]` section. To do so, add the `override` field to the dependency. The version specified in the `[dependencies]` section will be used instead of the one specified in the dependency itself.
If you have two dependencies that use different versions of the same package, you can override the dependency in
the `[dependencies]` section. To do so, add the `override` field to the dependency. The version specified in
the `[dependencies]` section will be used instead of the one specified in the dependency itself.

```toml
```rust
[dependencies]
iota = { override = true, git = "https://github.com/iotaledger/iota.git", subdir = "crates/iota-framework/packages/iota-framework", rev = "framework/testnet" }
```

### Dev-dependencies

You can also add a `[dev-dependencies]` section to the manifest to override dependencies in the dev and test modes. For example, if you want to use a different version of the IOTA package in dev mode, you can add a custom dependency specification to the `[dev-dependencies]` section.
You can also add a `[dev-dependencies]` section to the manifest to override dependencies in the dev and test modes. For
example, if you want to use a different version of the IOTA package in dev mode, you can add a custom dependency
specification to the `[dev-dependencies]` section.

### Addresses

The `[addresses]` section is used to add aliases for the addresses you use in your package. You can add any address in this section, and then use its alias in the code instead of the actual address. For example, if you add `alice = "0xA11CE"` to this section, you can use `alice` as `0xA11CE` in the code.
The `[addresses]` section is used to add aliases for the addresses you use in your package. You can add any address in
this section, and then use its alias in the code instead of the actual address. For example, if you
add `alice = "0xA11CE"` to this section, you can use `alice` as `0xA11CE` in the code.

### Dev-addresses

Much like the `[dev-dependencies]` section, you can also define `[dev-addresses]` to override the addresses you defined in the `[addresses]` section for test and dev modes.
Much like the `[dev-dependencies]` section, you can also define `[dev-addresses]` to override the addresses you defined
in the `[addresses]` section for test and dev modes.

:::note Override Only
You cannot introduce new aliases in this section, only override the ones you defined in [`[addresses]`](#addresses).
:::

## TOML Styles

The TOML format supports two styles for tables: inline and multiline. The examples above use the inline style, but it is also possible to use the multiline style. You wouldn't want to use it for the `[package]` section, but it can be useful for the dependencies.
The TOML format supports two styles for tables: inline and multiline. The examples above use the inline style, but it is
also possible to use the multiline style. You wouldn't want to use it for the `[package]` section, but it can be useful
for the dependencies.

<Tabs groupId="toml-style">
<TabItem label="Inline" value="inline">

```toml
# Inline style
```move
[dependencies]
iota = { override = true, git = "", subdir = "crates/iota-framework/packages/iota-framework", rev = "framework/testnet" }
MyPackage = { local = "../my-package" }
```

</TabItem>
<TabItem label="Multiline" value="multiline">
```toml
# Multiline style
```move
[dependencies.iota]
override = true
git = "https://github.com/iotaledger/iota.git"
subdir = "crates/iota-framework/packages/iota-framework"
rev = "framework
/testnet"
rev = "framework/testnet"
[dependencies.MyPackage]
local = "../my-package"
```
</TabItem>
</Tabs>

0 comments on commit 7dfd565

Please sign in to comment.