|
| 1 | +# gRPC Single Sequencer App |
| 2 | + |
| 3 | +This application runs a Rollkit node with a single sequencer that connects to a remote execution client via gRPC. It allows you to use any execution layer that implements the Rollkit execution gRPC interface. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The gRPC single sequencer app provides: |
| 8 | + |
| 9 | +- A Rollkit consensus node with single sequencer |
| 10 | +- Connection to remote execution clients via gRPC |
| 11 | +- Full data availability layer integration |
| 12 | +- P2P networking capabilities |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +1. A running execution client that implements the Rollkit gRPC execution interface |
| 17 | +2. Access to a data availability layer (e.g., local DA, Celestia) |
| 18 | +3. Go 1.22 or higher |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +From the repository root: |
| 23 | + |
| 24 | +```bash |
| 25 | +cd apps/grpc/single |
| 26 | +go build -o grpc-single |
| 27 | +``` |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +### 1. Initialize the Node |
| 32 | + |
| 33 | +First, initialize the node configuration: |
| 34 | + |
| 35 | +```bash |
| 36 | +./grpc-single init --root-dir ~/.grpc-single |
| 37 | +``` |
| 38 | + |
| 39 | +This creates the necessary configuration files and directories. |
| 40 | + |
| 41 | +### 2. Configure the Node |
| 42 | + |
| 43 | +Edit the configuration file at `~/.grpc-single/config/config.toml` to set your preferred parameters, or use command-line flags. |
| 44 | + |
| 45 | +### 3. Start the Execution Service |
| 46 | + |
| 47 | +Before starting the Rollkit node, ensure your gRPC execution service is running. |
| 48 | + |
| 49 | +### 4. Run the Node |
| 50 | + |
| 51 | +Start the Rollkit node with: |
| 52 | + |
| 53 | +```bash |
| 54 | +./grpc-single start \ |
| 55 | + --root-dir ~/.grpc-single \ |
| 56 | + --grpc-executor-url http://localhost:50051 \ |
| 57 | + --da.address http://localhost:7980 \ |
| 58 | + --da.auth-token your-da-token \ |
| 59 | + --chain-id your-chain-id |
| 60 | +``` |
| 61 | + |
| 62 | +## Command-Line Flags |
| 63 | + |
| 64 | +### gRPC-specific Flags |
| 65 | + |
| 66 | +- `--grpc-executor-url`: URL of the gRPC execution service (default: `http://localhost:50051`) |
| 67 | + |
| 68 | +### Common Rollkit Flags |
| 69 | + |
| 70 | +- `--root-dir`: Root directory for config and data (default: `~/.grpc-single`) |
| 71 | +- `--chain-id`: The chain ID for your rollup |
| 72 | +- `--da.address`: Data availability layer address |
| 73 | +- `--da.auth-token`: Authentication token for DA layer |
| 74 | +- `--da.namespace`: Namespace for DA layer (optional) |
| 75 | +- `--p2p.listen-address`: P2P listen address (default: `/ip4/0.0.0.0/tcp/26656`) |
| 76 | +- `--block-time`: Time between blocks (default: `1s`) |
| 77 | + |
| 78 | +## Example: Running with Local DA |
| 79 | + |
| 80 | +1. Start the local DA service: |
| 81 | + |
| 82 | + ```bash |
| 83 | + cd da/cmd/local-da |
| 84 | + go run main.go |
| 85 | + ``` |
| 86 | + |
| 87 | +2. Start your gRPC execution service: |
| 88 | + |
| 89 | + ```bash |
| 90 | + # Your execution service implementation |
| 91 | + ``` |
| 92 | + |
| 93 | +3. Initialize and run the node: |
| 94 | + |
| 95 | + ```bash |
| 96 | + ./grpc-single init --root-dir ~/.grpc-single |
| 97 | + ./grpc-single start \ |
| 98 | + --root-dir ~/.grpc-single \ |
| 99 | + --grpc-executor-url http://localhost:50051 \ |
| 100 | + --da.address http://localhost:7980 \ |
| 101 | + --chain-id test-chain |
| 102 | + ``` |
| 103 | + |
| 104 | +## Architecture |
| 105 | + |
| 106 | +```text |
| 107 | +┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐ |
| 108 | +│ Rollkit Node │────▶│ gRPC Execution │────▶│ Execution │ |
| 109 | +│ (Single Seqr) │◀────│ Client │◀────│ Service │ |
| 110 | +└─────────────────┘ └──────────────────┘ └─────────────┘ |
| 111 | + │ │ |
| 112 | + │ │ |
| 113 | + ▼ ▼ |
| 114 | +┌─────────────────┐ ┌─────────────┐ |
| 115 | +│ DA │ │ State │ |
| 116 | +│ Layer │ │ Storage │ |
| 117 | +└─────────────────┘ └─────────────┘ |
| 118 | +``` |
| 119 | + |
| 120 | +## Development |
| 121 | + |
| 122 | +### Building from Source |
| 123 | + |
| 124 | +```bash |
| 125 | +go build -o grpc-single |
| 126 | +``` |
| 127 | + |
| 128 | +### Running Tests |
| 129 | + |
| 130 | +```bash |
| 131 | +go test ./... |
| 132 | +``` |
| 133 | + |
| 134 | +## Troubleshooting |
| 135 | + |
| 136 | +### Connection Refused |
| 137 | + |
| 138 | +If you see "connection refused" errors, ensure: |
| 139 | + |
| 140 | +1. Your gRPC execution service is running |
| 141 | +2. The execution service URL is correct |
| 142 | +3. No firewall is blocking the connection |
| 143 | + |
| 144 | +### DA Layer Issues |
| 145 | + |
| 146 | +If you have issues connecting to the DA layer: |
| 147 | + |
| 148 | +1. Verify the DA service is running |
| 149 | +2. Check the authentication token |
| 150 | +3. Ensure the namespace exists (if using Celestia) |
| 151 | + |
| 152 | +## See Also |
| 153 | + |
| 154 | +- [Rollkit Documentation](https://rollkit.dev) |
| 155 | +- [gRPC Execution Interface](../../../execution/grpc/README.md) |
| 156 | +- [Single Sequencer Documentation](../../../sequencers/single/README.md) |
0 commit comments