Somnia 백서

Somnia

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 54쪽 중 42쪽

frequency operations * Real-time Features: Validate sub-second finality * Batch Operations: Test transaction batching * Event Emission: Verify real-time event handling </details> #### Common Error Messages <details> <summary><strong>Q: What do common error messages mean?</strong></summary> Common errors and solutions: Insufficient funds for gas * Solution: Add SOMI tokens to your wallet * Check: Verify gas price and limit settings Execution reverted * Solution: Check contract conditions and requirements * Debug: Use transaction simulation tools Network error * Solution: Verify RPC endpoint and internet connection * Fallback: Try alternative RPC providers </details> *** ## Resources and Support #### Documentation and Guides <details> <summary><strong>Q: Where can I find comprehensive documentation?</strong></summary> A: Official resources: * Main Documentation[ here](https://docs.somnia.network/) * GitHub: Official repositories and code examples </details> <details> <summary><strong>Q: How do I get developer support?</strong></summary> A: Multiple support channels: Discord Community: * Join the official Somnia [Discord](https://discord.com/invite/somnia) * \#dev-chat channel for technical discussions * Real-time support from community and team Email Support: * <developers@somnia.network> * Include project details and specific questions * Response within 24-48 hours GitHub Issues: * Report bugs and feature requests * Contribute to open-source tools * Community-driven solutions </details> #### Learning Resources <details> <summary><strong>Q: What learning resources are available for Somnia development?</strong></summary> A: Educational materials: Tutorials: * Smart contract deployment [guides](https://docs.somnia.network/developer/how-to-guides) * dApp integration examples * Performance optimization tutorials * Real-time application development Code Examples: * GitHub repositories with sample projects * Integration templates for popular frameworks * Best practice implementations Community Content: * Developer blog posts * Video tutorials * Workshop recordings * Conference presentations </details> #### Contributing to the Ecosystem <details> <summary><strong>Q: How can I contribute to Somnia's developer ecosystem?</strong></summary> A: Ways to contribute: Build Applications: * Create innovative dApps leveraging Somnia's performance * Open-source your projects for community benefit * Share integration patterns and best practices Community Participation: * Answer questions in Discord * Write tutorials and guides * Speak at developer events * Mentor new developers Technical Contributions: * Contribute to open-source tools * Report and fix bugs * Improve documentation * Create developer tooling Feedback and Testing: * Test new features and provide feedback * Report performance issues * Suggest improvements * Participate in beta programs </details> *** ### Congratulations! You now have comprehensive knowledge for developing on Somnia Network. This FAQ covered environment setup, contract development and verification, API integration, optimization, testing, advanced features, troubleshooting, and resources. *** # How To Guides Welcome to the **How-To Guides** — your one-stop resource for building on the **Somnia Network**. This section is designed to help developers of all experience levels onboard quickly, understand the tools available to them, and start shipping powerful dApps on Somnia. Somnia offers a high-performance Layer 1 blockchain with blazing-fast finality, high throughput, and robust developer tooling. Whether you're deploying your first smart contract, building out a full-stack decentralized application, or integrating advanced tooling like oracles, subgraphs, and SDKs — you're in the right place. Our guides are **practical, up-to-date, and hands-on**, focused on real implementations that will help you go from zero to deployed faster than ever. {% hint style="success" %} **Developers who are deploying Smart Contracts and need Somnia Test Tokens (STT):**\ \ Please join the [Discord](https://discord.com/invite/somnia). Go to the `#dev-chat` channel, tag the Somnia DevRel, `@emreyeth` and request Test Tokens.\ \ You can also join the [Somnia Developer Telegram](https://t.me/+s_oRMnGpOyQ3ODQ0) or use [Faucet](https://testnet.somnia.network/).\ \ You can also email `developers@somnia.foundation` with a brief description of what you are building and your GitHub profile. {% endhint %} *** The guides are grouped by **theme and difficulty**, so you can explore what’s most relevant to your project or level of expertise: ## Basics Learn how to: * Deploy smart contracts on Somnia using [RemixIDE](/developer/development-frameworks/deploy-with-remixide), [Hardhat](/developer/development-frameworks/deploy-with-hardhat), or [Foundry](/developer/development-frameworks/deploy-with-foundry) * [Verify your contracts on Somnia](/developer/development-frameworks/deploy-with-hardhat) * [Create ERC20 Tokens on Somnia](/developer/building-dapps/tokens-and-nfts/create-erc20-tokens) ## Intermediate Move beyond the basics by building full-stack applications. * [Learn how to connect Web UI with Smart Contracts using Viem](/developer/development-frameworks/using-the-viem-library) * [How to Set Up MetaMask for use with Somnia](/developer/building-dapps/wallet-integration-and-auth/authenticating-with-metamask) * [How to Use Native Somnia Tokens: SOMI (STT - Testnet](/developer/building-dapps/tokens-and-nfts/using-native-somi-stt)) ## Advanced **Build Complete dApp experiences** * [Create a DAO: Smart Contract Guide](/developer/building-dapps/example-applications/dao-smart-contract) * [Set Up the Web UI for DAO Smart Contract](/developer/building-dapps/example-applications/dao-ui-tutorial-p1) * [Set Up READ Operations for DAO Smart Contract](/developer/building-dapps/example-applications/dao-ui-tutorial-p2) * [Set Up WRITE Operations for DAO Smart Contract](/developer/building-dapps/example-applications/dao-ui-tutorial-p3) * [Build a Subgraph UI using Apollo Client](/developer/building-dapps/data-indexing-and-querying/building-subgraph-uis-apollo-client) * [Build a DEX on Somnia](/developer/building-dapps/example-applications/building-a-simple-dex-on-somnia) * [Somnia WebSockets](/developer/building-dapps/data-indexing-and-querying/listening-to-blockchain-events-websocket) ## Oracles Bring off-chain data on-chain with: * [How to integrate **DIA price feeds** on Somnia](/developer/building-dapps/oracles/dia-price-feeds) * [How to implement **Protofire Price Feeds**](/developer/building-dapps/oracles/protofire-price-feeds) * [How to implement **Verifiable Randomness (VRF)** via **Protofire + Chainlink**](/developer/building-dapps/oracles/using-verifiable-randomness-vrf) ## Subgraphs Efficiently query and index onchain data. * [How to create and deploy subgraphs on Somnia using **ORMI**](/developer/building-dapps/data-indexing-and-querying/ormi-subgraph) * [How to build with **Protofire’s subgraph infrastructure**](/developer/building-dapps/data-indexing-and-querying/protofire-subgraph) * [Frontend integrations for building responsive UIs from your subgraph data](/developer/building-dapps/data-indexing-and-querying/building-subgraph-uis-nextjs-fetch) ## Thirdweb A seamless wallet experience is key to user adoption. Somnia integrates with modern wallet providers to help you build dApps that feel intuitive and onboarding-friendly. This section covers: * [How to deploy Smart Contracts using **Thirdweb on** Somnia](/developer/development-frameworks/deploy-with-thirdweb) * [Using **Thirdweb Wallet SDK** for seamless Web3 UX](/developer/building-dapps/account-abstraction/smart-wallet-app-with-thirdweb) * [How to enable gasless transactions via **Account Abstraction**](/developer/building-dapps/account-abstraction/gasless-transactions-with-thirdw) ## Wallets Accelerate development with partner SDKs. * [Integrate **Privy** for embedded, Web2-friendly wallet flows](/developer/building-dapps/wallet-integration-and-auth/authenticating-with-privy) * [Use **RainbowKit** to offer a beautiful, customizable wallet connection UI](/developer/building-dapps/wallet-integration-and-auth/authenticating-with-rainbowkit) * [Leverage **ConnectKit** for flexible and extensible wallet integrations](/developer/building-dapps/wallet-integration-and-auth/authenticating-with-connectkit) ## APIs Use available APIs to enhance your application: * [How to use **ORMI’s Data API** to query blockchain state](/developer/building-dapps/data-indexing-and-querying/using-data-apis-ormi) *** Somnia’s developer ecosystem is growing rapidly — and with that, so is the tooling. These guides are updated frequently to reflect new partnerships, infra improvements, and best practices. If you're a developer who wants to build **fast, scalable, and secure** dApps, **Somnia is your playground**. And these guides are your map. # Mission To enable mass consumer real-time applications to be built at web2 scale with web3 properties, creating a more open, equitable internet. ### Key Objectives * Applications that can scale to web2 usage levels (millions of CCU, 100,000’s of transactions per second) * Open censorship-resistant systems accessible to anyone with access to the internet * No one counterparty controlling and hoarding value * Composable systems where value is shared among the participants * Free movement of people and assets between platforms so creators and users have freedom of choice A more open and equitable world. ### Core Principles #### On-Chain Experiences We are committed to building technology to make fully on-chain, real-time mass-scale applications possible and practical. We believe this is essential for creating a composable, open internet. #### Multiverse over Monolith We believe in a collection of applications, each with distinct, interconnected experiences, much like countries within a global community, sharing utilities that enhance mutual growth. #### Empowering Composability Central to our vision is the principle of composability—the ability for builders to build upon each other’s work, creating a culture of collaboration in which the collective output surpasses the sum of its parts. #### Builder Empowerment We will empower builders with the freedom to build sustainable models of engagement and ownership. This includes safeguarding the rights to digital assets and creating an environment where innovation is not stifled by platform constraints. #### Accessibility for All The promise of the virtual society is in its potential for universal access, removing barriers for content creation and participation. Leveling the playing field such that anyone with an internet connection can participate and succeed. <br> # Problem Web3 has created a new era of decentralised finance, democratising financial access. However, it has fallen short in generating mass consumer applications and remains largely centred around finance. We believe blockchain technology is a cornerstone for the future of new, open Internet applications. Today, there are limits to what you can build on-chain. Many factors constrain this, from the cost of running applications to the fundamental performance limitations of existing blockchains. We believe that new technologies can unlock a new class of real-time applications that normally must be built on Web2 foundations. Enabling these systems to be built on-chain will allow the free movement of businesses and users between online platforms, creating what we call a true virtual society. We are building Somnia, a fast and cost-effective EVM-based blockchain, to achieve this. Somnia is a layer-one blockchain with full EVM compatibility, capable of processing over 400,000 transactions per second with sub-second finality and low fees. This will unlock a new wave of on-chain applications. Initially, we are focusing on gaming, metaverse, and social experiences. The use cases will likely extend far beyond these sectors. We are not even 100% certain of what can be built with the technology we are creating. ## The Current State Although many blockchains support the EVM bytecode standard, they all leave much to be desired from a throughput perspective. Below are transactions per second (TPS) figures for a typical UniswapV3 transaction (Dex swaps per second (DPS)), which is 130k gas. As you can see, most chains offer up to \~200 DPS, or \~20M DPS per day. These numbers were taken from [this article](https://medium.com/dragonfly-research/the-amm-test-a-no-bs-look-at-l1-performance-4c8c2129d581): | <p><br></p> | Average DPS | Max DPS | Finality | | ----------- | ----------- | ------- | -------- | | ETH | 9.19 | 18.38 | 66s | | Polygon | 47.67 | 95.33 | Variable | | AVAX | 31.65 | 175.68 | 3.7s | | BNB | 194.6 | 194.6 | 75s | These are somewhat similar to real world observed numbers ([taken from Chaininspect](https://chainspect.app/dashboard)). Note that Uniswaps are a more complex user interaction and are composed of many transactions. Thus these numbers will be higher than above. | Name | Max Recorded TPS | Block Time | Time to finality | | --------- | ---------------- | ---------- | ---------------- | | Base | 293 | 2s | 16m | | BNB Chain | 1731 | 3s | 7.5s | | Polygon | 429 | 2.22s | 4m 16s | | Arbitrum | 944 | 0.25s | 16m | | Ethereum | 62.34 | 12.08 | 16m | | Optimism | 67.41 | 2s | 16m | | Avalanche | 92.74 | 2.03s | 0s | More recent benchmarks look as gas per second. <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd4aIfcAxT5HfbxKL_DV2lm3p87K61jbnnU3WY1H47J0h1yyj8aUKiS-zDmk78hR-Z9KuqNAT4ziqTUa9Dybf3LXhTqVBl-J7pF_TPzWhBMGcEGUhoU86S1gsHWEatmoJemJCQjiJAamRlmcgo865Ubwruv?key=Pd6FhcOWiUEbzWyN_-YJmg" alt=""><figcaption></figcaption></figure> These numbers are taken from [this article](https://www.paradigm.xyz/2024/04/reth-perf). To translate this into DPS, it’s about 6.5 DPS for every 1mg/s. So even the fastest chain on this list has a theoretical limit of 650 DPS (about 3700 TPS). If you go outside of the EVM ecosystem, you can do a lot better. Note that this TPS is not the same as above, as the tests differ. | <p><br></p> | TPS | Finality | | ----------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | | Aptos | 30,000 ([cite](https://aptoslabs.medium.com/previewnet-ensuring-scalability-and-reliability-of-the-aptos-network-48f0d210e8fe)) | 0.9s ([cite](https://twitter.com/Aptos/status/1632801717937922052)) | | SUI | 11,000 – 297,000 ([cite](https://blog.sui.io/sui-performance-update/)) | 480m/s ([cite](https://blog.sui.io/sui-performance-update/)) | | Solana | 1608 ([cite](https://chainspect.app/dashboard)) | 12.8s ([cite](https://chainspect.app/dashboard)) | Aptos and SUI's real-world live tests have not hit these levels yet. These numbers are based on their benchmarks. The Solana numbers differ from those on the Solana webpage as we are using the real-world observed numbers. Using the same methodology as the article above, Solana’s numbers are significantly worse at 273.34 swaps per second. Despite this performance increase, we believe the EVM is important. There is already a rich ecosystem of developers and content around the EVM. Not being able to access that ecosystem seems like a missed opportunity. These chains had to make that tradeoff to create the needed performance. But what if we could have similar performance on the EVM? The bottlenecks we see today with approaches on blockchain implemented with the EVM today are: * **Execution speed** – The rate at which smart contract code can be executed, and block creation can occur. * **Storage** — Retrieval of storing historical data of a chain. Ethereum [EIP-4844](https://www.eip4844.com/) was a recent upgrade that significantly improved the cost of storage for ETH and other L2s. However, we still need improvements in reading and writing data to blockchains. * **Bandwidth** — The amount of bandwidth needed to send data between nodes on the network when running at high transaction levels.\ <br> # Somnia-Mission To enable mass consumer real-time applications to be built at web2 scale with web3 properties, creating a more open, equitable internet. ### Key Objectives * Applications that can scale to web2 usage levels (millions of CCU, 100,000’s of transactions per second) * Open censorship-resistant systems accessible to anyone with access to the internet * No one counterparty controlling and hoarding value * Composable systems where value is shared among the participants * Free movement of people and assets between platforms so creators and users have freedom of choice A more open and equitable world. ### Core Principles #### On-Chain Experiences We are committed to building technology to make fully on-chain, real-time mass-scale applications possible and practical. We believe this is essential for creating a composable, open internet. #### Multiverse over Monolith We believe in a collection of applications, each with distinct, interconnected experiences, much like countries within a global community, sharing utilities that enhance mutual growth. #### Empowering Composability Central to our vision is the principle of composability—the ability for builders to build upon each other’s work, creating a culture of collaboration in which the collective output surpasses the sum of its parts. #### Builder Empowerment We will empower builders with the freedom to build sustainable models of engagement and ownership. This includes safeguarding the rights to digital assets and creating an environment where innovation is not stifled by platform constraints. #### Accessibility for All The promise of the virtual society is in its potential for universal access, removing barriers for content creation and participation. Leveling the playing field such that anyone with an internet connection can participate and succeed. <br> # Problem Web3 has created a new era of decentralised finance, democratising financial access. However, it has fallen short in generating mass consumer applications and remains largely centred around finance. We believe blockchain technology is a cornerstone for the future of new, open Internet applications. Today, there are limits to what you can build on-chain. Many factors constrain this, from the cost of running applications to the fundamental performance limitations of existing blockchains. We believe that new technologies can unlock a new class of real-time applications that normally must be built on Web2 foundations. Enabling these systems to be built on-chain will allow the free movement of businesses and users between online platforms, creating what we call a true virtual society. We are building Somnia, a fast and cost-effective EVM-based blockchain, to achieve this. Somnia is a layer-one blockchain with full EVM compatibility, capable of processing over 400,000 transactions per second with sub-second finality and low fees. This will unlock a new wave of on-chain applications. Initially, we are focusing on gaming, metaverse, and social experiences. The use cases will likely extend far beyond these sectors. We are not even 100% certain of what can be built with the technology we are creating. ## The Current State Although many blockchains support the EVM bytecode standard, they all leave much to be desired from a throughput perspective. Below are transactions per second (TPS) figures for a typical UniswapV3 transaction (Dex swaps per second (DPS)), which is 130k gas. As you can see, most chains offer up to \~200 DPS, or \~20M DPS per day. These numbers were taken from [this article](https://medium.com/dragonfly-research/the-amm-test-a-no-bs-look-at-l1-performance-4c8c2129d581): | <p><br></p> | Average
프로젝트로 돌아가기