Skip to content

Commit

Permalink
feat: update nakamoto docs for clarinet
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard committed Aug 2, 2024
1 parent acfc534 commit fe24587
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions content/docs/stacks/nakamoto/guides/clarinet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,48 @@ title: Updates for Clarinet
description: Discover Clarinet upgrades related to the Nakamoto release.
---

## Launch devnet in Nakamoto mode
## Setting up a project for Nakamoto

As of [Clarinet 2.4.0](https://github.com/hirosystems/clarinet/releases/tag/v2.4.0), devnet can run the blockchain in Nakamoto mode.
As of [Clarinet 2.8.0](https://github.com/hirosystems/clarinet/releases/tag/v2.8.0), devnet can run
the blockchain in Nakamoto mode and support Clarity 3 contracts.

Once your devnet reaches the right block height, it will deploy the `pox-4.clar` contract and run in
Epoch 2.5.
From there, Clarinet will send `stack-stx` and `stack-extend` requests to the new PoX contract.
In Nakamoto mode, devnet has 2 signers. Eventually, you can observe the
`vote-for-aggregate-public-key` transactions that they send.
Once the devnet reaches the right block height, (Bitcoin block #108 by default), it will deploy the
`pox-4.clar` contract and run in Epoch 2.5. From there, Clarinet will send `stack-stx` and
`stack-extend` requests to the new PoX contract. In Nakamoto mode, devnet has 2 signers. Eventually,
you can observe the `vote-for-aggregate-public-key` transactions that they send.

Do not expect to reach Epoch 3.0 with Clarinet 2.4.0. This release is focusing on Epoch 2.5.
Epoch 3.0, with fast blocks and others improvements, will come in a future release.
By default, the Devnet will not get to Epoch 3.0 ("Nakamoto activation" with fast blocks). For that, the `epoch_3_0` height as to be set manually in the `Devnet.toml` file. Using one of your Clarinet projects, or a new one (with `$ clarinet new nakademo`), update the
`settings/Devnet.toml` with the following settings:

### Setting up a project for Nakamoto
```toml
[devnet]
epoch_3_0 = 144

Using one of your Clarinet projects, or a new one (with `clarinet new nakamoto-project`), update the
`settings/Devnet.toml`.
stacks_node_image_url = "quay.io/hirosystems/stacks-node:devnet-3.0"
stacks_signer_image_url = "quay.io/hirosystems/stacks-signer:devnet-3.0"
```

Under the `[devnet]` section when `use_nakamoto = true` is set, the `pox-4.clar` contract should be
deployed around the **Bitcoin block 108**.
Set a contract to be deployed in epoch 3.0 with Clarity 3. You can create a new one with `$ clarinet contract new nakademo`). It needs to be manually update in the project manifest (Clarinet.toml)

```toml
[devnet]
use_nakamoto = true
[contracts.nakademo]
path = 'contracts/nakademo.clar'
clarity_version = 3
epoch = 3.0
```

Start devnet with `clarinet devnet start`.

## Deploy contracts on the Nakamoto Testnet
## Deploy contracts on the Nakamoto Testnets

A Nakamoto testnet is available and running in Epoch 2.5. Clarinet can be used to deploy contracts
on testnet.
A Nakamoto testnet is available and running in Epoch 3.0. Clarinet can be used to deploy Clarity 3 contracts on this tesnet.

In a Clarinet project, the `settings/Testnet.toml` file can be updated like so:

```toml
[network]
name = "testnet"
stacks_node_rpc_address = "https://api.testnet.hiro.so"
stacks_node_rpc_address = "https://api.nakamoto-1.hiro.so"
deployment_fee_rate = 10

[accounts.deployer]
Expand Down

0 comments on commit fe24587

Please sign in to comment.