docs.status.network/assets/js/572f3558.a492781d.js
2024-10-30 11:32:06 +00:00

1 line
10 KiB
JavaScript

"use strict";(self.webpackChunkstatus_network_docs=self.webpackChunkstatus_network_docs||[]).push([[604],{4452:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>l,toc:()=>a});var s=t(4848),r=t(8453);const i={},o="Quick Start",l={id:"introduction/quick-start",title:"Quick Start",description:"In this section, we'll get you deploying a sample contract on Status Network Testnet in less than 10 minutes.",source:"@site/docs/introduction/quick-start.md",sourceDirName:"introduction",slug:"/introduction/quick-start",permalink:"/introduction/quick-start",draft:!1,unlisted:!1,editUrl:"https://github.com/status-im/status-network-docs/tree/main/docs/introduction/quick-start.md",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfe0 Home",permalink:"/"},next:{title:"\ud83d\udc8e SNT Token",permalink:"/tokenomics/snt-token"}},c={},a=[{value:"Get Everything Ready",id:"get-everything-ready",level:2},{value:"Remix & Sample Code",id:"remix--sample-code",level:2},{value:"Steps to Deploy",id:"steps-to-deploy",level:2},{value:"Interact with Your Deployed Smart Contract",id:"interact-with-your-deployed-smart-contract",level:2},{value:"Next Steps",id:"next-steps",level:2},{value:"Summary",id:"summary",level:2}];function d(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",header:"header",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"quick-start",children:"Quick Start"})}),"\n",(0,s.jsxs)(n.p,{children:["In this section, we'll get you deploying a sample contract on ",(0,s.jsx)(n.strong,{children:"Status Network Testnet"})," in less than 10 minutes."]}),"\n",(0,s.jsx)(n.p,{children:"Let\u2019s see how to deploy a smart contract on Status Network using the Remix IDE for simplicity."}),"\n",(0,s.jsx)(n.h2,{id:"get-everything-ready",children:"Get Everything Ready"}),"\n",(0,s.jsx)(n.p,{children:"Before getting started:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Add Status Network Testnet to MetaMask"}),":"]}),"\n",(0,s.jsxs)(n.p,{children:["Follow the ",(0,s.jsx)(n.a,{href:"/general-info/add-status-network",children:"Status Network documentation"})," for step-by-step instructions on how to add the Status Network testnet to MetaMask. You'll need the network's RPC URL, Chain ID, and other details."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Obtain Testnet Tokens"}),":"]}),"\n",(0,s.jsxs)(n.p,{children:["This guide assumes you have obtained testnet ETH on the Status Network. You can use the ",(0,s.jsx)(n.a,{href:"#",children:"Status Network Testnet Faucet"})," to request test tokens."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"We are ready to get started!"}),"\n",(0,s.jsx)(n.h2,{id:"remix--sample-code",children:"Remix & Sample Code"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Remix"})," is a no-setup tool for developing smart contracts. It\u2019s easy to get started, allowing a simple deployment process, debugging, interacting with smart contracts, and more. It\u2019s a great tool to test quick changes and interact with deployed smart contracts."]}),"\n",(0,s.jsxs)(n.p,{children:["For the sake of this tutorial, we will be deploying the ",(0,s.jsx)(n.code,{children:"SimpleStorage.sol"})," smart contract that comes as an example in Remix, but you can use any of your code."]}),"\n",(0,s.jsx)(n.p,{children:"Here's the sample code:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-solidity",children:"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.24;\n\ncontract SimpleStorage {\n\n uint256 number;\n \n function store(uint256 num) public {\n number = num;\n }\n\n function retrieve() public view returns (uint256) {\n return number;\n }\n}\n"})}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Note:"})," This contract lets you store a number and then read what that number is."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"steps-to-deploy",children:"Steps to Deploy"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Copy the Sample Code"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Copy the sample code and paste it into a new file named ",(0,s.jsx)(n.code,{children:"SimpleStorage.sol"})," in Remix."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Compile the Smart Contract"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Go to the ",(0,s.jsx)(n.strong,{children:"Solidity Compiler"})," tab (on the left sidebar)."]}),"\n",(0,s.jsxs)(n.li,{children:["Ensure the compiler version matches the pragma statement in your contract (",(0,s.jsx)(n.code,{children:"0.8.24"}),")."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:'"Compile SimpleStorage.sol"'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["You can enable ",(0,s.jsx)(n.strong,{children:'"Auto compile"'})," for automatic compilation whenever you change the contract code."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Deploy the Smart Contract"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Switch to the ",(0,s.jsx)(n.strong,{children:"Deploy & Run Transactions"})," tab."]}),"\n",(0,s.jsxs)(n.li,{children:["In the ",(0,s.jsx)(n.strong,{children:'"Environment"'})," dropdown menu, select ",(0,s.jsx)(n.strong,{children:'"Injected Provider - MetaMask"'}),". This connects Remix to your MetaMask wallet."]}),"\n",(0,s.jsx)(n.li,{children:"MetaMask may prompt you to connect to Remix. Confirm the connection."}),"\n",(0,s.jsxs)(n.li,{children:["Ensure that ",(0,s.jsx)(n.strong,{children:"Status Network Testnet"})," is selected in MetaMask."]}),"\n",(0,s.jsxs)(n.li,{children:["Under ",(0,s.jsx)(n.strong,{children:'"Contract"'}),", make sure ",(0,s.jsx)(n.code,{children:"SimpleStorage"})," is selected."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:'"Deploy"'}),"."]}),"\n",(0,s.jsx)(n.li,{children:"MetaMask will pop up, asking you to confirm the transaction."}),"\n",(0,s.jsxs)(n.li,{children:["Review the transaction details and click ",(0,s.jsx)(n.strong,{children:'"Confirm"'}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Wait for the transaction to be mined. You can track the status in Remix or MetaMask."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"CONGRATULATIONS!"})," You just deployed your first smart contract on Status Network."]}),"\n",(0,s.jsx)(n.h2,{id:"interact-with-your-deployed-smart-contract",children:"Interact with Your Deployed Smart Contract"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Access Deployed Contract"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["In Remix, under the ",(0,s.jsx)(n.strong,{children:'"Deployed Contracts"'})," section, you'll see your deployed ",(0,s.jsx)(n.code,{children:"SimpleStorage"})," contract."]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Store a Number"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Expand the deployed contract to view its functions."}),"\n",(0,s.jsxs)(n.li,{children:["In the ",(0,s.jsx)(n.strong,{children:'"store"'})," function input field, enter a number (e.g., ",(0,s.jsx)(n.code,{children:"42"}),")."]}),"\n",(0,s.jsxs)(n.li,{children:["Click ",(0,s.jsx)(n.strong,{children:'"transact"'}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["MetaMask will prompt you to confirm the transaction. Click ",(0,s.jsx)(n.strong,{children:'"Confirm"'}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Wait for the transaction to be confirmed."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Retrieve the Number"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Click on the ",(0,s.jsx)(n.strong,{children:'"retrieve"'})," function."]}),"\n",(0,s.jsx)(n.li,{children:"The stored number will display below the button."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Get Support"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"If you encounter any issues or have questions, join the community channels for assistance."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"summary",children:"Summary"}),"\n",(0,s.jsx)(n.p,{children:"You've successfully:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Set up your environment to interact with Status Network Testnet."}),"\n",(0,s.jsx)(n.li,{children:"Deployed a smart contract using Remix IDE and MetaMask."}),"\n",(0,s.jsx)(n.li,{children:"Interacted with your deployed contract by storing and retrieving a number."}),"\n"]}),"\n",(0,s.jsx)(n.hr,{}),"\n",(0,s.jsxs)(n.p,{children:["If you want to dive deeper, consider exploring more complex smart contracts. Checkout more tutorials ",(0,s.jsx)(n.a,{href:"/tutorials/ethers-tutorial",children:"here"}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Happy Coding!"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>l});var s=t(6540);const r={},i=s.createContext(r);function o(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);