Skip to content

Commit

Permalink
Merge branch 'main' into rianhughes/rpc8-getMessageStatus2
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill <[email protected]>
  • Loading branch information
kirugan authored Nov 19, 2024
2 parents 810a6bd + 226c571 commit c7dfcb9
Show file tree
Hide file tree
Showing 37 changed files with 1,690 additions and 501 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '0 0 * * *'

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open 35 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
stale-pr-message: 'This pull request is stale because it has been open 35 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
days-before-stale: 60
days-before-close: 14
exempt-all-milestones: true
exempt-issue-labels: no-stale
exempt-pr-labels: no-stale
delete-branch: true
2 changes: 1 addition & 1 deletion .github/workflows/juno-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build golang dependencies and binaries
FROM ubuntu:24.10 AS build
FROM ubuntu:25.04 AS build

ARG VM_DEBUG

Expand All @@ -20,7 +20,7 @@ RUN bash -c 'source ~/.cargo/env && VM_DEBUG=${VM_DEBUG} make juno'
RUN upx-ucl /app/build/juno

# Stage 2: Build Docker image
FROM ubuntu:24.10 AS runtime
FROM ubuntu:25.04 AS runtime

RUN apt-get update && apt-get install -y ca-certificates curl gawk grep libjemalloc-dev libjemalloc2

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ install-mockgen:
go install go.uber.org/mock/mockgen@latest

install-golangci-lint:
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
@which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0

