Skip to content

Commit

Permalink
Update docs (#617)
Browse files Browse the repository at this point in the history
* [skip ci] - the only thing this commit could benefit from is website deployment, but this was already done while testing if the improvement actually helps on github pages
  • Loading branch information
FabijanC authored Sep 25, 2024
1 parent 2cf5363 commit 5c2079e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
23 changes: 5 additions & 18 deletions website/docs/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,7 @@ In case of demanding block creation with no pending transactions, a new empty bl

The creation of the genesis block is not affected by this feature.

```
POST /create_block
```

```
JSON-RPC
{
"jsonrpc": "2.0",
"id": "1",
"method": "devnet_createBlock"
}
```

Response:

```
{'block_hash': '0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67'}
```
The specifications of a block-creating request can be found [below](#request-new-block-creation).

## Automatic periodic block creation

Expand Down Expand Up @@ -90,6 +73,10 @@ Response:

The newly created block will contain all pending transactions, if any, since the last block creation.

### Timestamp manipulation

To affect the timestamp of the newly created block, check out [this page](./starknet-time#set-time)

## Abort blocks

This functionality allows simulating block abortion that can occur on mainnet. It is supported in the `--state-archive-capacity full` mode.
Expand Down
4 changes: 4 additions & 0 deletions website/docs/forking.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ The value passed to `--fork-network` should be the URL to a Starknet JSON-RPC AP
## Deploying an undeclared account

[Here](./predeployed#deploying-an-undeclared-account) you can read about deploying an account not declared on Devnet.

## Checking forking status

To see if your Devnet instance is using forking or not, [fetch the current configuration](./api#config-api), and check the `url` property of its `fork_config` property. If Devnet is forked, this property contains the string of the origin URL specified on startup.
13 changes: 12 additions & 1 deletion website/docs/predeployed.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ If you want to deploy an instance of an account contract class not predeclared o

## How to get predeployment info?

The information on predeployed contracts is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a `GET` request to `/predeployed_accounts`. With the additional query parameter `with_balance=true`, WEI and FRI balances at the pending state will be provided:
### Logged on startup

The startup log includes:

- the addresses and class hashes of predeployed contracts
- the keys and initial balance of predeployed account contracts

### API

Account class info can be found in the response to [config request](api#config-api).

Predeployed account details can be retrieved in JSON format by sending a `GET` request to `/predeployed_accounts` or via JSON-RPC. With the additional query parameter `with_balance` set to `true`, ETH and STRK balances at the pending state will be provided, in WEI and FRI, respectively:

```
GET /predeployed_accounts?[with_balance=true]
Expand Down
8 changes: 4 additions & 4 deletions website/docs/starknet-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All values should be set in [Unix time seconds](https://en.wikipedia.org/wiki/Un

## Set time

Sets the exact time and generates a new block.
The following sets the exact time and generates a new block:

```
POST /set_time
Expand All @@ -27,7 +27,7 @@ JSON-RPC
}
```

Doesn't generate a new block, but sets the exact time for the next generated block.
The following doesn't generate a new block, but sets the exact time for the next generated block:

```
POST /set_time
Expand Down Expand Up @@ -77,8 +77,8 @@ JSON-RPC

## Start time argument

Devnet can be started with `--start-time` CLI argument, where `START_TIME_IN_SECONDS` should be greater than 0.
Devnet's time can be defined on startup via CLI by providing a positive value to `--start-time`:

```
$ starknet-devnet --start-time <START_TIME_IN_SECONDS>
$ starknet-devnet --start-time <SECONDS>
```
1 change: 1 addition & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const config: Config = {
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/starknet-devnet-rs/',
trailingSlash: false,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down

0 comments on commit 5c2079e

Please sign in to comment.