š Quick Start
Get a local Sunrise DA node, a minimal Rollkitābased sovereign rollup, and a sample dApp running in ⤠20 minutes.
This guide will walk you through setting up a complete development environment for building on Sunrise Layer. Youāll learn how to:
- Set up a local Sunrise Data Availability (DA) node
- Create a minimal sovereign rollup using Rollkit
- Interact with the network using the Sunrise client
- Run a sample dApp that demonstrates key features
For a more comprehensive guide covering all aspects of building on Sunrise, check out the Sunrise Builders Kit.
Prerequisites
Section titled āPrerequisitesāBefore you begin, ensure you have the following tools installed:
| Tool | Version | Purpose |
|---|---|---|
| Go | >=1.22 | Build Sunrise binaries and core components |
| Rust + Cargo | stable | Build Rollkit demo chain and smart contracts |
| Node.js | >=20 | Run JS client, scripts, and web applications |
| Docker + Docker Compose | latest | Run containerized services and development stack |
| (Optional) direnv | any | Automatically load environment variables in your shell |
# macOS (brew) examplebrew install go rustup node docker direnvrustup default stable1. Clone the repositories
Section titled ā1. Clone the repositoriesāWeāll create a development playground with three main components:
mkdir sunrise-playground && cd $_git clone https://github.com/sunriselayer/network sunrise-dagit clone https://github.com/rollkit/rollkit rollkitgit clone https://github.com/sunriselayer/examples examplessunrise-da: The core Sunrise network implementationrollkit: A framework for building sovereign rollupsexamples: Sample applications and integration examples
2. Spin up a local Sunrise DA node
Section titled ā2. Spin up a local Sunrise DA nodeāThe Sunrise DA node is the foundation of the network, providing data availability services for rollups:
cd sunrise-damake install # builds 'sunrised'sunrised init dev --chain-id goldberg-localsunrised start| Service | Port | Purpose |
|---|---|---|
| Tendermint RPC | 26657 | Main RPC endpoint for transactions and queries |
| gRPC | 9090 | Protocol buffer interface for advanced operations |
3. Fund an account (faucet)
Section titled ā3. Fund an account (faucet)āCreate and fund a test account to interact with the network:
sunrised keys add alice --keyring-backend testsunrised tx bank mint $(sunrised keys show alice -a) 1000000000urise \ --from alice --keyring-backend test --yesThis creates a new account named āaliceā and mints 1 billion micro-RISE tokens (urise) for testing.
4. Launch a minimal Rollkit sovereign rollup
Section titled ā4. Launch a minimal Rollkit sovereign rollupāRollkit is a framework for building sovereign rollups that can use Sunrise for data availability:
cd ../rollkitmake demo # builds demo binary 'demo-rollup'
# Configure Rollkit to store blobs on Sunrise DAcat <<EOF > rollup.config.toml[da]rpc_address = "http://localhost:26657"fee_denom = "uusdrise"gas_price = "0.025"[rollup]chain_id = "demo-rollup-1"EOF
./demo-rollup start --config rollup.config.tomlThe rollup automatically publishes its block data to Sunrise and retrieves DA proofs.
5. Post and verify a blob with @sunriselayer/client
Section titled ā5. Post and verify a blob with @sunriselayer/clientāThe Sunrise client is a JavaScript/TypeScript library for interacting with the Sunrise network. Hereās how to use it:
# inside the root playground directorynpm create vite@latest js-client-demo -- --template vanillacd js-client-demo && npm i @sunriselayer/client
cat <<'JS' > src/index.jsimport { SunriseClient } from "@sunriselayer/client";
const rpc = "http://localhost:26657";const main = async () => { const client = await SunriseClient.connect(rpc);
const { transactionHash } = await client.da.submitBlob( "Hello Sunrise!", { gasLimit: 200_000, feeDenom: "uusdrise", gasPrice: "0.025" } ); console.log("Blob tx:", transactionHash);
const proof = await client.da.getBlobProof(transactionHash); console.log("Inclusion proof:", proof);};main();JSnode src/index.jsThis example demonstrates:
- Connecting to a Sunrise node
- Submitting a data blob
- Retrieving a Merkle proof of inclusion
6. Run the sample dApp (token swap)
Section titled ā6. Run the sample dApp (token swap)āThe example dApp demonstrates a token swap using Sunriseās liquidity pool module:
cd ../../examples/swap-demonpm inpm run dev # opens http://localhost:5173The demo UI:
- connects to @sunriselayer/client
- swaps testātokens via the rollupās x/swap module
- shows live balances pulled from Sunrise DA
7. Next steps
Section titled ā7. Next stepsā| What | Where | Description |
|---|---|---|
| Full client reference | Client Documentation | Complete API documentation for @sunriselayer/client |
| Build a production Rollkit chain | Rollkit Guide | Guide to deploying a production rollup |
| Validators & DA proofs | Validators Guide | Learn about validator setup and DA proof generation |
| Conceptual deep dives | Learn Section | Understanding Sunriseās core concepts |
Troubleshooting
Section titled āTroubleshootingā| Symptom | Fix | Explanation |
|---|---|---|
| ECONNREFUSED on port 26657 | sunrised start not running or wrong RPC URL | Ensure the Sunrise node is running and accessible |
| Rollkit cannot post blobs | Check ~/.sunrise/config/app.toml for min-gas-prices | Verify gas price settings match network requirements |
| Blob tx stuck in mempool | Low gas price ā use āgas-prices 0.025urise | Increase gas price to ensure transaction processing |
Clean up
Section titled āClean upāpkill sunrised demo-rollup || truedocker compose -f docker/local-da.yml down -v || truerm -rf ~/sunrise-playgroundHappy hacking! š