lint: install-golangci-lint
golangci-lint run
Expand Down
2 changes: 1 addition & 1 deletion blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type Reader interface {

var (
ErrParentDoesNotMatchHead = errors.New("block's parent hash does not match head block hash")
supportedStarknetVersion = semver.MustParse("0.13.2")
supportedStarknetVersion = semver.MustParse("0.13.3")
)

func checkBlockVersion(protocolVersion string) error {
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/_config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
| `cn-unverifiable-range` | `[]` | Custom network range of blocks to skip hash verifications (e.g. `0,100`) |
| `colour` | `true` | Use `--colour=false` command to disable colourized outputs (ANSI Escape Codes) |
| `config` | | The YAML configuration file |
| `db-cache-size` | `8` | Determines the amount of memory (in megabytes) allocated for caching data in the database |
| `db-cache-size` | `1024` | Determines the amount of memory (in megabytes) allocated for caching data in the database |
| `db-max-handles` | `1024` | A soft limit on the number of open files that can be used by the DB |
| `db-path` | `juno` | Location of the database files |
| `disable-l1-verification` | `false` | Disables L1 verification since an Ethereum node is not provided |
| `eth-node` | | WebSocket endpoint of the Ethereum node. To verify the correctness of the L2 chain, Juno must connect to an Ethereum node and parse events in the Starknet contract |
| `grpc` | `false` | Enable the HTTP gRPC server on the default port |
| `grpc-host` | `localhost` | The interface on which the gRPC server will listen for requests |
Expand All @@ -37,6 +38,7 @@
| `p2p-private-key` | | EXPERIMENTAL: Hexadecimal representation of a private key on the Ed25519 elliptic curve |
| `p2p-public-addr` | | EXPERIMENTAL: Specify p2p public address as multiaddr. Example: /ip4/35.243.XXX.XXX/tcp/7777 |
| `pending-poll-interval` | `5` | Sets how frequently pending block will be updated (0s will disable fetching of pending block) |
| `plugin-path` | | Path to the plugin .so file |
| `pprof` | `false` | Enables the pprof endpoint on the default port |
| `pprof-host` | `localhost` | The interface on which the pprof HTTP server will listen for requests |
| `pprof-port` | `6062` | The port on which the pprof HTTP server will listen for requests |
Expand Down
32 changes: 32 additions & 0 deletions docs/docs/staking-validator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Become a Staking Validator

Staking on Starknet provides an opportunity to contribute to network security and earn rewards by becoming a validator. Check out the [Becoming a Validator](https://docs.starknet.io/staking/entering-staking/) guide to learn more about the validator process.

## Prerequisites

- **STRK Tokens**: At least 20,000 STRK is required for staking. For the latest details, check out the [Staking Protocol Details](https://docs.starknet.io/staking/overview/#protocol_details).
- **Node Setup**: The [latest version of Juno](updating) installed and running on your machine.
- **Starknet Wallet**: A compatible wallet, like [Braavos](https://braavos.app/wallet-features/ledger-on-braavos/) or [Argent](https://www.argent.xyz/blog/how-to-use-your-hardware-wallet-with-argent).
- **Access to CLI/Block Explorer**: Tools like [Voyager](https://voyager.online) for interacting with contracts.

## 1. Set up Juno

Juno is a reliable choice for running a Starknet node. Follow the [Running Juno](running-juno) guide to configure Juno using Docker, binaries, source builds, or Google Cloud Platform (GCP).

## 2. Stake STRK tokens

Register as a validator by staking STRK tokens through the Starknet staking contract. Check out the [Becoming a Validator](https://docs.starknet.io/staking/entering-staking/) guide for complete instructions. The staking process includes:

- **Pre-approving STRK Transfer**: Allow the staking contract to lock your tokens.
- **Calling the `stake` Function**: Register operational and reward addresses, set commission rates, and enable pooling if desired.

## 3. Finalising your validator

Once Juno is running and your STRK tokens are staked:

1. Monitor your validator's status via dashboards like [Voyager](https://voyager.online/).
2. Stay updated for future network requirements or configurations.

:::info
You're now a staking validator! With your node running and tokens staked, you support Starknet's security and earn rewards. The network manages most operations, though future updates may require additional setup.
:::
6 changes: 3 additions & 3 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const sidebars = {
},
],
},
"staking-validator",
"monitoring",
"snapshots",
"faq",
Expand Down
52 changes: 52 additions & 0 deletions docs/versioned_docs/version-0.12.4/_config-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!-- This file is generated automatically. Any manual modifications will be overwritten. -->

| Config Option | Default Value | Description |
| - | - | - |
| `cn-core-contract-address` | | Custom network core contract address |
| `cn-feeder-url` | | Custom network feeder URL |
| `cn-gateway-url` | | Custom network gateway URL |
| `cn-l1-chain-id` | | Custom network L1 chain id |
| `cn-l2-chain-id` | | Custom network L2 chain id |
| `cn-name` | | Custom network name |
| `cn-unverifiable-range` | `[]` | Custom network range of blocks to skip hash verifications (e.g. `0,100`) |
| `colour` | `true` | Use `--colour=false` command to disable colourized outputs (ANSI Escape Codes) |
| `config` | | The YAML configuration file |
| `db-cache-size` | `1024` | Determines the amount of memory (in megabytes) allocated for caching data in the database |
| `db-max-handles` | `1024` | A soft limit on the number of open files that can be used by the DB |
| `db-path` | `juno` | Location of the database files |
| `disable-l1-verification` | `false` | Disables L1 verification since an Ethereum node is not provided |
| `eth-node` | | WebSocket endpoint of the Ethereum node. To verify the correctness of the L2 chain, Juno must connect to an Ethereum node and parse events in the Starknet contract |
| `grpc` | `false` | Enable the HTTP gRPC server on the default port |
| `grpc-host` | `localhost` | The interface on which the gRPC server will listen for requests |
| `grpc-port` | `6064` | The port on which the gRPC server will listen for requests |
| `gw-api-key` | | API key for gateway endpoints to avoid throttling |
| `gw-timeout` | `5` | Timeout for requests made to the gateway |
| `http` | `false` | Enables the HTTP RPC server on the default port and interface |
| `http-host` | `localhost` | The interface on which the HTTP RPC server will listen for requests |
| `http-port` | `6060` | The port on which the HTTP server will listen for requests |
| `log-level` | `info` | Options: trace, debug, info, warn, error |
| `max-vm-queue` | `2 * max-vms` | Maximum number for requests to queue after reaching max-vms before starting to reject incoming requests |
| `max-vms` | `3 * CPU Cores` | Maximum number for VM instances to be used for RPC calls concurrently |
| `metrics` | `false` | Enables the Prometheus metrics endpoint on the default port |
| `metrics-host` | `localhost` | The interface on which the Prometheus endpoint will listen for requests |
| `metrics-port` | `9090` | The port on which the Prometheus endpoint will listen for requests |
| `network` | `mainnet` | Options: mainnet, sepolia, sepolia-integration |
| `p2p` | `false` | EXPERIMENTAL: Enables p2p server |
| `p2p-addr` | | EXPERIMENTAL: Specify p2p listening source address as multiaddr. Example: /ip4/0.0.0.0/tcp/7777 |
| `p2p-feeder-node` | `false` | EXPERIMENTAL: Run juno as a feeder node which will only sync from feeder gateway and gossip the new blocks to the network |
| `p2p-peers` | | EXPERIMENTAL: Specify list of p2p peers split by a comma. These peers can be either Feeder or regular nodes |
| `p2p-private-key` | | EXPERIMENTAL: Hexadecimal representation of a private key on the Ed25519 elliptic curve |
| `p2p-public-addr` | | EXPERIMENTAL: Specify p2p public address as multiaddr. Example: /ip4/35.243.XXX.XXX/tcp/7777 |
| `pending-poll-interval` | `5` | Sets how frequently pending block will be updated (0s will disable fetching of pending block) |
| `plugin-path` | | Path to the plugin .so file |
| `pprof` | `false` | Enables the pprof endpoint on the default port |
| `pprof-host` | `localhost` | The interface on which the pprof HTTP server will listen for requests |
| `pprof-port` | `6062` | The port on which the pprof HTTP server will listen for requests |
| `remote-db` | | gRPC URL of a remote Juno node |
| `rpc-call-max-steps` | `4000000` | Maximum number of steps to be executed in starknet_call requests. The upper limit is 4 million steps, and any higher value will still be capped at 4 million |
| `rpc-cors-enable` | `false` | Enable CORS on RPC endpoints |
| `rpc-max-block-scan` | `18446744073709551615` | Maximum number of blocks scanned in single starknet_getEvents call |
| `versioned-constants-file` | | Use custom versioned constants from provided file |
| `ws` | `false` | Enables the WebSocket RPC server on the default port |
| `ws-host` | `localhost` | The interface on which the WebSocket RPC server will listen for requests |
| `ws-port` | `6061` | The port on which the WebSocket server will listen for requests |
125 changes: 125 additions & 0 deletions docs/versioned_docs/version-0.12.4/configuring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
title: Configuring Juno
---

# Configuring Juno :gear:

Juno can be configured using several methods, with the following order of precedence:

1. [Command line parameters (flags)](#command-line-params)
2. [Environment variables](#environment-variables)
3. [Configuration file](#configuration-file)

## Command line params

Juno can be configured directly on the command line by prefixing `--` to each option name:

```bash
./build/juno --http --http-port 6060 --http-host 0.0.0.0
```

When using Docker, append the command line parameters after the image name to configure Juno:

```bash
docker run nethermind/juno --http --http-port 6060 --http-host 0.0.0.0
```

:::tip
Command line parameters override [environment variables](#environment-variables) and [configuration file](#configuration-file).
:::

## Environment variables

Juno can be configured through environment variables by prefixing the variable names with `JUNO_` and using the configuration options in [SCREAMING_SNAKE_CASE](https://en.wiktionary.org/wiki/screaming_snake_case) format.

To set the `http`, `http-port`, and `http-host` configurations, Juno should be run in this format:

```bash
JUNO_HTTP=true JUNO_HTTP_PORT=6060 JUNO_HTTP_HOST=0.0.0.0 ./build/juno
```

When using Docker, start Juno using the `-e` command option:

```bash
docker run \
-e "JUNO_HTTP=true JUNO_HTTP_PORT=6060 JUNO_HTTP_HOST=0.0.0.0" \
nethermind/juno
```

:::tip
Environment variables rank second in configuration precedence. [Command line parameters](#command-line-params) override environment variables.
:::

## Configuration file

Juno can be configured using a [YAML](https://en.wikipedia.org/wiki/YAML) file:

```yaml title="Sample YAML File" showLineNumbers
log-level: info
network: mainnet
http: true
http-port: 6060
metrics: true
metrics-port: 9090
```
To run Juno with a configuration file, use the `config` option to specify the path of the configuration file:

```bash
# Standalone binary
./build/juno --config <CONFIG FILE PATH>
# Docker container
docker run nethermind/juno --config <CONFIG FILE PATH>
```

:::info
By default, Juno looks for the configuration file in the `$XDG_CONFIG_HOME` directory.
:::

:::tip
Configuration file rank third in configuration precedence. [Command line parameters](#command-line-params) and [environment variables](#environment-variables) override configuration file.
:::

## Configuration options

To list all available command line options, you can use the `--help` parameter:

```bash
# Standalone binary
./build/juno --help
# Docker container
docker run nethermind/juno --help
```

Below is a list of all configuration options available in Juno, along with their default values and descriptions:

```mdx-code-block
import ConfigOptions from "./_config-options.md";
<ConfigOptions />
```

## Subcommands

Juno provides several subcommands to perform specific tasks or operations. Here are the available ones:

- `genp2pkeypair`: Generate a private key pair for p2p.
- `db`: Perform database-related operations
- `db info`: Retrieve information about the database.
- `db size`: Calculate database size information for each data type.
- `db revert`: Reverts the database to a specific block number.

To use a subcommand, append it when running Juno:

```bash
# Running a subcommand
./build/juno <subcommand>
# Running the genp2pkeypair subcommand
./build/juno genp2pkeypair
# Running the db info subcommand
./build/juno db info
```
Loading

0 comments on commit c7dfcb9

Please sign in to comment.