From 19956325c400db4fdc144fa5eb4cc4425536291f Mon Sep 17 00:00:00 2001 From: 0xSpaceShard <0xSpaceShard@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:26:38 +0000 Subject: [PATCH] Deploy website - based on 058fe3c606da62cebb9b57391cea8bbd4b28ad6a --- 404.html | 6 +- assets/js/119a2918.f7062edd.js | 1 + assets/js/16a2713f.f08ebda5.js | 1 + assets/js/1e29fbdb.50ba5238.js | 1 + assets/js/2146f16f.3e9e5b9b.js | 1 - assets/js/2146f16f.fed3c84a.js | 1 + assets/js/28a0cb7e.1e593781.js | 1 + assets/js/425e1ae2.469cee91.js | 1 + assets/js/49885c5e.4bc7e5ad.js | 1 + assets/js/49885c5e.88fa1633.js | 1 - assets/js/4adc7347.97f20e9d.js | 1 + ...e1ae2.a5de04d1.js => 5402810c.ffdb5d60.js} | 2 +- assets/js/5985dcf4.70d866fa.js | 1 + assets/js/5fadd32f.3d3c5163.js | 1 + assets/js/5fadd32f.4470b0e4.js | 1 - assets/js/5fbc5cf1.76587c2d.js | 1 - assets/js/5fbc5cf1.c37e214c.js | 1 + assets/js/673b87a5.e2e634e1.js | 1 + ...90bb1.a3d78aa1.js => 6d990bb1.d5f5f3dc.js} | 2 +- assets/js/7923f30a.012c6902.js | 1 + assets/js/8d981dc3.5d6a3cde.js | 1 + assets/js/8d981dc3.77fdfc67.js | 1 - assets/js/8e76450a.457a0c79.js | 1 + ...aeb12.75ce2603.js => 93f3c2aa.4d83389b.js} | 2 +- assets/js/9875b4b5.9ea44d6b.js | 1 + assets/js/9abfa349.32a724b9.js | 1 - assets/js/9abfa349.620b16d7.js | 1 + assets/js/9b932233.10ce9365.js | 1 - assets/js/9b932233.211be870.js | 1 + assets/js/9c3aeb12.2ff5ffe7.js | 1 + ...5dcf4.49afb06c.js => a56dc942.4c23731e.js} | 2 +- assets/js/a5ad27b1.a118c206.js | 1 - assets/js/a5ad27b1.a362d764.js | 1 + assets/js/a5e062ff.5a44be1d.js | 1 + assets/js/a5e062ff.a888e2f6.js | 1 - assets/js/ad6bd692.2d8efa6d.js | 1 + assets/js/ad6bd692.7bc5fb7f.js | 1 - assets/js/b0477c6d.85f3f358.js | 1 - assets/js/b0477c6d.e4f6cf6c.js | 1 + assets/js/b1ee2929.037d9b49.js | 1 + ...3f30a.4aa28861.js => b7007dab.baf2f898.js} | 2 +- assets/js/ba738306.0c1ac6c3.js | 1 - assets/js/ba738306.fde851af.js | 1 + assets/js/bca784a7.0edf2fc8.js | 1 + assets/js/bca784a7.547f56bd.js | 1 - assets/js/c4d2e5c1.3039254f.js | 1 + ...baa30.c74667a4.js => cc2baa30.ab62794b.js} | 2 +- assets/js/def2ee80.c9b52201.js | 1 + assets/js/e120dcd9.466337be.js | 1 + ...5b4b5.0aaf62d5.js => e2538a57.55fbf779.js} | 2 +- assets/js/e2f00550.76a5e6d2.js | 1 - assets/js/e2f00550.8ca4e8a2.js | 1 + ...53dad.ac67425e.js => e3e59843.3ed551b6.js} | 2 +- assets/js/e8953dad.d8af09d8.js | 1 + assets/js/ef2a8751.55c47ebe.js | 1 + ...2713f.7d2fd4b2.js => f44adc48.565b24cf.js} | 2 +- assets/js/main.0f3c2237.js | 2 + ...CENSE.txt => main.0f3c2237.js.LICENSE.txt} | 0 assets/js/main.7071ed79.js | 2 - assets/js/runtime~main.9590eef3.js | 1 - assets/js/runtime~main.faf92885.js | 1 + docs/0.0.6/account-impersonation/index.html | 6 +- docs/0.0.6/api/index.html | 6 +- docs/0.0.6/balance/index.html | 6 +- docs/0.0.6/blocks/index.html | 6 +- docs/0.0.6/category/running/index.html | 6 +- docs/0.0.6/dump-load-restart/index.html | 6 +- docs/0.0.6/forking/index.html | 6 +- docs/0.0.6/historic-state/index.html | 6 +- docs/0.0.6/intro/index.html | 6 +- docs/0.0.6/lite/index.html | 6 +- docs/0.0.6/postman/index.html | 6 +- docs/0.0.6/predeployed/index.html | 6 +- docs/0.0.6/running/cli/index.html | 6 +- docs/0.0.6/running/docker/index.html | 6 +- docs/0.0.6/running/install/index.html | 6 +- docs/0.0.6/server-config/index.html | 6 +- docs/0.0.6/starknet-time/index.html | 6 +- docs/0.0.7/account-impersonation/index.html | 40 +++++++++++++ docs/0.0.7/api/index.html | 21 +++++++ docs/0.0.7/balance/index.html | 28 ++++++++++ docs/0.0.7/blocks/index.html | 37 ++++++++++++ docs/0.0.7/category/running/index.html | 13 +++++ docs/0.0.7/dump-load-restart/index.html | 56 +++++++++++++++++++ docs/0.0.7/forking/index.html | 20 +++++++ docs/0.0.7/historic-state/index.html | 16 ++++++ docs/0.0.7/intro/index.html | 18 ++++++ docs/0.0.7/lite/index.html | 21 +++++++ docs/0.0.7/postman/index.html | 56 +++++++++++++++++++ docs/0.0.7/predeployed/index.html | 24 ++++++++ docs/0.0.7/running/cli/index.html | 41 ++++++++++++++ docs/0.0.7/running/docker/index.html | 49 ++++++++++++++++ docs/0.0.7/running/install/index.html | 41 ++++++++++++++ docs/0.0.7/server-config/index.html | 35 ++++++++++++ docs/0.0.7/starknet-time/index.html | 27 +++++++++ docs/account-impersonation/index.html | 14 +++-- docs/api/index.html | 28 ++++++---- docs/balance/index.html | 16 +++--- docs/blocks/index.html | 48 ++++++++++------ docs/category/running/index.html | 10 ++-- docs/dump-load-restart/index.html | 19 ++++--- docs/forking/index.html | 12 ++-- docs/historic-state/index.html | 12 ++-- docs/intro/index.html | 12 ++-- docs/lite/index.html | 12 ++-- docs/next/account-impersonation/index.html | 10 ++-- docs/next/api/index.html | 24 ++++---- docs/next/balance/index.html | 6 +- docs/next/blocks/index.html | 39 ++++++++----- docs/next/category/running/index.html | 6 +- docs/next/dump-load-restart/index.html | 7 +-- docs/next/forking/index.html | 6 +- docs/next/historic-state/index.html | 6 +- docs/next/intro/index.html | 6 +- docs/next/lite/index.html | 6 +- docs/next/postman/index.html | 10 ++-- docs/next/predeployed/index.html | 6 +- docs/next/running/cli/index.html | 6 +- docs/next/running/docker/index.html | 6 +- docs/next/running/install/index.html | 6 +- docs/next/server-config/index.html | 6 +- docs/next/starknet-time/index.html | 6 +- docs/postman/index.html | 21 ++++--- docs/predeployed/index.html | 13 +++-- docs/running/cli/index.html | 12 ++-- docs/running/docker/index.html | 12 ++-- docs/running/install/index.html | 12 ++-- docs/server-config/index.html | 15 ++--- docs/starknet-time/index.html | 17 +++--- index.html | 6 +- markdown-page/index.html | 6 +- sitemap.xml | 2 +- 132 files changed, 897 insertions(+), 285 deletions(-) create mode 100644 assets/js/119a2918.f7062edd.js create mode 100644 assets/js/16a2713f.f08ebda5.js create mode 100644 assets/js/1e29fbdb.50ba5238.js delete mode 100644 assets/js/2146f16f.3e9e5b9b.js create mode 100644 assets/js/2146f16f.fed3c84a.js create mode 100644 assets/js/28a0cb7e.1e593781.js create mode 100644 assets/js/425e1ae2.469cee91.js create mode 100644 assets/js/49885c5e.4bc7e5ad.js delete mode 100644 assets/js/49885c5e.88fa1633.js create mode 100644 assets/js/4adc7347.97f20e9d.js rename assets/js/{425e1ae2.a5de04d1.js => 5402810c.ffdb5d60.js} (92%) create mode 100644 assets/js/5985dcf4.70d866fa.js create mode 100644 assets/js/5fadd32f.3d3c5163.js delete mode 100644 assets/js/5fadd32f.4470b0e4.js delete mode 100644 assets/js/5fbc5cf1.76587c2d.js create mode 100644 assets/js/5fbc5cf1.c37e214c.js create mode 100644 assets/js/673b87a5.e2e634e1.js rename assets/js/{6d990bb1.a3d78aa1.js => 6d990bb1.d5f5f3dc.js} (70%) create mode 100644 assets/js/7923f30a.012c6902.js create mode 100644 assets/js/8d981dc3.5d6a3cde.js delete mode 100644 assets/js/8d981dc3.77fdfc67.js create mode 100644 assets/js/8e76450a.457a0c79.js rename assets/js/{9c3aeb12.75ce2603.js => 93f3c2aa.4d83389b.js} (91%) create mode 100644 assets/js/9875b4b5.9ea44d6b.js delete mode 100644 assets/js/9abfa349.32a724b9.js create mode 100644 assets/js/9abfa349.620b16d7.js delete mode 100644 assets/js/9b932233.10ce9365.js create mode 100644 assets/js/9b932233.211be870.js create mode 100644 assets/js/9c3aeb12.2ff5ffe7.js rename assets/js/{5985dcf4.49afb06c.js => a56dc942.4c23731e.js} (97%) delete mode 100644 assets/js/a5ad27b1.a118c206.js create mode 100644 assets/js/a5ad27b1.a362d764.js create mode 100644 assets/js/a5e062ff.5a44be1d.js delete mode 100644 assets/js/a5e062ff.a888e2f6.js create mode 100644 assets/js/ad6bd692.2d8efa6d.js delete mode 100644 assets/js/ad6bd692.7bc5fb7f.js delete mode 100644 assets/js/b0477c6d.85f3f358.js create mode 100644 assets/js/b0477c6d.e4f6cf6c.js create mode 100644 assets/js/b1ee2929.037d9b49.js rename assets/js/{7923f30a.4aa28861.js => b7007dab.baf2f898.js} (97%) delete mode 100644 assets/js/ba738306.0c1ac6c3.js create mode 100644 assets/js/ba738306.fde851af.js create mode 100644 assets/js/bca784a7.0edf2fc8.js delete mode 100644 assets/js/bca784a7.547f56bd.js create mode 100644 assets/js/c4d2e5c1.3039254f.js rename assets/js/{cc2baa30.c74667a4.js => cc2baa30.ab62794b.js} (70%) create mode 100644 assets/js/def2ee80.c9b52201.js create mode 100644 assets/js/e120dcd9.466337be.js rename assets/js/{9875b4b5.0aaf62d5.js => e2538a57.55fbf779.js} (68%) delete mode 100644 assets/js/e2f00550.76a5e6d2.js create mode 100644 assets/js/e2f00550.8ca4e8a2.js rename assets/js/{e8953dad.ac67425e.js => e3e59843.3ed551b6.js} (93%) create mode 100644 assets/js/e8953dad.d8af09d8.js create mode 100644 assets/js/ef2a8751.55c47ebe.js rename assets/js/{16a2713f.7d2fd4b2.js => f44adc48.565b24cf.js} (78%) create mode 100644 assets/js/main.0f3c2237.js rename assets/js/{main.7071ed79.js.LICENSE.txt => main.0f3c2237.js.LICENSE.txt} (100%) delete mode 100644 assets/js/main.7071ed79.js delete mode 100644 assets/js/runtime~main.9590eef3.js create mode 100644 assets/js/runtime~main.faf92885.js create mode 100644 docs/0.0.7/account-impersonation/index.html create mode 100644 docs/0.0.7/api/index.html create mode 100644 docs/0.0.7/balance/index.html create mode 100644 docs/0.0.7/blocks/index.html create mode 100644 docs/0.0.7/category/running/index.html create mode 100644 docs/0.0.7/dump-load-restart/index.html create mode 100644 docs/0.0.7/forking/index.html create mode 100644 docs/0.0.7/historic-state/index.html create mode 100644 docs/0.0.7/intro/index.html create mode 100644 docs/0.0.7/lite/index.html create mode 100644 docs/0.0.7/postman/index.html create mode 100644 docs/0.0.7/predeployed/index.html create mode 100644 docs/0.0.7/running/cli/index.html create mode 100644 docs/0.0.7/running/docker/index.html create mode 100644 docs/0.0.7/running/install/index.html create mode 100644 docs/0.0.7/server-config/index.html create mode 100644 docs/0.0.7/starknet-time/index.html diff --git a/404.html b/404.html index 0fcca8ec3..49a95b66d 100644 --- a/404.html +++ b/404.html @@ -4,10 +4,10 @@ Page Not Found | Starknet Devnet - - + + -
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

+
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

\ No newline at end of file diff --git a/assets/js/119a2918.f7062edd.js b/assets/js/119a2918.f7062edd.js new file mode 100644 index 000000000..78f8ee6a0 --- /dev/null +++ b/assets/js/119a2918.f7062edd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6131],{5254:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>r,toc:()=>a});var o=t(4848),c=t(8453);const s={},i="Blocks",r={id:"blocks",title:"Blocks",description:"By default, Devnet starts with a genesis block labelled with number zero. In forking mode, the genesis block number is equal to the forked block number plus one.",source:"@site/versioned_docs/version-0.1.1/blocks.md",sourceDirName:".",slug:"/blocks",permalink:"/starknet-devnet-rs/docs/blocks",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/blocks.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/balance"},next:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart"}},l={},a=[{value:"Creating blocks on transaction",id:"creating-blocks-on-transaction",level:2},{value:"Creating blocks on demand",id:"creating-blocks-on-demand",level:2},{value:"Automatic periodic block creation",id:"automatic-periodic-block-creation",level:2},{value:"Request new block creation",id:"request-new-block-creation",level:2},{value:"Abort blocks",id:"abort-blocks",level:2},{value:"Example",id:"example",level:3},{value:"Limitations",id:"limitations",level:3},{value:"Request and response",id:"request-and-response",level:3}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"blocks",children:"Blocks"}),"\n",(0,o.jsxs)(n.p,{children:["By default, Devnet starts with a genesis block labelled with number zero. In ",(0,o.jsx)(n.a,{href:"./forking",children:"forking mode"}),", the genesis block number is equal to the forked block number plus one."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-transaction",children:"Creating blocks on transaction"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with ",(0,o.jsx)(n.code,{children:"--block-generation-on transaction"}),", a new block is generated with each new transaction. This is the default block generation regime. This mode also supports ",(0,o.jsx)(n.a,{href:"#request-new-block-creation",children:"empty block creation"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-demand",children:"Creating blocks on demand"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with the ",(0,o.jsx)(n.code,{children:"--block-generation-on demand"})," CLI option, you will enable the possibility to store more than one transaction in the pending block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"pending"'}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["Once you've added the desired transactions into the pending block, you can ",(0,o.jsx)(n.a,{href:"#request-new-block-creation",children:"request new block creation"}),". This will convert the pending block to the latest block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"latest"'}),"), giving it a block hash and a block number. All subsequent transactions will be stored in a new pending block."]}),"\n",(0,o.jsx)(n.p,{children:"In case of demanding block creation with no pending transactions, a new empty block will be generated."}),"\n",(0,o.jsx)(n.p,{children:"The creation of the genesis block is not affected by this feature."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_createBlock"\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"{'block_hash': '0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67'}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"automatic-periodic-block-creation",children:"Automatic periodic block creation"}),"\n",(0,o.jsxs)(n.p,{children:["If started with the ",(0,o.jsx)(n.code,{children:"--block-generation-on "})," CLI option, Devnet will behave as in ",(0,o.jsxs)(n.a,{href:"#creating-blocks-on-demand",children:[(0,o.jsx)(n.code,{children:"demand"})," mode"]}),", but new blocks will be mined automatically every ",(0,o.jsx)(n.code,{children:""})," seconds. Consider this example of spawning Devnet at moment ",(0,o.jsx)(n.code,{children:"t"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"# t\n$ starknet-devnet --block-generation-on 10\n\n# t + 1s\n# user: send tx1\n\n# t + 4s\n# user: send tx2\n\n# t + 10s\n# Devnet: block automatically generated, contains tx1 and tx2\n\n# t + 12s\n# user: send tx3\n\n# t + 14s\n# user: invoke empty block creation\n# Devnet: generated block contains tx3\n\n# t + 20s\n# Devnet: block automatically generated, contains no txs (manual creation did not restart the counter)\n"})}),"\n",(0,o.jsx)(n.h2,{id:"request-new-block-creation",children:"Request new block creation"}),"\n",(0,o.jsxs)(n.p,{children:["To request the creation of a new block, ",(0,o.jsx)(n.code,{children:"POST"})," a request with no body to ",(0,o.jsx)(n.code,{children:"/create_block"})," or send:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_createBlock"\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{"block_hash": "0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67"}\n'})}),"\n",(0,o.jsx)(n.p,{children:"The newly created block will contain all pending transactions, if any, since the last block creation."}),"\n",(0,o.jsx)(n.h2,{id:"abort-blocks",children:"Abort blocks"}),"\n",(0,o.jsxs)(n.p,{children:["This functionality allows simulating block abortion that can occur on mainnet. It is supported in the ",(0,o.jsx)(n.code,{children:"--state-archive-capacity full"})," mode."]}),"\n",(0,o.jsx)(n.p,{children:"You can abort blocks and revert transactions from the specified block to the currently latest block. Newly created blocks after the abortion will have accepted status and will continue with numbering where the last accepted block left off."}),"\n",(0,o.jsx)(n.p,{children:"The state of Devnet will be reverted to the state of the last accepted block."}),"\n",(0,o.jsx)(n.h3,{id:"example",children:"Example"}),"\n",(0,o.jsx)(n.p,{children:"Assume there are 3 accepted blocks numbered 1, 2 and 3. Upon receiving a request to abort blocks starting with block 2, the blocks numbered 2 and 3 are aborted and their transactions reverted. The state of network will be as it was in block 1. Once a new block is mined, it will be accepted and it will have number 2."}),"\n",(0,o.jsx)(n.h3,{id:"limitations",children:"Limitations"}),"\n",(0,o.jsx)(n.p,{children:"Aborted blocks can only be queried by block hash. Devnet does not support the abortion of:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"blocks in the forking origin (i.e. blocks mined before the forked block)"}),"\n",(0,o.jsx)(n.li,{children:"already aborted blocks"}),"\n",(0,o.jsx)(n.li,{children:"Devnet's genesis block"}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"request-and-response",children:"Request and response"}),"\n",(0,o.jsx)(n.p,{children:"To abort, send one of the following:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'POST /abort_blocks\n{\n "starting_block_hash": BLOCK_HASH\n}\n'})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_abortBlocks",\n "params": {\n "starting_block_hash": BLOCK_HASH\n }\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{\n "aborted": [BLOCK_HASH_0, BLOCK_HASH_1, ...]\n}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const c={},s=o.createContext(c);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/16a2713f.f08ebda5.js b/assets/js/16a2713f.f08ebda5.js new file mode 100644 index 000000000..f0108464f --- /dev/null +++ b/assets/js/16a2713f.f08ebda5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2412],{4103:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=t(4848),s=t(8453);const i={},o="Server config",d={id:"server-config",title:"Server config",description:"To read generally about ways to configure your Devnet instance, check out the CLI section.",source:"@site/versioned_docs/version-0.0.7/server-config.md",sourceDirName:".",slug:"/server-config",permalink:"/starknet-devnet-rs/docs/0.0.7/server-config",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/server-config.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/0.0.7/predeployed"},next:{title:"Starknet time",permalink:"/starknet-devnet-rs/docs/0.0.7/starknet-time"}},c={},l=[{value:"Host and port",id:"host-and-port",level:2},{value:"Logging",id:"logging",level:2},{value:"Timeout",id:"timeout",level:2},{value:"Request body size limit",id:"request-body-size-limit",level:2},{value:"API",id:"api",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"server-config",children:"Server config"}),"\n",(0,r.jsxs)(n.p,{children:["To read generally about ways to configure your Devnet instance, check out the ",(0,r.jsx)(n.a,{href:"/starknet-devnet-rs/docs/0.0.7/running/cli",children:"CLI section"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"host-and-port",children:"Host and port"}),"\n",(0,r.jsxs)(n.p,{children:["Specify the host and the port used by the server with ",(0,r.jsx)(n.code,{children:"--host
"})," and ",(0,r.jsx)(n.code,{children:"--port "})," CLI arguments. If running with Docker, check out the ",(0,r.jsx)(n.a,{href:"./running/docker#container-port-publishing",children:"port publishing docs"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"logging",children:"Logging"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the logging level is ",(0,r.jsx)(n.code,{children:"INFO"}),", but this can be changed via the ",(0,r.jsx)(n.code,{children:"RUST_LOG"})," environment variable."]}),"\n",(0,r.jsxs)(n.p,{children:["All logging levels: ",(0,r.jsx)(n.code,{children:"TRACE"}),", ",(0,r.jsx)(n.code,{children:"DEBUG"}),", ",(0,r.jsx)(n.code,{children:"INFO"}),", ",(0,r.jsx)(n.code,{children:"WARN"}),", ",(0,r.jsx)(n.code,{children:"ERROR"})]}),"\n",(0,r.jsx)(n.p,{children:"To specify the logging level and run Devnet on the same line:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ RUST_LOG= starknet-devnet\n"})}),"\n",(0,r.jsx)(n.p,{children:"or if using dockerized Devnet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker run -e RUST_LOG= shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By default, logging of request and response data is turned off.\nTo see the request and/or response body, additional levels can be specified via the ",(0,r.jsx)(n.code,{children:"RUST_LOG"})," environment variable: ",(0,r.jsx)(n.code,{children:"REQUEST"})," for request body, ",(0,r.jsx)(n.code,{children:"RESPONSE"})," for response body."]}),"\n",(0,r.jsxs)(n.admonition,{type:"note",children:[(0,r.jsxs)(n.p,{children:["Logging request and response requires at least logging level ",(0,r.jsx)(n.code,{children:"INFO"}),"."]}),(0,r.jsxs)(n.p,{children:["For example, the following two commands will log request and response data with log level ",(0,r.jsx)(n.code,{children:"INFO"}),"."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ RUST_LOG="REQUEST,RESPONSE" starknet-devnet\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ RUST_LOG="REQUEST,RESPONSE,INFO" starknet-devnet\n'})})]}),"\n",(0,r.jsx)(n.h2,{id:"timeout",children:"Timeout"}),"\n",(0,r.jsx)(n.p,{children:"Specify the maximum amount of time an HTTP request can be served. This makes it possible to deploy and manage large contracts that take longer to execute."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --timeout \n"})}),"\n",(0,r.jsx)(n.h2,{id:"request-body-size-limit",children:"Request body size limit"}),"\n",(0,r.jsx)(n.p,{children:"Specify the maximum size of an incoming HTTP request body. This makes it possible to deploy and manage large contracts that take up more space."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --request-body-size-limit \n"})}),"\n",(0,r.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,r.jsxs)(n.p,{children:["Retrieve the server config by sending a ",(0,r.jsx)(n.code,{children:"GET"})," request to ",(0,r.jsx)(n.code,{children:"/config"})," and extracting its ",(0,r.jsx)(n.code,{children:"server_config"})," property."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ curl localhost:5050/config | jq .server_config\n"})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>d});var r=t(6540);const s={},i=r.createContext(s);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1e29fbdb.50ba5238.js b/assets/js/1e29fbdb.50ba5238.js new file mode 100644 index 000000000..f6138807f --- /dev/null +++ b/assets/js/1e29fbdb.50ba5238.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7780],{8660:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>t,metadata:()=>a,toc:()=>l});var i=r(4848),s=r(8453);const t={sidebar_position:2.3},o="CLI options",a={id:"running/cli",title:"CLI options",description:"Configure your Devnet instance by specifying CLI parameters on startup.",source:"@site/versioned_docs/version-0.1.1/running/cli.md",sourceDirName:"running",slug:"/running/cli",permalink:"/starknet-devnet-rs/docs/running/cli",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/running/cli.md",tags:[],version:"0.1.1",sidebarPosition:2.3,frontMatter:{sidebar_position:2.3},sidebar:"docSidebar",previous:{title:"Run with Docker",permalink:"/starknet-devnet-rs/docs/running/docker"},next:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation"}},c={},l=[{value:"Help",id:"help",level:2},{value:"Environment variables",id:"environment-variables",level:2},{value:"Precedence",id:"precedence",level:3},{value:"Docker",id:"docker",level:3},{value:"Load configuration from a file",id:"load-configuration-from-a-file",level:2},{value:"Docker",id:"docker-1",level:3}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cli-options",children:"CLI options"}),"\n",(0,i.jsx)(n.p,{children:"Configure your Devnet instance by specifying CLI parameters on startup."}),"\n",(0,i.jsx)(n.h2,{id:"help",children:"Help"}),"\n",(0,i.jsx)(n.p,{children:"Check out all the options with:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ starknet-devnet --help\n"})}),"\n",(0,i.jsx)(n.p,{children:"Or if using dockerized Devnet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run --rm shardlabs/starknet-devnet-rs --help\n"})}),"\n",(0,i.jsx)(n.h2,{id:"environment-variables",children:"Environment variables"}),"\n",(0,i.jsx)(n.p,{children:"Every CLI option can also be specified via an environment variable:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ = = starknet-devnet\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To see the exact variable names, use ",(0,i.jsx)(n.a,{href:"#help",children:(0,i.jsx)(n.code,{children:"--help"})}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"precedence",children:"Precedence"}),"\n",(0,i.jsx)(n.p,{children:"If both a CLI argument and an environment variable are passed for a parameter, the CLI argument takes precedence. If none are provided, the default value is used. E.g. if running Devnet with the following command, seed value 42 will be used:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ SEED=10 starknet-devnet --seed 42\n"})}),"\n",(0,i.jsx)(n.h3,{id:"docker",children:"Docker"}),"\n",(0,i.jsx)(n.p,{children:"If using dockerized Devnet, specify the variables like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run \\\n -e = \\\n -e = \\\n ... \\\n shardlabs/starknet-devnet-rs\n"})}),"\n",(0,i.jsx)(n.h2,{id:"load-configuration-from-a-file",children:"Load configuration from a file"}),"\n",(0,i.jsxs)(n.p,{children:["If providing many configuration parameters in a single command becomes cumbersome, consider loading them from a file. By relying on ",(0,i.jsx)(n.a,{href:"#environment-variables",children:"environment variables"}),", prepare your configuration in a file like this:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"export SEED=42\nexport ACCOUNTS=3\n...\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Assuming the file is called ",(0,i.jsx)(n.code,{children:".my-env-file"}),", then run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"$ source .my-env-file && starknet-devnet\n"})}),"\n",(0,i.jsx)(n.p,{children:"To run in a subshell and prevent environment pollution (i.e. to unset the variables after Devnet exits), use parentheses:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"$ ( source .my-env-file && starknet-devnet )\n"})}),"\n",(0,i.jsx)(n.h3,{id:"docker-1",children:"Docker"}),"\n",(0,i.jsxs)(n.p,{children:["To load environment variables from ",(0,i.jsx)(n.code,{children:".my-env-file"})," with Docker, remove the ",(0,i.jsx)(n.code,{children:"export"})," part in each line to have the file look like this:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"SEED=42\nACCOUNTS=3\n...\n"})}),"\n",(0,i.jsx)(n.p,{children:"Then run:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run --env-file .my-env-file shardlabs/starknet-devnet-rs\n"})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>a});var i=r(6540);const s={},t=i.createContext(s);function o(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2146f16f.3e9e5b9b.js b/assets/js/2146f16f.3e9e5b9b.js deleted file mode 100644 index 13582e8da..000000000 --- a/assets/js/2146f16f.3e9e5b9b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6773],{1017:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/versioned_docs/version-0.0.7/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/account-impersonation.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(n.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(n.a,{href:"/starknet-devnet-rs/docs/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(n.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Only ",(0,o.jsx)(n.code,{children:"INVOKE"})," and ",(0,o.jsx)(n.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(n.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(n.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(n.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(n.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(n.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(n.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(n.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsxs)(n.p,{children:["Users can disable account impersonation by starting Devnet with CLI flag ",(0,o.jsx)(n.code,{children:"--disable-account-impersonation"})," or by setting environment variable ",(0,o.jsx)(n.code,{children:"DISABLE_ACCOUNT_IMPERSONATION"}),". Every subsequent JSON-RPC impersonation request will return an error. This feature can be used in CTFs to prevent participants from easily solving the task."]}),"\n",(0,o.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(n.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(n.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(n.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(n.p,{children:["Stops the effect of ",(0,o.jsx)(n.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2146f16f.fed3c84a.js b/assets/js/2146f16f.fed3c84a.js new file mode 100644 index 000000000..401e2a222 --- /dev/null +++ b/assets/js/2146f16f.fed3c84a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6773],{1017:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/versioned_docs/version-0.0.7/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/0.0.7/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/account-impersonation.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/0.0.7/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/0.0.7/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(n.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(n.a,{href:"/starknet-devnet-rs/docs/0.0.7/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(n.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Only ",(0,o.jsx)(n.code,{children:"INVOKE"})," and ",(0,o.jsx)(n.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(n.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(n.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(n.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(n.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(n.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(n.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(n.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsxs)(n.p,{children:["Users can disable account impersonation by starting Devnet with CLI flag ",(0,o.jsx)(n.code,{children:"--disable-account-impersonation"})," or by setting environment variable ",(0,o.jsx)(n.code,{children:"DISABLE_ACCOUNT_IMPERSONATION"}),". Every subsequent JSON-RPC impersonation request will return an error. This feature can be used in CTFs to prevent participants from easily solving the task."]}),"\n",(0,o.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(n.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(n.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(n.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(n.p,{children:["Stops the effect of ",(0,o.jsx)(n.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/28a0cb7e.1e593781.js b/assets/js/28a0cb7e.1e593781.js new file mode 100644 index 000000000..8607d2393 --- /dev/null +++ b/assets/js/28a0cb7e.1e593781.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[141],{5040:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>i});var t=s(4848),r=s(8453);const a={},d="L1-L2 interaction via Postman",o={id:"postman",title:"L1-L2 interaction via Postman",description:"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-devnet-js to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.",source:"@site/versioned_docs/version-0.1.1/postman.md",sourceDirName:".",slug:"/postman",permalink:"/starknet-devnet-rs/docs/postman",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/postman.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/lite"},next:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/predeployed"}},c={},i=[{value:"Load",id:"load",level:2},{value:"Flush",id:"flush",level:2},{value:"Disclaimer",id:"disclaimer",level:2},{value:"Mock transactions",id:"mock-transactions",level:2},{value:"L1->L2",id:"l1-l2",level:3},{value:"L2->L1",id:"l2-l1",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"l1-l2-interaction-via-postman",children:"L1-L2 interaction via Postman"}),"\n",(0,t.jsxs)(n.p,{children:["Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, ",(0,t.jsx)(n.a,{href:"#load",children:"load"})," a messaging contract, and ",(0,t.jsx)(n.a,{href:"#flush",children:"flush"})," the queue when needed. You can use ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-js",children:(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"starknet-devnet-js"})})})," to perform these actions, as witnessed in ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-js/blob/master/test/postman.test.ts",children:(0,t.jsx)(n.strong,{children:"this example"})}),", or directly send requests to the endpoints specified below."]}),"\n",(0,t.jsx)(n.h2,{id:"load",children:"Load"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/load_l1_messaging_contract\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanLoad",\n "params": {\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Loads a ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract. The ",(0,t.jsx)(n.code,{children:"address"})," parameter is optional; if provided, the ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract will be fetched from that address, otherwise a new one will be deployed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"networkUrl"})," is the URL of the JSON-RPC API of the L1 node you've run locally or that already exists; possibilities include, and are not limited to:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/foundry-rs/foundry/tree/master/crates/anvil",children:(0,t.jsx)(n.strong,{children:"Anvil"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://sepolia.etherscan.io/",children:(0,t.jsx)(n.strong,{children:"Sepolia testnet"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/ganache",children:(0,t.jsx)(n.strong,{children:"Ganache"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/ethereum/go-ethereum#docker-quick-start",children:(0,t.jsx)(n.strong,{children:"Geth"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://hardhat.org/hardhat-network/#running-stand-alone-in-order-to-support-wallets-and-other-software",children:(0,t.jsx)(n.strong,{children:"Hardhat node"})})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"flush",children:"Flush"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanFlush"\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Goes through the newly enqueued messages, sending them from L1 to L2 and from L2 to L1. Requires no body. Optionally, set the ",(0,t.jsx)(n.code,{children:"dry_run"})," specifier to just see the result of flushing, without actually triggering it:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "dry_run": true }\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanFlush",\n "params": {\n "dry_run": true\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is required if ",(0,t.jsx)(n.code,{children:"dry_run"})," is not set."]}),"\n",(0,t.jsx)(n.h2,{id:"disclaimer",children:"Disclaimer"}),"\n",(0,t.jsxs)(n.p,{children:["This method of L1-L2 communication testing differs from how Starknet mainnet and testnets work. Taking ",(0,t.jsx)(n.a,{href:"https://github.com/MikeSpa/starknet-test/blob/6a68d033cd7ddb5df937154f860f1c06174e6860/L1L2Example.sol#L46",children:(0,t.jsx)(n.strong,{children:"L1L2Example.sol"})})," (originally from Starknet documentation, no longer available there):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(IStarknetCore starknetCore_) public {\n starknetCore = starknetCore_;\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The constructor takes an ",(0,t.jsx)(n.code,{children:"IStarknetCore"})," contract as argument, however for Devnet's L1-L2 communication testing, this has to be replaced with the logic in ",(0,t.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/testing/MockStarknetMessaging.sol",children:(0,t.jsx)(n.strong,{children:"MockStarknetMessaging.sol"})}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(MockStarknetMessaging mockStarknetMessaging_) public {\n starknetCore = mockStarknetMessaging_;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"mock-transactions",children:"Mock transactions"}),"\n",(0,t.jsx)(n.h3,{id:"l1-l2",children:"L1->L2"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L1 to L2 without the need for running L1. Deployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"entry_point_selector"})," must be valid otherwise new block will not be created."]}),"\n",(0,t.jsxs)(n.p,{children:["Normally ",(0,t.jsx)(n.code,{children:"nonce"})," is calculated by L1 StarknetContract and it's used in L1 and L2. In this case, we need to provide it manually."]}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is ",(0,t.jsx)(n.strong,{children:"not"})," required for this operation."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/send_message_to_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanSendMessageToL2",\n "params": {\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "transaction_hash": "0x0548c761a9fd5512782998b2da6f44c42bf78fb88c3794eea330a91c9abb10bb" }\n'})}),"\n",(0,t.jsx)(n.h3,{id:"l2-l1",children:"L2->L1"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L2 to L1.\nDeployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"l1_contract_address"})," must be valid."]}),"\n",(0,t.jsx)(n.p,{children:"A running L1 node is required for this operation."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/consume_message_from_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanConsumeMessageFromL2",\n "params": {\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{"message_hash": "0xae14f241131b524ac8d043d9cb4934253ac5c5589afef19f0d761816a9c7e26d"}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>d,x:()=>o});var t=s(6540);const r={},a=t.createContext(r);function d(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/425e1ae2.469cee91.js b/assets/js/425e1ae2.469cee91.js new file mode 100644 index 000000000..e5fb5ec38 --- /dev/null +++ b/assets/js/425e1ae2.469cee91.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2916],{1161:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var s=n(4848),i=n(8453);const o={sidebar_position:1},r="Intro",d={id:"intro",title:"Intro",description:"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!",source:"@site/versioned_docs/version-0.0.7/intro.md",sourceDirName:".",slug:"/intro",permalink:"/starknet-devnet-rs/docs/0.0.7/intro",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/intro.md",tags:[],version:"0.0.7",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",next:{title:"Running",permalink:"/starknet-devnet-rs/docs/0.0.7/category/running"}},c={},a=[];function l(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",li:"li",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"intro",children:"Intro"}),"\n",(0,s.jsxs)(t.admonition,{title:"Difference disclaimer",type:"danger",children:[(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!"}),"\n",(0,s.jsxs)(t.li,{children:["The semantics of ",(0,s.jsx)(t.code,{children:"REJECTED"})," and ",(0,s.jsx)(t.code,{children:"REVERTED"})," status of a transaction is not the same as on the official testnet:"]}),"\n"]}),(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Tx status"}),(0,s.jsx)(t.th,{children:"Official testnet"}),(0,s.jsx)(t.th,{children:"Devnet"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"REJECTED"})}),(0,s.jsx)(t.td,{children:"validation failed; not included in a block"}),(0,s.jsx)(t.td,{children:"not used"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"REVERTED"})}),(0,s.jsx)(t.td,{children:"validation passed but execution failed; included in a block"}),(0,s.jsxs)(t.td,{children:["validation or execution failed; not included in a block",(0,s.jsx)(t.code,{children:"*"})]})]})]})]}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"*"}),": dummy zeroes (0) in tx info for block number and tx index"]})]}),"\n",(0,s.jsxs)(t.p,{children:["You may now proceed with ",(0,s.jsx)(t.a,{href:"./running/install",children:"running Devnet"})," and checking out the many features listed in the sidebar on the left."]})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var s=n(6540);const i={},o=s.createContext(i);function r(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/49885c5e.4bc7e5ad.js b/assets/js/49885c5e.4bc7e5ad.js new file mode 100644 index 000000000..03cfcc982 --- /dev/null +++ b/assets/js/49885c5e.4bc7e5ad.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2828],{433:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>t,metadata:()=>a,toc:()=>l});var i=r(4848),s=r(8453);const t={sidebar_position:2.3},o="CLI options",a={id:"running/cli",title:"CLI options",description:"Configure your Devnet instance by specifying CLI parameters on startup.",source:"@site/versioned_docs/version-0.0.7/running/cli.md",sourceDirName:"running",slug:"/running/cli",permalink:"/starknet-devnet-rs/docs/0.0.7/running/cli",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/running/cli.md",tags:[],version:"0.0.7",sidebarPosition:2.3,frontMatter:{sidebar_position:2.3},sidebar:"docSidebar",previous:{title:"Run with Docker",permalink:"/starknet-devnet-rs/docs/0.0.7/running/docker"},next:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/0.0.7/account-impersonation"}},c={},l=[{value:"Help",id:"help",level:2},{value:"Environment variables",id:"environment-variables",level:2},{value:"Precedence",id:"precedence",level:3},{value:"Docker",id:"docker",level:3},{value:"Load configuration from a file",id:"load-configuration-from-a-file",level:2},{value:"Docker",id:"docker-1",level:3}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cli-options",children:"CLI options"}),"\n",(0,i.jsx)(n.p,{children:"Configure your Devnet instance by specifying CLI parameters on startup."}),"\n",(0,i.jsx)(n.h2,{id:"help",children:"Help"}),"\n",(0,i.jsx)(n.p,{children:"Check out all the options with:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ starknet-devnet --help\n"})}),"\n",(0,i.jsx)(n.p,{children:"Or if using dockerized Devnet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run --rm shardlabs/starknet-devnet-rs --help\n"})}),"\n",(0,i.jsx)(n.h2,{id:"environment-variables",children:"Environment variables"}),"\n",(0,i.jsx)(n.p,{children:"Every CLI option can also be specified via an environment variable:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ = = starknet-devnet\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To see the exact variable names, use ",(0,i.jsx)(n.a,{href:"#help",children:(0,i.jsx)(n.code,{children:"--help"})}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"precedence",children:"Precedence"}),"\n",(0,i.jsx)(n.p,{children:"If both a CLI argument and an environment variable are passed for a parameter, the CLI argument takes precedence. If none are provided, the default value is used. E.g. if running Devnet with the following command, seed value 42 will be used:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ SEED=10 starknet-devnet --seed 42\n"})}),"\n",(0,i.jsx)(n.h3,{id:"docker",children:"Docker"}),"\n",(0,i.jsx)(n.p,{children:"If using dockerized Devnet, specify the variables like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run \\\n -e = \\\n -e = \\\n ... \\\n shardlabs/starknet-devnet-rs\n"})}),"\n",(0,i.jsx)(n.h2,{id:"load-configuration-from-a-file",children:"Load configuration from a file"}),"\n",(0,i.jsxs)(n.p,{children:["If providing many configuration parameters in a single command becomes cumbersome, consider loading them from a file. By relying on ",(0,i.jsx)(n.a,{href:"#environment-variables",children:"environment variables"}),", prepare your configuration in a file like this:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"export SEED=42\nexport ACCOUNTS=3\n...\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Assuming the file is called ",(0,i.jsx)(n.code,{children:".my-env-file"}),", then run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"$ source .my-env-file && starknet-devnet\n"})}),"\n",(0,i.jsx)(n.p,{children:"To run in a subshell and prevent environment pollution (i.e. to unset the variables after Devnet exits), use parentheses:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"$ ( source .my-env-file && starknet-devnet )\n"})}),"\n",(0,i.jsx)(n.h3,{id:"docker-1",children:"Docker"}),"\n",(0,i.jsxs)(n.p,{children:["To load environment variables from ",(0,i.jsx)(n.code,{children:".my-env-file"})," with Docker, remove the ",(0,i.jsx)(n.code,{children:"export"})," part in each line to have the file look like this:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"SEED=42\nACCOUNTS=3\n...\n"})}),"\n",(0,i.jsx)(n.p,{children:"Then run:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run --env-file .my-env-file shardlabs/starknet-devnet-rs\n"})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>a});var i=r(6540);const s={},t=i.createContext(s);function o(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/49885c5e.88fa1633.js b/assets/js/49885c5e.88fa1633.js deleted file mode 100644 index 2d4e435cd..000000000 --- a/assets/js/49885c5e.88fa1633.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2828],{433:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>t,metadata:()=>a,toc:()=>l});var i=r(4848),s=r(8453);const t={sidebar_position:2.3},o="CLI options",a={id:"running/cli",title:"CLI options",description:"Configure your Devnet instance by specifying CLI parameters on startup.",source:"@site/versioned_docs/version-0.0.7/running/cli.md",sourceDirName:"running",slug:"/running/cli",permalink:"/starknet-devnet-rs/docs/running/cli",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/running/cli.md",tags:[],version:"0.0.7",sidebarPosition:2.3,frontMatter:{sidebar_position:2.3},sidebar:"docSidebar",previous:{title:"Run with Docker",permalink:"/starknet-devnet-rs/docs/running/docker"},next:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation"}},c={},l=[{value:"Help",id:"help",level:2},{value:"Environment variables",id:"environment-variables",level:2},{value:"Precedence",id:"precedence",level:3},{value:"Docker",id:"docker",level:3},{value:"Load configuration from a file",id:"load-configuration-from-a-file",level:2},{value:"Docker",id:"docker-1",level:3}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"cli-options",children:"CLI options"}),"\n",(0,i.jsx)(n.p,{children:"Configure your Devnet instance by specifying CLI parameters on startup."}),"\n",(0,i.jsx)(n.h2,{id:"help",children:"Help"}),"\n",(0,i.jsx)(n.p,{children:"Check out all the options with:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ starknet-devnet --help\n"})}),"\n",(0,i.jsx)(n.p,{children:"Or if using dockerized Devnet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run --rm shardlabs/starknet-devnet-rs --help\n"})}),"\n",(0,i.jsx)(n.h2,{id:"environment-variables",children:"Environment variables"}),"\n",(0,i.jsx)(n.p,{children:"Every CLI option can also be specified via an environment variable:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ = = starknet-devnet\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To see the exact variable names, use ",(0,i.jsx)(n.a,{href:"#help",children:(0,i.jsx)(n.code,{children:"--help"})}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"precedence",children:"Precedence"}),"\n",(0,i.jsx)(n.p,{children:"If both a CLI argument and an environment variable are passed for a parameter, the CLI argument takes precedence. If none are provided, the default value is used. E.g. if running Devnet with the following command, seed value 42 will be used:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ SEED=10 starknet-devnet --seed 42\n"})}),"\n",(0,i.jsx)(n.h3,{id:"docker",children:"Docker"}),"\n",(0,i.jsx)(n.p,{children:"If using dockerized Devnet, specify the variables like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run \\\n -e = \\\n -e = \\\n ... \\\n shardlabs/starknet-devnet-rs\n"})}),"\n",(0,i.jsx)(n.h2,{id:"load-configuration-from-a-file",children:"Load configuration from a file"}),"\n",(0,i.jsxs)(n.p,{children:["If providing many configuration parameters in a single command becomes cumbersome, consider loading them from a file. By relying on ",(0,i.jsx)(n.a,{href:"#environment-variables",children:"environment variables"}),", prepare your configuration in a file like this:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"export SEED=42\nexport ACCOUNTS=3\n...\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Assuming the file is called ",(0,i.jsx)(n.code,{children:".my-env-file"}),", then run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"$ source .my-env-file && starknet-devnet\n"})}),"\n",(0,i.jsx)(n.p,{children:"To run in a subshell and prevent environment pollution (i.e. to unset the variables after Devnet exits), use parentheses:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"$ ( source .my-env-file && starknet-devnet )\n"})}),"\n",(0,i.jsx)(n.h3,{id:"docker-1",children:"Docker"}),"\n",(0,i.jsxs)(n.p,{children:["To load environment variables from ",(0,i.jsx)(n.code,{children:".my-env-file"})," with Docker, remove the ",(0,i.jsx)(n.code,{children:"export"})," part in each line to have the file look like this:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"SEED=42\nACCOUNTS=3\n...\n"})}),"\n",(0,i.jsx)(n.p,{children:"Then run:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ docker run --env-file .my-env-file shardlabs/starknet-devnet-rs\n"})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>o,x:()=>a});var i=r(6540);const s={},t=i.createContext(s);function o(e){const n=i.useContext(t);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4adc7347.97f20e9d.js b/assets/js/4adc7347.97f20e9d.js new file mode 100644 index 000000000..9c1e0efad --- /dev/null +++ b/assets/js/4adc7347.97f20e9d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9736],{3806:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>d,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>i});var c=t(4848),s=t(8453);const a={},d="Account balance",o={id:"balance",title:"Account balance",description:"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.",source:"@site/versioned_docs/version-0.1.1/balance.md",sourceDirName:".",slug:"/balance",permalink:"/starknet-devnet-rs/docs/balance",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/balance.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"API",permalink:"/starknet-devnet-rs/docs/api"},next:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/blocks"}},r={},i=[{value:"Mint token - Local faucet",id:"mint-token---local-faucet",level:2},{value:"Check balance",id:"check-balance",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.h1,{id:"account-balance",children:"Account balance"}),"\n",(0,c.jsx)(n.p,{children:"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself."}),"\n",(0,c.jsx)(n.p,{children:"Separate tokens use separate ERC20 contracts for minting and charging fees. These are the token contracts predeployed by Devnet and the addresses where they are located:"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["ETH: ",(0,c.jsx)(n.code,{children:"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"})]}),"\n",(0,c.jsxs)(n.li,{children:["STRK: ",(0,c.jsx)(n.code,{children:"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"})]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"mint-token---local-faucet",children:"Mint token - Local faucet"}),"\n",(0,c.jsxs)(n.p,{children:["By sending a ",(0,c.jsx)(n.code,{children:"POST"})," request to ",(0,c.jsx)(n.code,{children:"/mint"})," or ",(0,c.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,c.jsx)(n.code,{children:"devnet_mint"})," for a token, you initiate a transaction on that token's ERC20 contract. The response contains the hash of this transaction, as well as the new balance after minting. The token is specified by providing the unit, and defaults to ",(0,c.jsx)(n.code,{children:"WEI"}),"."]}),"\n",(0,c.jsxs)(n.p,{children:["The value of ",(0,c.jsx)(n.code,{children:"amount"})," is in WEI and needs to be an integer (or a float whose fractional part is 0, e.g. ",(0,c.jsx)(n.code,{children:"1000.0"})," or ",(0,c.jsx)(n.code,{children:"1e21"}),")"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'POST /mint\n{\n "address": "0x6e3205f...",\n "amount": 500000,\n "unit": "WEI" | "FRI"\n}\n'})}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_mint",\n "params": {\n "address": "0x6e3205f...",\n "amount": 500000,\n "unit": "WEI" | "FRI"\n }\n}\n'})}),"\n",(0,c.jsx)(n.p,{children:"Response:"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'{\n "new_balance": 500000,\n "unit": "WEI" | "FRI",\n "tx_hash": "0xa24f23..."\n}\n'})}),"\n",(0,c.jsx)(n.h2,{id:"check-balance",children:"Check balance"}),"\n",(0,c.jsxs)(n.p,{children:["Check the balance of an address by sending a ",(0,c.jsx)(n.code,{children:"GET"})," request to ",(0,c.jsx)(n.code,{children:"/account_balance"}),". The address should be a 0x-prefixed hex string; ",(0,c.jsx)(n.code,{children:"unit"})," defaults to ",(0,c.jsx)(n.code,{children:"WEI"})," and ",(0,c.jsx)(n.code,{children:"block_tag"})," to ",(0,c.jsx)(n.code,{children:"latest"}),"."]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:"GET /account_balance?address=
[&unit=][&block_tag=]\n"})}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_getAccountBalance",\n "params": {\n "address": "0x6e3205f...",\n "unit": "WEI" | "FRI",\n "block_tag": "latest" | "pending"\n }\n}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>o});var c=t(6540);const s={},a=c.createContext(s);function d(e){const n=c.useContext(a);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),c.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/425e1ae2.a5de04d1.js b/assets/js/5402810c.ffdb5d60.js similarity index 92% rename from assets/js/425e1ae2.a5de04d1.js rename to assets/js/5402810c.ffdb5d60.js index 005de168a..b1a68cb40 100644 --- a/assets/js/425e1ae2.a5de04d1.js +++ b/assets/js/5402810c.ffdb5d60.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2916],{1161:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var s=n(4848),i=n(8453);const o={sidebar_position:1},r="Intro",d={id:"intro",title:"Intro",description:"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!",source:"@site/versioned_docs/version-0.0.7/intro.md",sourceDirName:".",slug:"/intro",permalink:"/starknet-devnet-rs/docs/intro",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/intro.md",tags:[],version:"0.0.7",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",next:{title:"Running",permalink:"/starknet-devnet-rs/docs/category/running"}},c={},a=[];function l(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",li:"li",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"intro",children:"Intro"}),"\n",(0,s.jsxs)(t.admonition,{title:"Difference disclaimer",type:"danger",children:[(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!"}),"\n",(0,s.jsxs)(t.li,{children:["The semantics of ",(0,s.jsx)(t.code,{children:"REJECTED"})," and ",(0,s.jsx)(t.code,{children:"REVERTED"})," status of a transaction is not the same as on the official testnet:"]}),"\n"]}),(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Tx status"}),(0,s.jsx)(t.th,{children:"Official testnet"}),(0,s.jsx)(t.th,{children:"Devnet"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"REJECTED"})}),(0,s.jsx)(t.td,{children:"validation failed; not included in a block"}),(0,s.jsx)(t.td,{children:"not used"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"REVERTED"})}),(0,s.jsx)(t.td,{children:"validation passed but execution failed; included in a block"}),(0,s.jsxs)(t.td,{children:["validation or execution failed; not included in a block",(0,s.jsx)(t.code,{children:"*"})]})]})]})]}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"*"}),": dummy zeroes (0) in tx info for block number and tx index"]})]}),"\n",(0,s.jsxs)(t.p,{children:["You may now proceed with ",(0,s.jsx)(t.a,{href:"./running/install",children:"running Devnet"})," and checking out the many features listed in the sidebar on the left."]})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var s=n(6540);const i={},o=s.createContext(i);function r(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5348],{1296:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var s=n(4848),i=n(8453);const o={sidebar_position:1},r="Intro",d={id:"intro",title:"Intro",description:"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!",source:"@site/versioned_docs/version-0.1.1/intro.md",sourceDirName:".",slug:"/intro",permalink:"/starknet-devnet-rs/docs/intro",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/intro.md",tags:[],version:"0.1.1",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docSidebar",next:{title:"Running",permalink:"/starknet-devnet-rs/docs/category/running"}},c={},a=[];function l(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",li:"li",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"intro",children:"Intro"}),"\n",(0,s.jsxs)(t.admonition,{title:"Difference disclaimer",type:"danger",children:[(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!"}),"\n",(0,s.jsxs)(t.li,{children:["The semantics of ",(0,s.jsx)(t.code,{children:"REJECTED"})," and ",(0,s.jsx)(t.code,{children:"REVERTED"})," status of a transaction is not the same as on the official testnet:"]}),"\n"]}),(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Tx status"}),(0,s.jsx)(t.th,{children:"Official testnet"}),(0,s.jsx)(t.th,{children:"Devnet"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"REJECTED"})}),(0,s.jsx)(t.td,{children:"validation failed; not included in a block"}),(0,s.jsx)(t.td,{children:"not used"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"REVERTED"})}),(0,s.jsx)(t.td,{children:"validation passed but execution failed; included in a block"}),(0,s.jsxs)(t.td,{children:["validation or execution failed; not included in a block",(0,s.jsx)(t.code,{children:"*"})]})]})]})]}),(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"*"}),": dummy zeroes (0) in tx info for block number and tx index"]})]}),"\n",(0,s.jsxs)(t.p,{children:["You may now proceed with ",(0,s.jsx)(t.a,{href:"./running/install",children:"running Devnet"})," and checking out the many features listed in the sidebar on the left."]})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var s=n(6540);const i={},o=s.createContext(i);function r(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5985dcf4.70d866fa.js b/assets/js/5985dcf4.70d866fa.js new file mode 100644 index 000000000..081f78bfe --- /dev/null +++ b/assets/js/5985dcf4.70d866fa.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7969],{6127:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=s(4848),t=s(8453);const i={sidebar_position:2.2},o="Run with Docker",d={id:"running/docker",title:"Run with Docker",description:"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:",source:"@site/versioned_docs/version-0.0.7/running/docker.md",sourceDirName:"running",slug:"/running/docker",permalink:"/starknet-devnet-rs/docs/0.0.7/running/docker",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/running/docker.md",tags:[],version:"0.0.7",sidebarPosition:2.2,frontMatter:{sidebar_position:2.2},sidebar:"docSidebar",previous:{title:"Install and run",permalink:"/starknet-devnet-rs/docs/0.0.7/running/install"},next:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/0.0.7/running/cli"}},a={},l=[{value:"Docker image tags",id:"docker-image-tags",level:3},{value:"Container port publishing",id:"container-port-publishing",level:3},{value:"Linux",id:"linux",level:4},{value:"Mac and Windows",id:"mac-and-windows",level:4},{value:"Development note",id:"development-note",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"run-with-docker",children:"Run with Docker"}),"\n",(0,r.jsxs)(n.p,{children:["Devnet is available as a Docker image (",(0,r.jsx)(n.a,{href:"https://hub.docker.com/r/shardlabs/starknet-devnet-rs/",children:"Docker Hub link"}),"). To download the ",(0,r.jsx)(n.code,{children:"latest"})," image, run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker pull shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsx)(n.p,{children:"Supported platforms: linux/amd64 and linux/arm64 (also executable on darwin/arm64)."}),"\n",(0,r.jsxs)(n.p,{children:["Running a container is done like this (see ",(0,r.jsx)(n.a,{href:"#container-port-publishing",children:"port publishing"})," for more info):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs [OPTIONS]\n"})}),"\n",(0,r.jsx)(n.h3,{id:"docker-image-tags",children:"Docker image tags"}),"\n",(0,r.jsx)(n.p,{children:"All of the versions published on crates.io for starknet-devnet are available as docker images, which can be used via:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"latest"})," docker image tag corresponds to the last published version on crates.io."]})}),"\n",(0,r.jsxs)(n.p,{children:["Commits to the ",(0,r.jsx)(n.code,{children:"main"})," branch of this repository are mostly available as images tagged with their commit hash (the full 40-lowercase-hex-digits SHA1 digest):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By appending the ",(0,r.jsx)(n.code,{children:"-seed0"})," suffix, you can use images which ",(0,r.jsx)(n.a,{href:"../predeployed",children:"predeploy funded accounts"})," with ",(0,r.jsx)(n.code,{children:"--seed 0"}),", thus always predeploying the same set of accounts:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:-seed0\n$ docker pull shardlabs/starknet-devnet-rs:latest-seed0\n"})}),"\n",(0,r.jsx)(n.h3,{id:"container-port-publishing",children:"Container port publishing"}),"\n",(0,r.jsx)(n.h4,{id:"linux",children:"Linux"}),"\n",(0,r.jsxs)(n.p,{children:["If on a Linux host machine, you can use ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/network/host/",children:(0,r.jsx)(n.code,{children:"--network host"})}),". This way, the port used internally by the container is also available on your host machine. The ",(0,r.jsx)(n.code,{children:"--port"})," option can be used (as well as other CLI options)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run --network host shardlabs/starknet-devnet-rs [--port ]\n"})}),"\n",(0,r.jsx)(n.h4,{id:"mac-and-windows",children:"Mac and Windows"}),"\n",(0,r.jsxs)(n.p,{children:["If not on Linux, you need to publish the container's internally used port to a desired ",(0,r.jsx)(n.code,{children:""})," on your host machine. The internal port is ",(0,r.jsx)(n.code,{children:"5050"})," by default (probably not your concern, but can be overridden with ",(0,r.jsx)(n.code,{children:"--port"}),")."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["E.g. if you want to use your host machine's ",(0,r.jsx)(n.code,{children:"127.0.0.1:5050"}),", you need to run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p 127.0.0.1:5050:5050 shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You may ignore any address-related output logged on container startup (e.g. ",(0,r.jsx)(n.code,{children:"Starknet Devnet listening on 0.0.0.0:5050"}),"). What you will use is what you specified with the ",(0,r.jsx)(n.code,{children:"-p"})," argument."]}),"\n",(0,r.jsxs)(n.p,{children:["If you don't specify the ",(0,r.jsx)(n.code,{children:"HOST"})," part, the server will indeed be available on all of your host machine's addresses (localhost, local network IP, etc.), which may present a security issue if you don't want anyone from the local network to access your Devnet instance."]}),"\n",(0,r.jsx)(n.h3,{id:"development-note",children:"Development note"}),"\n",(0,r.jsx)(n.p,{children:"Due to internal needs, images with arch suffix are built and pushed to Docker Hub, but this is not mentioned in the user docs as users should NOT be needing it."}),"\n",(0,r.jsxs)(n.p,{children:["This is what happens under the hood on ",(0,r.jsx)(n.code,{children:"main"}),":"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["build ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs--amd"})]}),"\n",(0,r.jsxs)(n.li,{children:["build ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs--arm"})]}),"\n",(0,r.jsxs)(n.li,{children:["create and push joint docker manifest called ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs-"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["same for ",(0,r.jsx)(n.code,{children:"latest"})]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>d});var r=s(6540);const t={},i=r.createContext(t);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5fadd32f.3d3c5163.js b/assets/js/5fadd32f.3d3c5163.js new file mode 100644 index 000000000..2dc481869 --- /dev/null +++ b/assets/js/5fadd32f.3d3c5163.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[562],{6920:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const i={},a="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/docs/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/next/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/account-impersonation.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/next/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/next/api"}},c={},d=[{value:"Introduction",id:"introduction",level:2},{value:"Disabling impersonation",id:"disabling-impersonation",level:2},{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(n){const e={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(e.admonition,{type:"info",children:(0,o.jsxs)(e.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(e.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsx)(e.h2,{id:"introduction",children:"Introduction"}),"\n",(0,o.jsxs)(e.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(e.a,{href:"/starknet-devnet-rs/docs/next/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(e.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["Only ",(0,o.jsx)(e.code,{children:"INVOKE"})," and ",(0,o.jsx)(e.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(e.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(e.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(e.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(e.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(e.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(e.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(e.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(e.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsx)(e.h2,{id:"disabling-impersonation",children:"Disabling impersonation"}),"\n",(0,o.jsxs)(e.p,{children:["Users can disable account impersonation by starting Devnet with CLI flag ",(0,o.jsx)(e.code,{children:"--disable-account-impersonation"})," or by setting environment variable ",(0,o.jsx)(e.code,{children:"DISABLE_ACCOUNT_IMPERSONATION"}),". Every subsequent JSON-RPC impersonation request will return an error. This feature can be used in CTFs to prevent participants from easily solving the task."]}),"\n",(0,o.jsx)(e.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(e.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(e.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(e.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(e.p,{children:["Stops the effect of ",(0,o.jsx)(e.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(l,{...n})}):l(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>a,x:()=>r});var o=t(6540);const s={},i=o.createContext(s);function a(n){const e=o.useContext(i);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:a(n.components),o.createElement(i.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/5fadd32f.4470b0e4.js b/assets/js/5fadd32f.4470b0e4.js deleted file mode 100644 index 5a8ecd7cf..000000000 --- a/assets/js/5fadd32f.4470b0e4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[562],{6920:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>a,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const a={},i="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/docs/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/next/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/account-impersonation.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/next/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/next/api"}},c={},d=[{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsxs)(n.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(n.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(n.a,{href:"/starknet-devnet-rs/docs/next/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(n.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Only ",(0,o.jsx)(n.code,{children:"INVOKE"})," and ",(0,o.jsx)(n.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(n.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(n.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(n.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(n.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(n.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(n.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(n.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(n.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsxs)(n.p,{children:["Users can disable account impersonation by starting Devnet with CLI flag ",(0,o.jsx)(n.code,{children:"--disable-account-impersonation"})," or by setting environment variable ",(0,o.jsx)(n.code,{children:"DISABLE_ACCOUNT_IMPERSONATION"}),". Every subsequent JSON-RPC impersonation request will return an error. This feature can be used in CTFs to prevent participants from easily solving the task."]}),"\n",(0,o.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(n.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(n.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(n.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(n.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(n.p,{children:["Stops the effect of ",(0,o.jsx)(n.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5fbc5cf1.76587c2d.js b/assets/js/5fbc5cf1.76587c2d.js deleted file mode 100644 index 20c6e313e..000000000 --- a/assets/js/5fbc5cf1.76587c2d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7624],{8946:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>h,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var a=t(4848),i=t(8453);const r={},s="API",o={id:"api",title:"API",description:"Starknet API",source:"@site/docs/api.md",sourceDirName:".",slug:"/api",permalink:"/starknet-devnet-rs/docs/next/api",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/api.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/next/account-impersonation"},next:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/next/balance"}},c={},d=[{value:"Starknet API",id:"starknet-api",level:2},{value:"Devnet API",id:"devnet-api",level:2},{value:"Config API",id:"config-api",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"api",children:"API"}),"\n",(0,a.jsx)(n.h2,{id:"starknet-api",children:"Starknet API"}),"\n",(0,a.jsxs)(n.p,{children:["Unlike Pythonic Devnet, which also supported Starknet's gateway and feeder gateway API, Devnet in Rust supports Starknet's JSON-RPC API. Since JSON-RPC v0.6.0, to find out which JSON-RPC version is supported by which Devnet version, check out the ",(0,a.jsx)(n.a,{href:"https://github.com/0xspaceshard/starknet-devnet-rs/releases",children:"releases page"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["The JSON-RPC API is reachable via ",(0,a.jsx)(n.code,{children:"/rpc"})," and ",(0,a.jsx)(n.code,{children:"/"})," (e.g. if spawning Devnet with default settings, these URLs are functionally equivalent: ",(0,a.jsx)(n.code,{children:"http://127.0.0.1:5050/rpc"})," and ",(0,a.jsx)(n.code,{children:"http://127.0.0.1:5050/"}),")"]}),"\n",(0,a.jsx)(n.h2,{id:"devnet-api",children:"Devnet API"}),"\n",(0,a.jsx)(n.p,{children:"Devnet has many other functional features which are available via their own endpoints and JSON-RPC, which are all mentioned throughout the documentation."}),"\n",(0,a.jsx)(n.h2,{id:"config-api",children:"Config API"}),"\n",(0,a.jsxs)(n.p,{children:["To retrieve the current configuration of Devnet, send a ",(0,a.jsx)(n.code,{children:"GET"})," request to ",(0,a.jsx)(n.code,{children:"/config"})," or ",(0,a.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,a.jsx)(n.code,{children:"devnet_getConfig"}),". Example response is attached below. It can be interpreted as a JSON mapping of CLI input parameters, both specified and default ones, with some irrelevant parameters omitted. So use ",(0,a.jsx)(n.code,{children:"starknet-devnet --help"})," to better understand the meaning of each value, though keep in mind that some of the parameters have slightly modified names."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "seed": 4063802897,\n "total_accounts": 10,\n "account_contract_class_hash": "0x61dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",\n "predeployed_accounts_initial_balance": "1000000000000000000000",\n "start_time": null,\n "gas_price_wei": 100000000000,\n "gas_price_strk": 100000000000,\n "data_gas_price_wei": 100000000000,\n "data_gas_price_strk": 100000000000,\n "chain_id": "SN_SEPOLIA",\n "dump_on": "exit",\n "dump_path": "dump_path.json",\n "state_archive": "none",\n "fork_config": {\n "url": "http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7",\n "block_number": 26429\n },\n "server_config": {\n "host": "127.0.0.1",\n "port": 5050,\n "timeout": 120,\n "request_body_size_limit": 2000000\n },\n "block_generation": null,\n "lite_mode": false\n}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>o});var a=t(6540);const i={},r=a.createContext(i);function s(e){const n=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),a.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5fbc5cf1.c37e214c.js b/assets/js/5fbc5cf1.c37e214c.js new file mode 100644 index 000000000..8b87aa9a2 --- /dev/null +++ b/assets/js/5fbc5cf1.c37e214c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7624],{8946:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>r,default:()=>l,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var i=n(4848),a=n(8453);const s={},r="API",c={id:"api",title:"API",description:"JSON-RPC API",source:"@site/docs/api.md",sourceDirName:".",slug:"/api",permalink:"/starknet-devnet-rs/docs/next/api",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/api.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/next/account-impersonation"},next:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/next/balance"}},o={},d=[{value:"JSON-RPC API",id:"json-rpc-api",level:2},{value:"Starknet API",id:"starknet-api",level:3},{value:"Devnet API",id:"devnet-api",level:3},{value:"Interacting with Devnet in JavaScript and TypeScript",id:"interacting-with-devnet-in-javascript-and-typescript",level:2},{value:"Config API",id:"config-api",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"api",children:"API"}),"\n",(0,i.jsx)(t.h2,{id:"json-rpc-api",children:"JSON-RPC API"}),"\n",(0,i.jsxs)(t.p,{children:["Both Starknet's and Devnet's JSON-RPC API are reachable at ",(0,i.jsx)(t.code,{children:"/rpc"})," and ",(0,i.jsx)(t.code,{children:"/"}),". E.g. if spawning Devnet with default settings, these URLs are functionally equivalent: ",(0,i.jsx)(t.code,{children:"http://127.0.0.1:5050/rpc"})," and ",(0,i.jsx)(t.code,{children:"http://127.0.0.1:5050/"}),". The difference between these two groups of methods is their prefix: ",(0,i.jsx)(t.code,{children:"starknet_"})," (e.g. ",(0,i.jsx)(t.code,{children:"starknet_getNonce"}),") and ",(0,i.jsx)(t.code,{children:"devnet_"})," (e.g. ",(0,i.jsx)(t.code,{children:"devnet_mint"}),")."]}),"\n",(0,i.jsx)(t.h3,{id:"starknet-api",children:"Starknet API"}),"\n",(0,i.jsxs)(t.p,{children:["Unlike Pythonic Devnet, which also supported Starknet's gateway and feeder gateway API, Devnet in Rust supports ",(0,i.jsx)(t.a,{href:"https://github.com/starkware-libs/starknet-specs/tree/master/api",children:"Starknet's JSON-RPC API"}),". Since JSON-RPC v0.6.0, to find out which JSON-RPC version is supported by which Devnet version, check out the ",(0,i.jsx)(t.a,{href:"https://github.com/0xspaceshard/starknet-devnet-rs/releases",children:"releases page"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"devnet-api",children:"Devnet API"}),"\n",(0,i.jsx)(t.p,{children:"Devnet has many additional features which are available via their own endpoints and JSON-RPC, which are all mentioned throughout the documentation."}),"\n",(0,i.jsx)(t.h2,{id:"interacting-with-devnet-in-javascript-and-typescript",children:"Interacting with Devnet in JavaScript and TypeScript"}),"\n",(0,i.jsxs)(t.p,{children:["To interact with Devnet using the ",(0,i.jsx)(t.a,{href:"#devnet-api",children:"Devnet API"}),", you can use ",(0,i.jsx)(t.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-js/",children:(0,i.jsx)(t.code,{children:"starknet-devnet-js"})}),". This can be especially useful in achieving ",(0,i.jsx)(t.a,{href:"/starknet-devnet-rs/docs/next/postman#l1-l2-interaction-via-postman",children:"L1-L2 communication"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["To interact with Devnet usings the ",(0,i.jsx)(t.a,{href:"#starknet-api",children:"Starknet API"}),", use ",(0,i.jsx)(t.a,{href:"https://www.starknetjs.com/",children:"starknet.js"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"config-api",children:"Config API"}),"\n",(0,i.jsxs)(t.p,{children:["To retrieve the current configuration of Devnet, send a ",(0,i.jsx)(t.code,{children:"GET"})," request to ",(0,i.jsx)(t.code,{children:"/config"})," or ",(0,i.jsx)(t.code,{children:"JSON-RPC"})," request with method name ",(0,i.jsx)(t.code,{children:"devnet_getConfig"}),". Example response is attached below. It can be interpreted as a JSON mapping of CLI input parameters, both specified and default ones, with some irrelevant parameters omitted. So use ",(0,i.jsx)(t.code,{children:"starknet-devnet --help"})," to better understand the meaning of each value, though keep in mind that some of the parameters have slightly modified names."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'{\n "seed": 4063802897,\n "total_accounts": 10,\n "account_contract_class_hash": "0x61dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",\n "predeployed_accounts_initial_balance": "1000000000000000000000",\n "start_time": null,\n "gas_price_wei": 100000000000,\n "gas_price_strk": 100000000000,\n "data_gas_price_wei": 100000000000,\n "data_gas_price_strk": 100000000000,\n "chain_id": "SN_SEPOLIA",\n "dump_on": "exit",\n "dump_path": "dump_path.json",\n "state_archive": "none",\n "fork_config": {\n "url": "http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7",\n "block_number": 26429\n },\n "server_config": {\n "host": "127.0.0.1",\n "port": 5050,\n "timeout": 120,\n "request_body_size_limit": 2000000\n },\n "block_generation": null,\n "lite_mode": false\n}\n'})})]})}function l(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>c});var i=n(6540);const a={},s=i.createContext(a);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/673b87a5.e2e634e1.js b/assets/js/673b87a5.e2e634e1.js new file mode 100644 index 000000000..d9eb1f163 --- /dev/null +++ b/assets/js/673b87a5.e2e634e1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[484],{3673:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var n=s(4848),r=s(8453);const o={},i="Historic state support",a={id:"historic-state",title:"Historic state support",description:"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.",source:"@site/versioned_docs/version-0.1.1/historic-state.md",sourceDirName:".",slug:"/historic-state",permalink:"/starknet-devnet-rs/docs/historic-state",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/historic-state.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Forking",permalink:"/starknet-devnet-rs/docs/forking"},next:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/lite"}},c={},l=[];function d(e){const t={code:"code",h1:"h1",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"historic-state-support",children:"Historic state support"}),"\n",(0,n.jsxs)(t.p,{children:["With state archive capacity set to ",(0,n.jsx)(t.code,{children:"full"}),", Devnet will store full state history, enabling its querying by block hash or number. The default mode is ",(0,n.jsx)(t.code,{children:"none"}),", where no old states are stored and only the latest is available for querying."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:"$ starknet-devnet --state-archive-capacity \n"})}),"\n",(0,n.jsxs)(t.p,{children:["All RPC endpoints that support querying the state at an old (non-latest) block only work with state archive capacity set to ",(0,n.jsx)(t.code,{children:"full"}),"."]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>i,x:()=>a});var n=s(6540);const r={},o=n.createContext(r);function i(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6d990bb1.a3d78aa1.js b/assets/js/6d990bb1.d5f5f3dc.js similarity index 70% rename from assets/js/6d990bb1.a3d78aa1.js rename to assets/js/6d990bb1.d5f5f3dc.js index 8e9fc2422..37e5332f6 100644 --- a/assets/js/6d990bb1.a3d78aa1.js +++ b/assets/js/6d990bb1.d5f5f3dc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2282],{7164:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/next/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/next/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/next/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/next/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/next/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/next/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/next/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/next/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/next/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/next/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/next/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/next/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/next/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/next/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/next/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/next/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/next/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Configure your Devnet instance by specifying CLI parameters on startup.","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"To read generally about ways to configure your Devnet instance, check out the CLI section.","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime, /increasetime and JSON-RPC methods devnetsetTime, devnetincreaseTime generate a new block. This can be changed for /settime (devnetsetTime) by setting the optional parameter generate_block to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2282],{7164:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/next/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/next/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/next/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/next/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/next/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/next/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/next/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/next/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/next/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/next/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/next/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/next/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/next/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/next/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/next/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/next/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/next/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"JSON-RPC API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"By default, Devnet starts with a genesis block labelled with number zero. In forking mode, the genesis block number is equal to the forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-devnet-js to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Configure your Devnet instance by specifying CLI parameters on startup.","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"To read generally about ways to configure your Devnet instance, check out the CLI section.","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime, /increasetime and JSON-RPC methods devnetsetTime, devnetincreaseTime generate a new block. This can be changed for /settime (devnetsetTime) by setting the optional parameter generate_block to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/7923f30a.012c6902.js b/assets/js/7923f30a.012c6902.js new file mode 100644 index 000000000..e5694ca07 --- /dev/null +++ b/assets/js/7923f30a.012c6902.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9998],{2432:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>s,default:()=>h,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var i=t(4848),r=t(8453);const l={sidebar_position:2.1},s="Install and run",a={id:"running/install",title:"Install and run",description:"Requirements",source:"@site/versioned_docs/version-0.0.7/running/install.md",sourceDirName:"running",slug:"/running/install",permalink:"/starknet-devnet-rs/docs/0.0.7/running/install",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/running/install.md",tags:[],version:"0.0.7",sidebarPosition:2.1,frontMatter:{sidebar_position:2.1},sidebar:"docSidebar",previous:{title:"Running",permalink:"/starknet-devnet-rs/docs/0.0.7/category/running"},next:{title:"Run with Docker",permalink:"/starknet-devnet-rs/docs/0.0.7/running/docker"}},o={},c=[{value:"Requirements",id:"requirements",level:2},{value:"Install an executable binary",id:"install-an-executable-binary",level:2},{value:"Remove Pythonic Devnet",id:"remove-pythonic-devnet",level:3},{value:"Install from crates.io",id:"install-from-cratesio",level:3},{value:"Install from GitHub",id:"install-from-github",level:3},{value:"Run the installed executable",id:"run-the-installed-executable",level:3},{value:"Fetch a pre-compiled binary executable",id:"fetch-a-pre-compiled-binary-executable",level:2},{value:"Run from source",id:"run-from-source",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"install-and-run",children:"Install and run"}),"\n",(0,i.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,i.jsxs)(n.p,{children:["Any of the approaches below that mention ",(0,i.jsx)(n.code,{children:"cargo"})," require you to have ",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"installed Rust"}),". You might also need to install ",(0,i.jsx)(n.code,{children:"pkg-config"})," and ",(0,i.jsx)(n.code,{children:"make"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The required Rust version is specified in ",(0,i.jsx)(n.code,{children:"rust-toolchain.toml"})," in the project root and handled automatically by ",(0,i.jsx)(n.code,{children:"cargo"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"install-an-executable-binary",children:"Install an executable binary"}),"\n",(0,i.jsxs)(n.p,{children:["Installing an executable binary is achievable with ",(0,i.jsx)(n.code,{children:"cargo install"})," via ",(0,i.jsx)(n.a,{href:"https://crates.io/",children:"crates.io"})," or ",(0,i.jsx)(n.a,{href:"https://github.com",children:"github.com"}),". This approach downloads the crate, builds it in release mode and copies it to ",(0,i.jsx)(n.code,{children:"~/.cargo/bin/"}),". To avoid needing to compile and wait, check the ",(0,i.jsx)(n.a,{href:"#fetch-a-pre-compiled-binary-executable",children:"pre-compiled binary section"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"remove-pythonic-devnet",children:"Remove Pythonic Devnet"}),"\n",(0,i.jsxs)(n.p,{children:["If in the past you installed ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet",children:"Pythonic Devnet"}),", be sure to remove it to avoid name collision of the old and the new executable - if by no other means, then by ",(0,i.jsx)(n.code,{children:"rm $(which starknet-devnet)"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"install-from-cratesio",children:"Install from crates.io"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo install starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h3,{id:"install-from-github",children:"Install from GitHub"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Use the ",(0,i.jsx)(n.code,{children:"--locked"})," flag to ensure using the dependencies listed in ",(0,i.jsx)(n.code,{children:"Cargo.lock"})," in the project root."]}),"\n",(0,i.jsxs)(n.li,{children:["Preferably familiarize yourself with the ",(0,i.jsx)(n.code,{children:"cargo install"})," command (",(0,i.jsx)(n.a,{href:"https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile",children:"docs"}),")."]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked\n"})}),"\n",(0,i.jsx)(n.h3,{id:"run-the-installed-executable",children:"Run the installed executable"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"cargo install"})," finishes, follow the output in your terminal. If properly configured, you should be able to run Devnet with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h2,{id:"fetch-a-pre-compiled-binary-executable",children:"Fetch a pre-compiled binary executable"}),"\n",(0,i.jsxs)(n.p,{children:["If you want to save time and skip project compilation on installation, since Devnet v0.0.5, the Assets section of each ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-rs/releases",children:"GitHub release"})," contains a set of platform-specific pre-compiled binary executables. Extract and run with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ curl https://github.com/0xSpaceShard/starknet-devnet-rs/releases/download// | tar -xvzf -C \n$ /starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h2,{id:"run-from-source",children:"Run from source"}),"\n",(0,i.jsxs)(n.p,{children:["To install the project from source, after ",(0,i.jsx)(n.a,{href:"https://github.com/git-guides/git-clone",children:"git-cloning"})," the ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-rs",children:"Devnet repository"}),", running the following command will install, build and start Devnet:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run\n"})}),"\n",(0,i.jsx)(n.p,{children:"Specify optional CLI params like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run -- [ARGS]\n"})}),"\n",(0,i.jsx)(n.p,{children:"For a more optimized performance (though with a longer compilation time), run:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run --release\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var i=t(6540);const r={},l=i.createContext(r);function s(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8d981dc3.5d6a3cde.js b/assets/js/8d981dc3.5d6a3cde.js new file mode 100644 index 000000000..2276efa58 --- /dev/null +++ b/assets/js/8d981dc3.5d6a3cde.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6017],{9823:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>d,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var c=t(4848),a=t(8453);const s={},d="Account balance",o={id:"balance",title:"Account balance",description:"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.",source:"@site/versioned_docs/version-0.0.7/balance.md",sourceDirName:".",slug:"/balance",permalink:"/starknet-devnet-rs/docs/0.0.7/balance",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/balance.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"API",permalink:"/starknet-devnet-rs/docs/0.0.7/api"},next:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/0.0.7/blocks"}},r={},i=[{value:"Mint token - Local faucet",id:"mint-token---local-faucet",level:2},{value:"Check balance",id:"check-balance",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.h1,{id:"account-balance",children:"Account balance"}),"\n",(0,c.jsx)(n.p,{children:"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself."}),"\n",(0,c.jsx)(n.p,{children:"Separate tokens use separate ERC20 contracts for minting and charging fees. These are the token contracts predeployed by Devnet and the addresses where they are located:"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["ETH: ",(0,c.jsx)(n.code,{children:"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"})]}),"\n",(0,c.jsxs)(n.li,{children:["STRK: ",(0,c.jsx)(n.code,{children:"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"})]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"mint-token---local-faucet",children:"Mint token - Local faucet"}),"\n",(0,c.jsxs)(n.p,{children:["By sending a ",(0,c.jsx)(n.code,{children:"POST"})," request to ",(0,c.jsx)(n.code,{children:"/mint"})," for a token, you initiate a transaction on that token's ERC20 contract. The response contains the hash of this transaction, as well as the new balance after minting. The token is specified by providing the unit, and defaults to ",(0,c.jsx)(n.code,{children:"WEI"}),"."]}),"\n",(0,c.jsxs)(n.p,{children:["The value of ",(0,c.jsx)(n.code,{children:"amount"})," is in WEI and needs to be an integer (or a float whose fractional part is 0, e.g. ",(0,c.jsx)(n.code,{children:"1000.0"})," or ",(0,c.jsx)(n.code,{children:"1e21"}),")"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'POST /mint\n{\n "address": "0x6e3205f...",\n "amount": 500000,\n "unit": "WEI" | "FRI"\n}\n'})}),"\n",(0,c.jsx)(n.p,{children:"Response:"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'{\n "new_balance": 500000,\n "unit": "WEI" | "FRI",\n "tx_hash": "0xa24f23..."\n}\n'})}),"\n",(0,c.jsx)(n.h2,{id:"check-balance",children:"Check balance"}),"\n",(0,c.jsxs)(n.p,{children:["Check the balance of an address by sending a ",(0,c.jsx)(n.code,{children:"GET"})," request to ",(0,c.jsx)(n.code,{children:"/account_balance"}),". The address should be a 0x-prefixed hex string; ",(0,c.jsx)(n.code,{children:"unit"})," defaults to ",(0,c.jsx)(n.code,{children:"WEI"})," and ",(0,c.jsx)(n.code,{children:"block_tag"})," to ",(0,c.jsx)(n.code,{children:"latest"}),"."]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:"GET /account_balance?address=
[&unit=][&block_tag=]\n"})})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>o});var c=t(6540);const a={},s=c.createContext(a);function d(e){const n=c.useContext(s);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:d(e.components),c.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8d981dc3.77fdfc67.js b/assets/js/8d981dc3.77fdfc67.js deleted file mode 100644 index 56a21416c..000000000 --- a/assets/js/8d981dc3.77fdfc67.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6017],{9823:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>d,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var c=t(4848),a=t(8453);const s={},d="Account balance",o={id:"balance",title:"Account balance",description:"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.",source:"@site/versioned_docs/version-0.0.7/balance.md",sourceDirName:".",slug:"/balance",permalink:"/starknet-devnet-rs/docs/balance",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/balance.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"API",permalink:"/starknet-devnet-rs/docs/api"},next:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/blocks"}},r={},i=[{value:"Mint token - Local faucet",id:"mint-token---local-faucet",level:2},{value:"Check balance",id:"check-balance",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.h1,{id:"account-balance",children:"Account balance"}),"\n",(0,c.jsx)(n.p,{children:"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself."}),"\n",(0,c.jsx)(n.p,{children:"Separate tokens use separate ERC20 contracts for minting and charging fees. These are the token contracts predeployed by Devnet and the addresses where they are located:"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["ETH: ",(0,c.jsx)(n.code,{children:"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"})]}),"\n",(0,c.jsxs)(n.li,{children:["STRK: ",(0,c.jsx)(n.code,{children:"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"})]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"mint-token---local-faucet",children:"Mint token - Local faucet"}),"\n",(0,c.jsxs)(n.p,{children:["By sending a ",(0,c.jsx)(n.code,{children:"POST"})," request to ",(0,c.jsx)(n.code,{children:"/mint"})," for a token, you initiate a transaction on that token's ERC20 contract. The response contains the hash of this transaction, as well as the new balance after minting. The token is specified by providing the unit, and defaults to ",(0,c.jsx)(n.code,{children:"WEI"}),"."]}),"\n",(0,c.jsxs)(n.p,{children:["The value of ",(0,c.jsx)(n.code,{children:"amount"})," is in WEI and needs to be an integer (or a float whose fractional part is 0, e.g. ",(0,c.jsx)(n.code,{children:"1000.0"})," or ",(0,c.jsx)(n.code,{children:"1e21"}),")"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'POST /mint\n{\n "address": "0x6e3205f...",\n "amount": 500000,\n "unit": "WEI" | "FRI"\n}\n'})}),"\n",(0,c.jsx)(n.p,{children:"Response:"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:'{\n "new_balance": 500000,\n "unit": "WEI" | "FRI",\n "tx_hash": "0xa24f23..."\n}\n'})}),"\n",(0,c.jsx)(n.h2,{id:"check-balance",children:"Check balance"}),"\n",(0,c.jsxs)(n.p,{children:["Check the balance of an address by sending a ",(0,c.jsx)(n.code,{children:"GET"})," request to ",(0,c.jsx)(n.code,{children:"/account_balance"}),". The address should be a 0x-prefixed hex string; ",(0,c.jsx)(n.code,{children:"unit"})," defaults to ",(0,c.jsx)(n.code,{children:"WEI"})," and ",(0,c.jsx)(n.code,{children:"block_tag"})," to ",(0,c.jsx)(n.code,{children:"latest"}),"."]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:"GET /account_balance?address=
[&unit=][&block_tag=]\n"})})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>o});var c=t(6540);const a={},s=c.createContext(a);function d(e){const n=c.useContext(s);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:d(e.components),c.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8e76450a.457a0c79.js b/assets/js/8e76450a.457a0c79.js new file mode 100644 index 000000000..3a3053f69 --- /dev/null +++ b/assets/js/8e76450a.457a0c79.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1437],{8287:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"0.0.7","label":"0.0.7","banner":"unmaintained","badge":true,"noIndex":false,"className":"docs-version-0.0.7","isLast":false,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/0.0.7/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/0.0.7/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/0.0.7/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/0.0.7/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/0.0.7/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/0.0.7/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/0.0.7/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/0.0.7/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/0.0.7/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/0.0.7/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/0.0.7/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/0.0.7/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/0.0.7/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/0.0.7/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/0.0.7/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/0.0.7/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/0.0.7/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Configure your Devnet instance by specifying CLI parameters on startup.","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"To read generally about ways to configure your Devnet instance, check out the CLI section.","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/9c3aeb12.75ce2603.js b/assets/js/93f3c2aa.4d83389b.js similarity index 91% rename from assets/js/9c3aeb12.75ce2603.js rename to assets/js/93f3c2aa.4d83389b.js index d1a04e33c..e8efcfa11 100644 --- a/assets/js/9c3aeb12.75ce2603.js +++ b/assets/js/93f3c2aa.4d83389b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1475],{8423:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=n(4848),s=n(8453);const o={},r="Lite mode",d={id:"lite",title:"Lite mode",description:"To run Devnet in a minimal lite mode, provide the flag:",source:"@site/versioned_docs/version-0.0.7/lite.md",sourceDirName:".",slug:"/lite",permalink:"/starknet-devnet-rs/docs/lite",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/lite.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/historic-state"},next:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/postman"}},c={},a=[];function l(e){const t={code:"code",h1:"h1",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"lite-mode",children:"Lite mode"}),"\n",(0,i.jsx)(t.p,{children:"To run Devnet in a minimal lite mode, provide the flag:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"$ starknet-devnet --lite-mode\n"})}),"\n",(0,i.jsx)(t.p,{children:"Steps skipped in lite mode:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"calculating block hash"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This is useful if your use-case doesn't need the functionalities above."}),"\n",(0,i.jsx)(t.p,{children:"The extent of what is affected by lite mode may be expanded in the future."})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(6540);const s={},o=i.createContext(s);function r(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4291],{2640:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=n(4848),s=n(8453);const o={},r="Lite mode",d={id:"lite",title:"Lite mode",description:"To run Devnet in a minimal lite mode, provide the flag:",source:"@site/versioned_docs/version-0.1.1/lite.md",sourceDirName:".",slug:"/lite",permalink:"/starknet-devnet-rs/docs/lite",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/lite.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/historic-state"},next:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/postman"}},c={},a=[];function l(e){const t={code:"code",h1:"h1",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"lite-mode",children:"Lite mode"}),"\n",(0,i.jsx)(t.p,{children:"To run Devnet in a minimal lite mode, provide the flag:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"$ starknet-devnet --lite-mode\n"})}),"\n",(0,i.jsx)(t.p,{children:"Steps skipped in lite mode:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"calculating block hash"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This is useful if your use-case doesn't need the functionalities above."}),"\n",(0,i.jsx)(t.p,{children:"The extent of what is affected by lite mode may be expanded in the future."})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(6540);const s={},o=i.createContext(s);function r(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9875b4b5.9ea44d6b.js b/assets/js/9875b4b5.9ea44d6b.js new file mode 100644 index 000000000..c397bd5dd --- /dev/null +++ b/assets/js/9875b4b5.9ea44d6b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9629],{2480:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>i});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",a={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/versioned_docs/version-0.0.7/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/0.0.7/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/predeployed.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/0.0.7/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/0.0.7/server-config"}},d={},i=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:["If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use ",(0,o.jsx)(n.a,{href:"./forking",children:"forking"}),". Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release."]}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet."]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9abfa349.32a724b9.js b/assets/js/9abfa349.32a724b9.js deleted file mode 100644 index 5e1d3e3a6..000000000 --- a/assets/js/9abfa349.32a724b9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2408],{8521:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>b,frontMatter:()=>s,metadata:()=>a,toc:()=>i});var o=t(4848),c=t(8453);const s={},r="Blocks",a={id:"blocks",title:"Blocks",description:"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one.",source:"@site/versioned_docs/version-0.0.7/blocks.md",sourceDirName:".",slug:"/blocks",permalink:"/starknet-devnet-rs/docs/blocks",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/blocks.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/balance"},next:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart"}},l={},i=[{value:"Creating blocks on demand",id:"creating-blocks-on-demand",level:2},{value:"Create an empty block",id:"create-an-empty-block",level:2},{value:"Abort blocks",id:"abort-blocks",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"blocks",children:"Blocks"}),"\n",(0,o.jsx)(n.p,{children:"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one."}),"\n",(0,o.jsxs)(n.p,{children:["A new block is generated based on the pending block, once a new block is generated the pending block is restarted. By default, a new block is generated with each new transaction, but you can also ",(0,o.jsx)(n.a,{href:"#create-an-empty-block",children:"create an empty block by yourself"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-demand",children:"Creating blocks on demand"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with the ",(0,o.jsx)(n.code,{children:"--blocks-on-demand"})," CLI option, you will enable the possibility to store more than one transaction in the pending block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"pending"'}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["Once you've added the desired transactions into the pending block, you can send a ",(0,o.jsx)(n.code,{children:"POST"})," request to ",(0,o.jsx)(n.code,{children:"/create_block"}),". This will convert the pending block to the latest block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"latest"'}),"), giving it a block hash and a block number. All subsequent transactions will be stored in a new pending block."]}),"\n",(0,o.jsx)(n.p,{children:"In case of demanding block creation with no pending transactions, a new empty block will be generated."}),"\n",(0,o.jsx)(n.p,{children:"The creation of the genesis block is not affected by this feature."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"{'block_hash': '0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67'}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"create-an-empty-block",children:"Create an empty block"}),"\n",(0,o.jsxs)(n.p,{children:["To create an empty block without transactions, ",(0,o.jsx)(n.code,{children:"POST"})," a request to ",(0,o.jsx)(n.code,{children:"/create_block"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{"block_hash": "0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67"}\n'})}),"\n",(0,o.jsx)(n.h2,{id:"abort-blocks",children:"Abort blocks"}),"\n",(0,o.jsx)(n.p,{children:"This functionality allows simulating block abortion that can occur on mainnet."}),"\n",(0,o.jsx)(n.p,{children:"You can abort blocks and revert transactions from the specified block to the currently latest block. Newly created blocks after the abortion will have accepted status and will continue with numbering where the last accepted block left off."}),"\n",(0,o.jsx)(n.p,{children:"The state of Devnet will be reverted to the state of the last accepted block."}),"\n",(0,o.jsx)(n.p,{children:"E.g. assume there are 3 accepted blocks numbered 1, 2 and 3. Upon receiving a request to abort blocks starting with block 2, the blocks numbered 2 and 3 are aborted and their transactions reverted. The state of network will be as it was in block 1. Once a new block is mined, it will be accepted and it will have number 2."}),"\n",(0,o.jsx)(n.p,{children:"Aborted blocks can only be queried by block hash. Aborting the blocks in forking origin and already aborted blocks is not supported and results in an error."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'POST /abort_blocks\n{\n "starting_block_hash": BLOCK_HASH\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{\n "aborted": [BLOCK_HASH_0, BLOCK_HASH_1, ...]\n}\n'})})]})}function b(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var o=t(6540);const c={},s=o.createContext(c);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9abfa349.620b16d7.js b/assets/js/9abfa349.620b16d7.js new file mode 100644 index 000000000..5566b2b7a --- /dev/null +++ b/assets/js/9abfa349.620b16d7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2408],{8521:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>b,frontMatter:()=>s,metadata:()=>a,toc:()=>i});var o=t(4848),c=t(8453);const s={},r="Blocks",a={id:"blocks",title:"Blocks",description:"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one.",source:"@site/versioned_docs/version-0.0.7/blocks.md",sourceDirName:".",slug:"/blocks",permalink:"/starknet-devnet-rs/docs/0.0.7/blocks",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/blocks.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/0.0.7/balance"},next:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/0.0.7/dump-load-restart"}},l={},i=[{value:"Creating blocks on demand",id:"creating-blocks-on-demand",level:2},{value:"Create an empty block",id:"create-an-empty-block",level:2},{value:"Abort blocks",id:"abort-blocks",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"blocks",children:"Blocks"}),"\n",(0,o.jsx)(n.p,{children:"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one."}),"\n",(0,o.jsxs)(n.p,{children:["A new block is generated based on the pending block, once a new block is generated the pending block is restarted. By default, a new block is generated with each new transaction, but you can also ",(0,o.jsx)(n.a,{href:"#create-an-empty-block",children:"create an empty block by yourself"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-demand",children:"Creating blocks on demand"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with the ",(0,o.jsx)(n.code,{children:"--blocks-on-demand"})," CLI option, you will enable the possibility to store more than one transaction in the pending block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"pending"'}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["Once you've added the desired transactions into the pending block, you can send a ",(0,o.jsx)(n.code,{children:"POST"})," request to ",(0,o.jsx)(n.code,{children:"/create_block"}),". This will convert the pending block to the latest block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"latest"'}),"), giving it a block hash and a block number. All subsequent transactions will be stored in a new pending block."]}),"\n",(0,o.jsx)(n.p,{children:"In case of demanding block creation with no pending transactions, a new empty block will be generated."}),"\n",(0,o.jsx)(n.p,{children:"The creation of the genesis block is not affected by this feature."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"{'block_hash': '0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67'}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"create-an-empty-block",children:"Create an empty block"}),"\n",(0,o.jsxs)(n.p,{children:["To create an empty block without transactions, ",(0,o.jsx)(n.code,{children:"POST"})," a request to ",(0,o.jsx)(n.code,{children:"/create_block"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{"block_hash": "0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67"}\n'})}),"\n",(0,o.jsx)(n.h2,{id:"abort-blocks",children:"Abort blocks"}),"\n",(0,o.jsx)(n.p,{children:"This functionality allows simulating block abortion that can occur on mainnet."}),"\n",(0,o.jsx)(n.p,{children:"You can abort blocks and revert transactions from the specified block to the currently latest block. Newly created blocks after the abortion will have accepted status and will continue with numbering where the last accepted block left off."}),"\n",(0,o.jsx)(n.p,{children:"The state of Devnet will be reverted to the state of the last accepted block."}),"\n",(0,o.jsx)(n.p,{children:"E.g. assume there are 3 accepted blocks numbered 1, 2 and 3. Upon receiving a request to abort blocks starting with block 2, the blocks numbered 2 and 3 are aborted and their transactions reverted. The state of network will be as it was in block 1. Once a new block is mined, it will be accepted and it will have number 2."}),"\n",(0,o.jsx)(n.p,{children:"Aborted blocks can only be queried by block hash. Aborting the blocks in forking origin and already aborted blocks is not supported and results in an error."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'POST /abort_blocks\n{\n "starting_block_hash": BLOCK_HASH\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{\n "aborted": [BLOCK_HASH_0, BLOCK_HASH_1, ...]\n}\n'})})]})}function b(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var o=t(6540);const c={},s=o.createContext(c);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9b932233.10ce9365.js b/assets/js/9b932233.10ce9365.js deleted file mode 100644 index 32a2b1893..000000000 --- a/assets/js/9b932233.10ce9365.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5624],{8938:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var n=s(4848),r=s(8453);const o={},i="Historic state support",a={id:"historic-state",title:"Historic state support",description:"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.",source:"@site/versioned_docs/version-0.0.7/historic-state.md",sourceDirName:".",slug:"/historic-state",permalink:"/starknet-devnet-rs/docs/historic-state",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/historic-state.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Forking",permalink:"/starknet-devnet-rs/docs/forking"},next:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/lite"}},c={},l=[];function d(e){const t={code:"code",h1:"h1",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"historic-state-support",children:"Historic state support"}),"\n",(0,n.jsxs)(t.p,{children:["With state archive capacity set to ",(0,n.jsx)(t.code,{children:"full"}),", Devnet will store full state history, enabling its querying by block hash or number. The default mode is ",(0,n.jsx)(t.code,{children:"none"}),", where no old states are stored and only the latest is available for querying."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:"$ starknet-devnet --state-archive-capacity \n"})}),"\n",(0,n.jsxs)(t.p,{children:["All RPC endpoints that support querying the state at an old (non-latest) block only work with state archive capacity set to ",(0,n.jsx)(t.code,{children:"full"}),"."]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>i,x:()=>a});var n=s(6540);const r={},o=n.createContext(r);function i(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9b932233.211be870.js b/assets/js/9b932233.211be870.js new file mode 100644 index 000000000..6184528da --- /dev/null +++ b/assets/js/9b932233.211be870.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5624],{8938:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var n=s(4848),r=s(8453);const o={},i="Historic state support",a={id:"historic-state",title:"Historic state support",description:"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.",source:"@site/versioned_docs/version-0.0.7/historic-state.md",sourceDirName:".",slug:"/historic-state",permalink:"/starknet-devnet-rs/docs/0.0.7/historic-state",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/historic-state.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Forking",permalink:"/starknet-devnet-rs/docs/0.0.7/forking"},next:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/0.0.7/lite"}},c={},l=[];function d(e){const t={code:"code",h1:"h1",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"historic-state-support",children:"Historic state support"}),"\n",(0,n.jsxs)(t.p,{children:["With state archive capacity set to ",(0,n.jsx)(t.code,{children:"full"}),", Devnet will store full state history, enabling its querying by block hash or number. The default mode is ",(0,n.jsx)(t.code,{children:"none"}),", where no old states are stored and only the latest is available for querying."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:"$ starknet-devnet --state-archive-capacity \n"})}),"\n",(0,n.jsxs)(t.p,{children:["All RPC endpoints that support querying the state at an old (non-latest) block only work with state archive capacity set to ",(0,n.jsx)(t.code,{children:"full"}),"."]})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>i,x:()=>a});var n=s(6540);const r={},o=n.createContext(r);function i(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9c3aeb12.2ff5ffe7.js b/assets/js/9c3aeb12.2ff5ffe7.js new file mode 100644 index 000000000..546bb85cb --- /dev/null +++ b/assets/js/9c3aeb12.2ff5ffe7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1475],{8423:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>a});var i=n(4848),s=n(8453);const o={},r="Lite mode",d={id:"lite",title:"Lite mode",description:"To run Devnet in a minimal lite mode, provide the flag:",source:"@site/versioned_docs/version-0.0.7/lite.md",sourceDirName:".",slug:"/lite",permalink:"/starknet-devnet-rs/docs/0.0.7/lite",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/lite.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/0.0.7/historic-state"},next:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/0.0.7/postman"}},c={},a=[];function l(e){const t={code:"code",h1:"h1",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"lite-mode",children:"Lite mode"}),"\n",(0,i.jsx)(t.p,{children:"To run Devnet in a minimal lite mode, provide the flag:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"$ starknet-devnet --lite-mode\n"})}),"\n",(0,i.jsx)(t.p,{children:"Steps skipped in lite mode:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"calculating block hash"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This is useful if your use-case doesn't need the functionalities above."}),"\n",(0,i.jsx)(t.p,{children:"The extent of what is affected by lite mode may be expanded in the future."})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(6540);const s={},o=i.createContext(s);function r(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5985dcf4.49afb06c.js b/assets/js/a56dc942.4c23731e.js similarity index 97% rename from assets/js/5985dcf4.49afb06c.js rename to assets/js/a56dc942.4c23731e.js index 1752a57cc..9d2348034 100644 --- a/assets/js/5985dcf4.49afb06c.js +++ b/assets/js/a56dc942.4c23731e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7969],{6127:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=s(4848),t=s(8453);const i={sidebar_position:2.2},o="Run with Docker",d={id:"running/docker",title:"Run with Docker",description:"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:",source:"@site/versioned_docs/version-0.0.7/running/docker.md",sourceDirName:"running",slug:"/running/docker",permalink:"/starknet-devnet-rs/docs/running/docker",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/running/docker.md",tags:[],version:"0.0.7",sidebarPosition:2.2,frontMatter:{sidebar_position:2.2},sidebar:"docSidebar",previous:{title:"Install and run",permalink:"/starknet-devnet-rs/docs/running/install"},next:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/running/cli"}},a={},l=[{value:"Docker image tags",id:"docker-image-tags",level:3},{value:"Container port publishing",id:"container-port-publishing",level:3},{value:"Linux",id:"linux",level:4},{value:"Mac and Windows",id:"mac-and-windows",level:4},{value:"Development note",id:"development-note",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"run-with-docker",children:"Run with Docker"}),"\n",(0,r.jsxs)(n.p,{children:["Devnet is available as a Docker image (",(0,r.jsx)(n.a,{href:"https://hub.docker.com/r/shardlabs/starknet-devnet-rs/",children:"Docker Hub link"}),"). To download the ",(0,r.jsx)(n.code,{children:"latest"})," image, run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker pull shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsx)(n.p,{children:"Supported platforms: linux/amd64 and linux/arm64 (also executable on darwin/arm64)."}),"\n",(0,r.jsxs)(n.p,{children:["Running a container is done like this (see ",(0,r.jsx)(n.a,{href:"#container-port-publishing",children:"port publishing"})," for more info):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs [OPTIONS]\n"})}),"\n",(0,r.jsx)(n.h3,{id:"docker-image-tags",children:"Docker image tags"}),"\n",(0,r.jsx)(n.p,{children:"All of the versions published on crates.io for starknet-devnet are available as docker images, which can be used via:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"latest"})," docker image tag corresponds to the last published version on crates.io."]})}),"\n",(0,r.jsxs)(n.p,{children:["Commits to the ",(0,r.jsx)(n.code,{children:"main"})," branch of this repository are mostly available as images tagged with their commit hash (the full 40-lowercase-hex-digits SHA1 digest):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By appending the ",(0,r.jsx)(n.code,{children:"-seed0"})," suffix, you can use images which ",(0,r.jsx)(n.a,{href:"../predeployed",children:"predeploy funded accounts"})," with ",(0,r.jsx)(n.code,{children:"--seed 0"}),", thus always predeploying the same set of accounts:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:-seed0\n$ docker pull shardlabs/starknet-devnet-rs:latest-seed0\n"})}),"\n",(0,r.jsx)(n.h3,{id:"container-port-publishing",children:"Container port publishing"}),"\n",(0,r.jsx)(n.h4,{id:"linux",children:"Linux"}),"\n",(0,r.jsxs)(n.p,{children:["If on a Linux host machine, you can use ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/network/host/",children:(0,r.jsx)(n.code,{children:"--network host"})}),". This way, the port used internally by the container is also available on your host machine. The ",(0,r.jsx)(n.code,{children:"--port"})," option can be used (as well as other CLI options)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run --network host shardlabs/starknet-devnet-rs [--port ]\n"})}),"\n",(0,r.jsx)(n.h4,{id:"mac-and-windows",children:"Mac and Windows"}),"\n",(0,r.jsxs)(n.p,{children:["If not on Linux, you need to publish the container's internally used port to a desired ",(0,r.jsx)(n.code,{children:""})," on your host machine. The internal port is ",(0,r.jsx)(n.code,{children:"5050"})," by default (probably not your concern, but can be overridden with ",(0,r.jsx)(n.code,{children:"--port"}),")."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["E.g. if you want to use your host machine's ",(0,r.jsx)(n.code,{children:"127.0.0.1:5050"}),", you need to run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p 127.0.0.1:5050:5050 shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You may ignore any address-related output logged on container startup (e.g. ",(0,r.jsx)(n.code,{children:"Starknet Devnet listening on 0.0.0.0:5050"}),"). What you will use is what you specified with the ",(0,r.jsx)(n.code,{children:"-p"})," argument."]}),"\n",(0,r.jsxs)(n.p,{children:["If you don't specify the ",(0,r.jsx)(n.code,{children:"HOST"})," part, the server will indeed be available on all of your host machine's addresses (localhost, local network IP, etc.), which may present a security issue if you don't want anyone from the local network to access your Devnet instance."]}),"\n",(0,r.jsx)(n.h3,{id:"development-note",children:"Development note"}),"\n",(0,r.jsx)(n.p,{children:"Due to internal needs, images with arch suffix are built and pushed to Docker Hub, but this is not mentioned in the user docs as users should NOT be needing it."}),"\n",(0,r.jsxs)(n.p,{children:["This is what happens under the hood on ",(0,r.jsx)(n.code,{children:"main"}),":"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["build ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs--amd"})]}),"\n",(0,r.jsxs)(n.li,{children:["build ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs--arm"})]}),"\n",(0,r.jsxs)(n.li,{children:["create and push joint docker manifest called ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs-"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["same for ",(0,r.jsx)(n.code,{children:"latest"})]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>d});var r=s(6540);const t={},i=r.createContext(t);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7817],{3024:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=s(4848),t=s(8453);const i={sidebar_position:2.2},o="Run with Docker",d={id:"running/docker",title:"Run with Docker",description:"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:",source:"@site/versioned_docs/version-0.1.1/running/docker.md",sourceDirName:"running",slug:"/running/docker",permalink:"/starknet-devnet-rs/docs/running/docker",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/running/docker.md",tags:[],version:"0.1.1",sidebarPosition:2.2,frontMatter:{sidebar_position:2.2},sidebar:"docSidebar",previous:{title:"Install and run",permalink:"/starknet-devnet-rs/docs/running/install"},next:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/running/cli"}},a={},l=[{value:"Docker image tags",id:"docker-image-tags",level:3},{value:"Container port publishing",id:"container-port-publishing",level:3},{value:"Linux",id:"linux",level:4},{value:"Mac and Windows",id:"mac-and-windows",level:4},{value:"Development note",id:"development-note",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"run-with-docker",children:"Run with Docker"}),"\n",(0,r.jsxs)(n.p,{children:["Devnet is available as a Docker image (",(0,r.jsx)(n.a,{href:"https://hub.docker.com/r/shardlabs/starknet-devnet-rs/",children:"Docker Hub link"}),"). To download the ",(0,r.jsx)(n.code,{children:"latest"})," image, run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker pull shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsx)(n.p,{children:"Supported platforms: linux/amd64 and linux/arm64 (also executable on darwin/arm64)."}),"\n",(0,r.jsxs)(n.p,{children:["Running a container is done like this (see ",(0,r.jsx)(n.a,{href:"#container-port-publishing",children:"port publishing"})," for more info):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs [OPTIONS]\n"})}),"\n",(0,r.jsx)(n.h3,{id:"docker-image-tags",children:"Docker image tags"}),"\n",(0,r.jsx)(n.p,{children:"All of the versions published on crates.io for starknet-devnet are available as docker images, which can be used via:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"latest"})," docker image tag corresponds to the last published version on crates.io."]})}),"\n",(0,r.jsxs)(n.p,{children:["Commits to the ",(0,r.jsx)(n.code,{children:"main"})," branch of this repository are mostly available as images tagged with their commit hash (the full 40-lowercase-hex-digits SHA1 digest):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By appending the ",(0,r.jsx)(n.code,{children:"-seed0"})," suffix, you can use images which ",(0,r.jsx)(n.a,{href:"../predeployed",children:"predeploy funded accounts"})," with ",(0,r.jsx)(n.code,{children:"--seed 0"}),", thus always predeploying the same set of accounts:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker pull shardlabs/starknet-devnet-rs:-seed0\n$ docker pull shardlabs/starknet-devnet-rs:latest-seed0\n"})}),"\n",(0,r.jsx)(n.h3,{id:"container-port-publishing",children:"Container port publishing"}),"\n",(0,r.jsx)(n.h4,{id:"linux",children:"Linux"}),"\n",(0,r.jsxs)(n.p,{children:["If on a Linux host machine, you can use ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/network/host/",children:(0,r.jsx)(n.code,{children:"--network host"})}),". This way, the port used internally by the container is also available on your host machine. The ",(0,r.jsx)(n.code,{children:"--port"})," option can be used (as well as other CLI options)."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run --network host shardlabs/starknet-devnet-rs [--port ]\n"})}),"\n",(0,r.jsx)(n.h4,{id:"mac-and-windows",children:"Mac and Windows"}),"\n",(0,r.jsxs)(n.p,{children:["If not on Linux, you need to publish the container's internally used port to a desired ",(0,r.jsx)(n.code,{children:""})," on your host machine. The internal port is ",(0,r.jsx)(n.code,{children:"5050"})," by default (probably not your concern, but can be overridden with ",(0,r.jsx)(n.code,{children:"--port"}),")."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["E.g. if you want to use your host machine's ",(0,r.jsx)(n.code,{children:"127.0.0.1:5050"}),", you need to run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-text",children:"$ docker run -p 127.0.0.1:5050:5050 shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You may ignore any address-related output logged on container startup (e.g. ",(0,r.jsx)(n.code,{children:"Starknet Devnet listening on 0.0.0.0:5050"}),"). What you will use is what you specified with the ",(0,r.jsx)(n.code,{children:"-p"})," argument."]}),"\n",(0,r.jsxs)(n.p,{children:["If you don't specify the ",(0,r.jsx)(n.code,{children:"HOST"})," part, the server will indeed be available on all of your host machine's addresses (localhost, local network IP, etc.), which may present a security issue if you don't want anyone from the local network to access your Devnet instance."]}),"\n",(0,r.jsx)(n.h3,{id:"development-note",children:"Development note"}),"\n",(0,r.jsx)(n.p,{children:"Due to internal needs, images with arch suffix are built and pushed to Docker Hub, but this is not mentioned in the user docs as users should NOT be needing it."}),"\n",(0,r.jsxs)(n.p,{children:["This is what happens under the hood on ",(0,r.jsx)(n.code,{children:"main"}),":"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["build ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs--amd"})]}),"\n",(0,r.jsxs)(n.li,{children:["build ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs--arm"})]}),"\n",(0,r.jsxs)(n.li,{children:["create and push joint docker manifest called ",(0,r.jsx)(n.code,{children:"shardlabs/starknet-devnet-rs-"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["same for ",(0,r.jsx)(n.code,{children:"latest"})]}),"\n"]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>d});var r=s(6540);const t={},i=r.createContext(t);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a5ad27b1.a118c206.js b/assets/js/a5ad27b1.a118c206.js deleted file mode 100644 index 960d26d7d..000000000 --- a/assets/js/a5ad27b1.a118c206.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5120],{6989:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>l});var d=t(4848),r=t(8453);const s={},i="Dump, load, restart",o={id:"dump-load-restart",title:"Dump, load, restart",description:"Dumping",source:"@site/docs/dump-load-restart.md",sourceDirName:".",slug:"/dump-load-restart",permalink:"/starknet-devnet-rs/docs/next/dump-load-restart",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/dump-load-restart.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/next/blocks"},next:{title:"Forking",permalink:"/starknet-devnet-rs/docs/next/forking"}},a={},l=[{value:"Dumping",id:"dumping",level:2},{value:"Loading",id:"loading",level:2},{value:"Loading disclaimer",id:"loading-disclaimer",level:3},{value:"Restarting",id:"restarting",level:2},{value:"Docker",id:"docker",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h1,{id:"dump-load-restart",children:"Dump, load, restart"}),"\n",(0,d.jsx)(n.h2,{id:"dumping",children:"Dumping"}),"\n",(0,d.jsx)(n.p,{children:"To preserve your Devnet instance for future use, these are the options:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Dumping on exit (handles Ctrl+C, i.e. SIGINT; doesn't handle SIGKILL):"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-on exit --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Dumping after each block:"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-on block --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Dumping on request requires providing --dump-on mode on the startup. Example usage in ",(0,d.jsx)(n.code,{children:"exit"})," mode (replace ",(0,d.jsx)(n.code,{children:""}),", ",(0,d.jsx)(n.code,{children:""})," and ",(0,d.jsx)(n.code,{children:""})," with your own):"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'$ starknet-devnet --dump-on exit --dump-path \n$ curl -X POST http://:/dump -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_dump",\n "params": {\n "path": PATH\n }\n}\n'})}),"\n",(0,d.jsx)(n.h2,{id:"loading",children:"Loading"}),"\n",(0,d.jsx)(n.p,{children:"To load a preserved Devnet instance, the options are:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Loading on startup (note the argument name is not ",(0,d.jsx)(n.code,{children:"--load-path"})," as it was in Devnet-py):"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Loading on request:"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'curl -X POST http://:/load -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_load",\n "params": {\n "path": PATH\n }\n}\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Currently, dumping produces a list of received transactions that is stored on disk. Conversely, loading is implemented as the re-execution of transactions from a dump. This means that timestamps of ",(0,d.jsx)(n.code,{children:"StarknetBlock"})," will be different on each load."]}),"\n",(0,d.jsx)(n.h3,{id:"loading-disclaimer",children:"Loading disclaimer"}),"\n",(0,d.jsx)(n.p,{children:"Dumping and loading are not guaranteed to work across versions. I.e. if you dumped one version of Devnet, do not expect it to be loadable with a different version."}),"\n",(0,d.jsxs)(n.p,{children:["If you dumped a Devnet utilizing one class for account predeployment (e.g. ",(0,d.jsx)(n.code,{children:"--account-class cairo0"}),"), you should use the same option when loading. The same applies for dumping a Devnet in ",(0,d.jsx)(n.code,{children:"--block-generation-on demand"})," mode."]}),"\n",(0,d.jsx)(n.h2,{id:"restarting",children:"Restarting"}),"\n",(0,d.jsxs)(n.p,{children:["Devnet can be restarted by making a ",(0,d.jsx)(n.code,{children:"POST /restart"})," request (no body required) or ",(0,d.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,d.jsx)(n.code,{children:"devnet_restart"}),". All of the deployed contracts (including predeployed), blocks and storage updates will be restarted to the original state, without the transactions and requests that may have been loaded from a dump file on startup."]}),"\n",(0,d.jsxs)(n.p,{children:["If you're using ",(0,d.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-plugin#restart",children:(0,d.jsx)(n.strong,{children:"the Hardhat plugin"})}),", restart with ",(0,d.jsx)(n.code,{children:"starknet.devnet.restart()"}),"."]}),"\n",(0,d.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,d.jsx)(n.p,{children:"To enable dumping and loading with dockerized Devnet, you must bind the container path to the path on your host machine."}),"\n",(0,d.jsx)(n.p,{children:"This example:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Relies on ",(0,d.jsx)(n.a,{href:"https://docs.docker.com/storage/bind-mounts/",children:"Docker bind mount"}),"; try ",(0,d.jsx)(n.a,{href:"https://docs.docker.com/storage/volumes/",children:"Docker volume"})," instead."]}),"\n",(0,d.jsxs)(n.li,{children:["Assumes that ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir"})," exists. If unsure, use absolute paths."]}),"\n",(0,d.jsxs)(n.li,{children:["Assumes you are listening on ",(0,d.jsx)(n.code,{children:"127.0.0.1:5050"}),"."]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["If there is ",(0,d.jsx)(n.code,{children:"mydump"})," inside ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir"}),", you can load it with:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-path /path/to/dumpdir/mydump\n"})}),"\n",(0,d.jsxs)(n.p,{children:["To dump to ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir/mydump"})," on Devnet shutdown, run:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-on exit --dump-path /path/to/dumpdir/mydump\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>o});var d=t(6540);const r={},s=d.createContext(r);function i(e){const n=d.useContext(s);return d.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),d.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a5ad27b1.a362d764.js b/assets/js/a5ad27b1.a362d764.js new file mode 100644 index 000000000..83410a232 --- /dev/null +++ b/assets/js/a5ad27b1.a362d764.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5120],{6989:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var d=t(4848),r=t(8453);const s={},o="Dump, load, restart",i={id:"dump-load-restart",title:"Dump, load, restart",description:"Dumping",source:"@site/docs/dump-load-restart.md",sourceDirName:".",slug:"/dump-load-restart",permalink:"/starknet-devnet-rs/docs/next/dump-load-restart",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/dump-load-restart.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/next/blocks"},next:{title:"Forking",permalink:"/starknet-devnet-rs/docs/next/forking"}},a={},l=[{value:"Dumping",id:"dumping",level:2},{value:"Loading",id:"loading",level:2},{value:"Loading disclaimer",id:"loading-disclaimer",level:3},{value:"Restarting",id:"restarting",level:2},{value:"Docker",id:"docker",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h1,{id:"dump-load-restart",children:"Dump, load, restart"}),"\n",(0,d.jsx)(n.h2,{id:"dumping",children:"Dumping"}),"\n",(0,d.jsx)(n.p,{children:"To preserve your Devnet instance for future use, these are the options:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Dumping on exit (handles Ctrl+C, i.e. SIGINT; doesn't handle SIGKILL):"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-on exit --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Dumping after each block:"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-on block --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Dumping on request requires providing --dump-on mode on the startup. Example usage in ",(0,d.jsx)(n.code,{children:"exit"})," mode (replace ",(0,d.jsx)(n.code,{children:""}),", ",(0,d.jsx)(n.code,{children:""})," and ",(0,d.jsx)(n.code,{children:""})," with your own):"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'$ starknet-devnet --dump-on exit --dump-path \n$ curl -X POST http://:/dump -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_dump",\n "params": {\n "path": PATH\n }\n}\n'})}),"\n",(0,d.jsx)(n.h2,{id:"loading",children:"Loading"}),"\n",(0,d.jsx)(n.p,{children:"To load a preserved Devnet instance, the options are:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Loading on startup (note the argument name is not ",(0,d.jsx)(n.code,{children:"--load-path"})," as it was in Devnet-py):"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Loading on request:"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'curl -X POST http://:/load -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_load",\n "params": {\n "path": PATH\n }\n}\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Currently, dumping produces a list of received transactions that is stored on disk. Conversely, loading is implemented as the re-execution of transactions from a dump. This means that timestamps of ",(0,d.jsx)(n.code,{children:"StarknetBlock"})," will be different on each load."]}),"\n",(0,d.jsx)(n.h3,{id:"loading-disclaimer",children:"Loading disclaimer"}),"\n",(0,d.jsx)(n.p,{children:"Dumping and loading are not guaranteed to work across versions. I.e. if you dumped one version of Devnet, do not expect it to be loadable with a different version."}),"\n",(0,d.jsxs)(n.p,{children:["If you dumped a Devnet utilizing one class for account predeployment (e.g. ",(0,d.jsx)(n.code,{children:"--account-class cairo0"}),"), you should use the same option when loading. The same applies for dumping a Devnet in ",(0,d.jsx)(n.code,{children:"--block-generation-on demand"})," mode."]}),"\n",(0,d.jsx)(n.h2,{id:"restarting",children:"Restarting"}),"\n",(0,d.jsxs)(n.p,{children:["Devnet can be restarted by making a ",(0,d.jsx)(n.code,{children:"POST /restart"})," request (no body required) or ",(0,d.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,d.jsx)(n.code,{children:"devnet_restart"}),". All of the deployed contracts (including predeployed), blocks and storage updates will be restarted to the original state, without the transactions and requests that may have been loaded from a dump file on startup."]}),"\n",(0,d.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,d.jsx)(n.p,{children:"To enable dumping and loading with dockerized Devnet, you must bind the container path to the path on your host machine."}),"\n",(0,d.jsx)(n.p,{children:"This example:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Relies on ",(0,d.jsx)(n.a,{href:"https://docs.docker.com/storage/bind-mounts/",children:"Docker bind mount"}),"; try ",(0,d.jsx)(n.a,{href:"https://docs.docker.com/storage/volumes/",children:"Docker volume"})," instead."]}),"\n",(0,d.jsxs)(n.li,{children:["Assumes that ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir"})," exists. If unsure, use absolute paths."]}),"\n",(0,d.jsxs)(n.li,{children:["Assumes you are listening on ",(0,d.jsx)(n.code,{children:"127.0.0.1:5050"}),"."]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["If there is ",(0,d.jsx)(n.code,{children:"mydump"})," inside ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir"}),", you can load it with:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-path /path/to/dumpdir/mydump\n"})}),"\n",(0,d.jsxs)(n.p,{children:["To dump to ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir/mydump"})," on Devnet shutdown, run:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-on exit --dump-path /path/to/dumpdir/mydump\n"})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>i});var d=t(6540);const r={},s=d.createContext(r);function o(e){const n=d.useContext(s);return d.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),d.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a5e062ff.5a44be1d.js b/assets/js/a5e062ff.5a44be1d.js new file mode 100644 index 000000000..93d5a9fe9 --- /dev/null +++ b/assets/js/a5e062ff.5a44be1d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3726],{6909:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var t=s(4848),r=s(8453);const a={},o="L1-L2 interaction via Postman",i={id:"postman",title:"L1-L2 interaction via Postman",description:"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.",source:"@site/versioned_docs/version-0.0.7/postman.md",sourceDirName:".",slug:"/postman",permalink:"/starknet-devnet-rs/docs/0.0.7/postman",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/postman.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/0.0.7/lite"},next:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/0.0.7/predeployed"}},d={},c=[{value:"Load",id:"load",level:2},{value:"Flush",id:"flush",level:2},{value:"Disclaimer",id:"disclaimer",level:2},{value:"Mock transactions",id:"mock-transactions",level:2},{value:"L1->L2",id:"l1-l2",level:3},{value:"L2->L1",id:"l2-l1",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"l1-l2-interaction-via-postman",children:"L1-L2 interaction via Postman"}),"\n",(0,t.jsxs)(n.p,{children:["Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, ",(0,t.jsx)(n.a,{href:"#load",children:"load"})," a messaging contract, and ",(0,t.jsx)(n.a,{href:"#flush",children:"flush"})," the queue when needed. You can use ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-plugin",children:(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"starknet-hardhat-plugin"})})})," to perform these actions, as witnessed in ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-example/blob/master/test/postman.test.ts",children:(0,t.jsx)(n.strong,{children:"this example"})}),", or directly send requests to the endpoints specified below."]}),"\n",(0,t.jsx)(n.h2,{id:"load",children:"Load"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/load_l1_messaging_contract\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Loads a ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract. The ",(0,t.jsx)(n.code,{children:"address"})," parameter is optional; if provided, the ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract will be fetched from that address, otherwise a new one will be deployed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"networkUrl"})," is the URL of the JSON-RPC API of the L1 node you've run locally or that already exists; possibilities include, and are not limited to:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/foundry-rs/foundry/tree/master/crates/anvil",children:(0,t.jsx)(n.strong,{children:"Anvil"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://sepolia.etherscan.io/",children:(0,t.jsx)(n.strong,{children:"Sepolia testnet"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/ganache",children:(0,t.jsx)(n.strong,{children:"Ganache"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/ethereum/go-ethereum#docker-quick-start",children:(0,t.jsx)(n.strong,{children:"Geth"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://hardhat.org/hardhat-network/#running-stand-alone-in-order-to-support-wallets-and-other-software",children:(0,t.jsx)(n.strong,{children:"Hardhat node"})})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"flush",children:"Flush"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Goes through the newly enqueued messages, sending them from L1 to L2 and from L2 to L1. Requires no body. Optionally, set the ",(0,t.jsx)(n.code,{children:"dry_run"})," specifier to just see the result of flushing, without actually triggering it:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "dry_run": true }\n'})}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is required if ",(0,t.jsx)(n.code,{children:"dry_run"})," is not set."]}),"\n",(0,t.jsx)(n.h2,{id:"disclaimer",children:"Disclaimer"}),"\n",(0,t.jsxs)(n.p,{children:["This method of L1-L2 communication testing differs from how Starknet mainnet and testnets work. Taking ",(0,t.jsx)(n.a,{href:"https://github.com/MikeSpa/starknet-test/blob/6a68d033cd7ddb5df937154f860f1c06174e6860/L1L2Example.sol#L46",children:(0,t.jsx)(n.strong,{children:"L1L2Example.sol"})})," (originally from Starknet documentation, no longer available there):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(IStarknetCore starknetCore_) public {\n starknetCore = starknetCore_;\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The constructor takes an ",(0,t.jsx)(n.code,{children:"IStarknetCore"})," contract as argument, however for Devnet's L1-L2 communication testing, this has to be replaced with the logic in ",(0,t.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/testing/MockStarknetMessaging.sol",children:(0,t.jsx)(n.strong,{children:"MockStarknetMessaging.sol"})}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(MockStarknetMessaging mockStarknetMessaging_) public {\n starknetCore = mockStarknetMessaging_;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"mock-transactions",children:"Mock transactions"}),"\n",(0,t.jsx)(n.h3,{id:"l1-l2",children:"L1->L2"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L1 to L2 without the need for running L1. Deployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"entry_point_selector"})," must be valid otherwise new block will not be created."]}),"\n",(0,t.jsxs)(n.p,{children:["Normally ",(0,t.jsx)(n.code,{children:"nonce"})," is calculated by L1 StarknetContract and it's used in L1 and L2. In this case, we need to provide it manually."]}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is ",(0,t.jsx)(n.strong,{children:"not"})," required for this operation."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/send_message_to_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "transaction_hash": "0x0548c761a9fd5512782998b2da6f44c42bf78fb88c3794eea330a91c9abb10bb" }\n'})}),"\n",(0,t.jsx)(n.h3,{id:"l2-l1",children:"L2->L1"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L2 to L1.\nDeployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"l1_contract_address"})," must be valid."]}),"\n",(0,t.jsx)(n.p,{children:"A running L1 node is required for this operation."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/consume_message_from_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{"message_hash": "0xae14f241131b524ac8d043d9cb4934253ac5c5589afef19f0d761816a9c7e26d"}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>i});var t=s(6540);const r={},a=t.createContext(r);function o(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a5e062ff.a888e2f6.js b/assets/js/a5e062ff.a888e2f6.js deleted file mode 100644 index 0ee169951..000000000 --- a/assets/js/a5e062ff.a888e2f6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3726],{6909:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var t=s(4848),r=s(8453);const a={},o="L1-L2 interaction via Postman",i={id:"postman",title:"L1-L2 interaction via Postman",description:"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.",source:"@site/versioned_docs/version-0.0.7/postman.md",sourceDirName:".",slug:"/postman",permalink:"/starknet-devnet-rs/docs/postman",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/postman.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/lite"},next:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/predeployed"}},d={},c=[{value:"Load",id:"load",level:2},{value:"Flush",id:"flush",level:2},{value:"Disclaimer",id:"disclaimer",level:2},{value:"Mock transactions",id:"mock-transactions",level:2},{value:"L1->L2",id:"l1-l2",level:3},{value:"L2->L1",id:"l2-l1",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"l1-l2-interaction-via-postman",children:"L1-L2 interaction via Postman"}),"\n",(0,t.jsxs)(n.p,{children:["Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, ",(0,t.jsx)(n.a,{href:"#load",children:"load"})," a messaging contract, and ",(0,t.jsx)(n.a,{href:"#flush",children:"flush"})," the queue when needed. You can use ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-plugin",children:(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"starknet-hardhat-plugin"})})})," to perform these actions, as witnessed in ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-example/blob/master/test/postman.test.ts",children:(0,t.jsx)(n.strong,{children:"this example"})}),", or directly send requests to the endpoints specified below."]}),"\n",(0,t.jsx)(n.h2,{id:"load",children:"Load"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/load_l1_messaging_contract\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Loads a ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract. The ",(0,t.jsx)(n.code,{children:"address"})," parameter is optional; if provided, the ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract will be fetched from that address, otherwise a new one will be deployed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"networkUrl"})," is the URL of the JSON-RPC API of the L1 node you've run locally or that already exists; possibilities include, and are not limited to:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/foundry-rs/foundry/tree/master/crates/anvil",children:(0,t.jsx)(n.strong,{children:"Anvil"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://sepolia.etherscan.io/",children:(0,t.jsx)(n.strong,{children:"Sepolia testnet"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/ganache",children:(0,t.jsx)(n.strong,{children:"Ganache"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/ethereum/go-ethereum#docker-quick-start",children:(0,t.jsx)(n.strong,{children:"Geth"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://hardhat.org/hardhat-network/#running-stand-alone-in-order-to-support-wallets-and-other-software",children:(0,t.jsx)(n.strong,{children:"Hardhat node"})})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"flush",children:"Flush"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Goes through the newly enqueued messages, sending them from L1 to L2 and from L2 to L1. Requires no body. Optionally, set the ",(0,t.jsx)(n.code,{children:"dry_run"})," specifier to just see the result of flushing, without actually triggering it:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "dry_run": true }\n'})}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is required if ",(0,t.jsx)(n.code,{children:"dry_run"})," is not set."]}),"\n",(0,t.jsx)(n.h2,{id:"disclaimer",children:"Disclaimer"}),"\n",(0,t.jsxs)(n.p,{children:["This method of L1-L2 communication testing differs from how Starknet mainnet and testnets work. Taking ",(0,t.jsx)(n.a,{href:"https://github.com/MikeSpa/starknet-test/blob/6a68d033cd7ddb5df937154f860f1c06174e6860/L1L2Example.sol#L46",children:(0,t.jsx)(n.strong,{children:"L1L2Example.sol"})})," (originally from Starknet documentation, no longer available there):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(IStarknetCore starknetCore_) public {\n starknetCore = starknetCore_;\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The constructor takes an ",(0,t.jsx)(n.code,{children:"IStarknetCore"})," contract as argument, however for Devnet's L1-L2 communication testing, this has to be replaced with the logic in ",(0,t.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/testing/MockStarknetMessaging.sol",children:(0,t.jsx)(n.strong,{children:"MockStarknetMessaging.sol"})}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(MockStarknetMessaging mockStarknetMessaging_) public {\n starknetCore = mockStarknetMessaging_;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"mock-transactions",children:"Mock transactions"}),"\n",(0,t.jsx)(n.h3,{id:"l1-l2",children:"L1->L2"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L1 to L2 without the need for running L1. Deployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"entry_point_selector"})," must be valid otherwise new block will not be created."]}),"\n",(0,t.jsxs)(n.p,{children:["Normally ",(0,t.jsx)(n.code,{children:"nonce"})," is calculated by L1 StarknetContract and it's used in L1 and L2. In this case, we need to provide it manually."]}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is ",(0,t.jsx)(n.strong,{children:"not"})," required for this operation."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/send_message_to_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "transaction_hash": "0x0548c761a9fd5512782998b2da6f44c42bf78fb88c3794eea330a91c9abb10bb" }\n'})}),"\n",(0,t.jsx)(n.h3,{id:"l2-l1",children:"L2->L1"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L2 to L1.\nDeployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"l1_contract_address"})," must be valid."]}),"\n",(0,t.jsx)(n.p,{children:"A running L1 node is required for this operation."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/consume_message_from_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{"message_hash": "0xae14f241131b524ac8d043d9cb4934253ac5c5589afef19f0d761816a9c7e26d"}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>i});var t=s(6540);const r={},a=t.createContext(r);function o(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ad6bd692.2d8efa6d.js b/assets/js/ad6bd692.2d8efa6d.js new file mode 100644 index 000000000..8f6e9b08b --- /dev/null +++ b/assets/js/ad6bd692.2d8efa6d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6439],{9552:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>l});var r=t(4848),d=t(8453);const s={},i="Dump, load, restart",o={id:"dump-load-restart",title:"Dump, load, restart",description:"Dumping",source:"@site/versioned_docs/version-0.0.7/dump-load-restart.md",sourceDirName:".",slug:"/dump-load-restart",permalink:"/starknet-devnet-rs/docs/0.0.7/dump-load-restart",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/dump-load-restart.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/0.0.7/blocks"},next:{title:"Forking",permalink:"/starknet-devnet-rs/docs/0.0.7/forking"}},a={},l=[{value:"Dumping",id:"dumping",level:2},{value:"Loading",id:"loading",level:2},{value:"Loading disclaimer",id:"loading-disclaimer",level:3},{value:"Restarting",id:"restarting",level:2},{value:"Docker",id:"docker",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"dump-load-restart",children:"Dump, load, restart"}),"\n",(0,r.jsx)(n.h2,{id:"dumping",children:"Dumping"}),"\n",(0,r.jsx)(n.p,{children:"To preserve your Devnet instance for future use, these are the options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Dumping on exit (handles Ctrl+C, i.e. SIGINT; doesn't handle SIGKILL):"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --dump-on exit --dump-path \n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Dumping after each block:"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --dump-on block --dump-path \n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Dumping on request requires providing --dump-on mode on the startup. Example usage in ",(0,r.jsx)(n.code,{children:"exit"})," mode (replace ",(0,r.jsx)(n.code,{children:""}),", ",(0,r.jsx)(n.code,{children:""})," and ",(0,r.jsx)(n.code,{children:""})," with your own):"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ starknet-devnet --dump-on exit --dump-path \n$ curl -X POST http://:/dump -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,r.jsx)(n.h2,{id:"loading",children:"Loading"}),"\n",(0,r.jsx)(n.p,{children:"To load a preserved Devnet instance, the options are:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Loading on startup (note the argument name is not ",(0,r.jsx)(n.code,{children:"--load-path"})," as it was in Devnet-py):"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --dump-path \n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Loading on request:"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'curl -X POST http://:/load -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["Currently, dumping produces a list of received transactions that is stored on disk. Conversely, loading is implemented as the re-execution of transactions from a dump. This means that timestamps of ",(0,r.jsx)(n.code,{children:"StarknetBlock"})," will be different on each load."]}),"\n",(0,r.jsx)(n.h3,{id:"loading-disclaimer",children:"Loading disclaimer"}),"\n",(0,r.jsx)(n.p,{children:"Dumping and loading are not guaranteed to work across versions. I.e. if you dumped one version of Devnet, do not expect it to be loadable with a different version."}),"\n",(0,r.jsxs)(n.p,{children:["If you dumped a Devnet utilizing one class for account predeployment (e.g. ",(0,r.jsx)(n.code,{children:"--account-class cairo0"}),"), you should use the same option when loading. The same applies for dumping a Devnet in ",(0,r.jsx)(n.code,{children:"--blocks-on-demand"})," mode."]}),"\n",(0,r.jsx)(n.h2,{id:"restarting",children:"Restarting"}),"\n",(0,r.jsxs)(n.p,{children:["Devnet can be restarted by making a ",(0,r.jsx)(n.code,{children:"POST /restart"})," request (no body required). All of the deployed contracts (including predeployed), blocks and storage updates will be restarted to the original state, without the transactions and requests that may have been loaded from a dump file on startup."]}),"\n",(0,r.jsxs)(n.p,{children:["If you're using ",(0,r.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-plugin#restart",children:(0,r.jsx)(n.strong,{children:"the Hardhat plugin"})}),", restart with ",(0,r.jsx)(n.code,{children:"starknet.devnet.restart()"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,r.jsx)(n.p,{children:"To enable dumping and loading with dockerized Devnet, you must bind the container path to the path on your host machine."}),"\n",(0,r.jsx)(n.p,{children:"This example:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Relies on ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/storage/bind-mounts/",children:"Docker bind mount"}),"; try ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/storage/volumes/",children:"Docker volume"})," instead."]}),"\n",(0,r.jsxs)(n.li,{children:["Assumes that ",(0,r.jsx)(n.code,{children:"/path/to/dumpdir"})," exists. If unsure, use absolute paths."]}),"\n",(0,r.jsxs)(n.li,{children:["Assumes you are listening on ",(0,r.jsx)(n.code,{children:"127.0.0.1:5050"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["If there is ",(0,r.jsx)(n.code,{children:"mydump"})," inside ",(0,r.jsx)(n.code,{children:"/path/to/dumpdir"}),", you can load it with:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-path /path/to/dumpdir/mydump\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To dump to ",(0,r.jsx)(n.code,{children:"/path/to/dumpdir/mydump"})," on Devnet shutdown, run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-on exit --dump-path /path/to/dumpdir/mydump\n"})})]})}function h(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>o});var r=t(6540);const d={},s=r.createContext(d);function i(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:i(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ad6bd692.7bc5fb7f.js b/assets/js/ad6bd692.7bc5fb7f.js deleted file mode 100644 index e56acc2c8..000000000 --- a/assets/js/ad6bd692.7bc5fb7f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6439],{9552:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>l});var r=t(4848),d=t(8453);const s={},i="Dump, load, restart",o={id:"dump-load-restart",title:"Dump, load, restart",description:"Dumping",source:"@site/versioned_docs/version-0.0.7/dump-load-restart.md",sourceDirName:".",slug:"/dump-load-restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/dump-load-restart.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/blocks"},next:{title:"Forking",permalink:"/starknet-devnet-rs/docs/forking"}},a={},l=[{value:"Dumping",id:"dumping",level:2},{value:"Loading",id:"loading",level:2},{value:"Loading disclaimer",id:"loading-disclaimer",level:3},{value:"Restarting",id:"restarting",level:2},{value:"Docker",id:"docker",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"dump-load-restart",children:"Dump, load, restart"}),"\n",(0,r.jsx)(n.h2,{id:"dumping",children:"Dumping"}),"\n",(0,r.jsx)(n.p,{children:"To preserve your Devnet instance for future use, these are the options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Dumping on exit (handles Ctrl+C, i.e. SIGINT; doesn't handle SIGKILL):"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --dump-on exit --dump-path \n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Dumping after each block:"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --dump-on block --dump-path \n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Dumping on request requires providing --dump-on mode on the startup. Example usage in ",(0,r.jsx)(n.code,{children:"exit"})," mode (replace ",(0,r.jsx)(n.code,{children:""}),", ",(0,r.jsx)(n.code,{children:""})," and ",(0,r.jsx)(n.code,{children:""})," with your own):"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ starknet-devnet --dump-on exit --dump-path \n$ curl -X POST http://:/dump -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,r.jsx)(n.h2,{id:"loading",children:"Loading"}),"\n",(0,r.jsx)(n.p,{children:"To load a preserved Devnet instance, the options are:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Loading on startup (note the argument name is not ",(0,r.jsx)(n.code,{children:"--load-path"})," as it was in Devnet-py):"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --dump-path \n"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Loading on request:"}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'curl -X POST http://:/load -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["Currently, dumping produces a list of received transactions that is stored on disk. Conversely, loading is implemented as the re-execution of transactions from a dump. This means that timestamps of ",(0,r.jsx)(n.code,{children:"StarknetBlock"})," will be different on each load."]}),"\n",(0,r.jsx)(n.h3,{id:"loading-disclaimer",children:"Loading disclaimer"}),"\n",(0,r.jsx)(n.p,{children:"Dumping and loading are not guaranteed to work across versions. I.e. if you dumped one version of Devnet, do not expect it to be loadable with a different version."}),"\n",(0,r.jsxs)(n.p,{children:["If you dumped a Devnet utilizing one class for account predeployment (e.g. ",(0,r.jsx)(n.code,{children:"--account-class cairo0"}),"), you should use the same option when loading. The same applies for dumping a Devnet in ",(0,r.jsx)(n.code,{children:"--blocks-on-demand"})," mode."]}),"\n",(0,r.jsx)(n.h2,{id:"restarting",children:"Restarting"}),"\n",(0,r.jsxs)(n.p,{children:["Devnet can be restarted by making a ",(0,r.jsx)(n.code,{children:"POST /restart"})," request (no body required). All of the deployed contracts (including predeployed), blocks and storage updates will be restarted to the original state, without the transactions and requests that may have been loaded from a dump file on startup."]}),"\n",(0,r.jsxs)(n.p,{children:["If you're using ",(0,r.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-plugin#restart",children:(0,r.jsx)(n.strong,{children:"the Hardhat plugin"})}),", restart with ",(0,r.jsx)(n.code,{children:"starknet.devnet.restart()"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,r.jsx)(n.p,{children:"To enable dumping and loading with dockerized Devnet, you must bind the container path to the path on your host machine."}),"\n",(0,r.jsx)(n.p,{children:"This example:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Relies on ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/storage/bind-mounts/",children:"Docker bind mount"}),"; try ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/storage/volumes/",children:"Docker volume"})," instead."]}),"\n",(0,r.jsxs)(n.li,{children:["Assumes that ",(0,r.jsx)(n.code,{children:"/path/to/dumpdir"})," exists. If unsure, use absolute paths."]}),"\n",(0,r.jsxs)(n.li,{children:["Assumes you are listening on ",(0,r.jsx)(n.code,{children:"127.0.0.1:5050"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["If there is ",(0,r.jsx)(n.code,{children:"mydump"})," inside ",(0,r.jsx)(n.code,{children:"/path/to/dumpdir"}),", you can load it with:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-path /path/to/dumpdir/mydump\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To dump to ",(0,r.jsx)(n.code,{children:"/path/to/dumpdir/mydump"})," on Devnet shutdown, run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-on exit --dump-path /path/to/dumpdir/mydump\n"})})]})}function h(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>o});var r=t(6540);const d={},s=r.createContext(d);function i(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:i(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b0477c6d.85f3f358.js b/assets/js/b0477c6d.85f3f358.js deleted file mode 100644 index 3b8b70a19..000000000 --- a/assets/js/b0477c6d.85f3f358.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5186],{686:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>s,default:()=>b,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var o=t(4848),c=t(8453);const r={},s="Blocks",a={id:"blocks",title:"Blocks",description:"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one.",source:"@site/docs/blocks.md",sourceDirName:".",slug:"/blocks",permalink:"/starknet-devnet-rs/docs/next/blocks",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/blocks.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/next/balance"},next:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/next/dump-load-restart"}},i={},l=[{value:"Creating blocks on demand",id:"creating-blocks-on-demand",level:2},{value:"Automatic periodic block creation",id:"automatic-periodic-block-creation",level:2},{value:"Create an empty block",id:"create-an-empty-block",level:2},{value:"Abort blocks",id:"abort-blocks",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"blocks",children:"Blocks"}),"\n",(0,o.jsx)(n.p,{children:"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one."}),"\n",(0,o.jsxs)(n.p,{children:["A new block is generated based on the pending block, once a new block is generated the pending block is restarted. By default, a new block is generated with each new transaction, but you can also ",(0,o.jsx)(n.a,{href:"#create-an-empty-block",children:"create an empty block by yourself"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-demand",children:"Creating blocks on demand"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with the ",(0,o.jsx)(n.code,{children:"--block-generation-on demand"})," CLI option, you will enable the possibility to store more than one transaction in the pending block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"pending"'}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["Once you've added the desired transactions into the pending block, you can send a ",(0,o.jsx)(n.code,{children:"POST"})," request to ",(0,o.jsx)(n.code,{children:"/create_block"})," or ",(0,o.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,o.jsx)(n.code,{children:"devnet_createBlock"}),". This will convert the pending block to the latest block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"latest"'}),"), giving it a block hash and a block number. All subsequent transactions will be stored in a new pending block."]}),"\n",(0,o.jsx)(n.p,{children:"In case of demanding block creation with no pending transactions, a new empty block will be generated."}),"\n",(0,o.jsx)(n.p,{children:"The creation of the genesis block is not affected by this feature."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_createBlock"\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"{'block_hash': '0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67'}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"automatic-periodic-block-creation",children:"Automatic periodic block creation"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet started with the ",(0,o.jsx)(n.code,{children:"--block-generation-on "})," CLI option, will behave like in ",(0,o.jsx)(n.code,{children:"demand"})," mode but new blocks will be mined automatically in time intervals."]}),"\n",(0,o.jsx)(n.h2,{id:"create-an-empty-block",children:"Create an empty block"}),"\n",(0,o.jsxs)(n.p,{children:["To create an empty block without transactions, ",(0,o.jsx)(n.code,{children:"POST"})," a request to ",(0,o.jsx)(n.code,{children:"/create_block"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_createBlock"\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{"block_hash": "0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67"}\n'})}),"\n",(0,o.jsx)(n.h2,{id:"abort-blocks",children:"Abort blocks"}),"\n",(0,o.jsxs)(n.p,{children:["This functionality allows simulating block abortion that can occur on mainnet. It is supported in the ",(0,o.jsx)(n.code,{children:"--state-archive-capacity full"})," mode."]}),"\n",(0,o.jsx)(n.p,{children:"You can abort blocks and revert transactions from the specified block to the currently latest block. Newly created blocks after the abortion will have accepted status and will continue with numbering where the last accepted block left off."}),"\n",(0,o.jsx)(n.p,{children:"The state of Devnet will be reverted to the state of the last accepted block."}),"\n",(0,o.jsx)(n.p,{children:"E.g. assume there are 3 accepted blocks numbered 1, 2 and 3. Upon receiving a request to abort blocks starting with block 2, the blocks numbered 2 and 3 are aborted and their transactions reverted. The state of network will be as it was in block 1. Once a new block is mined, it will be accepted and it will have number 2."}),"\n",(0,o.jsx)(n.p,{children:"Aborted blocks can only be queried by block hash. Aborting the blocks in forking origin and already aborted blocks is not supported and results in an error. Aborting of Devnet's genesis block is not supported."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'POST /abort_blocks\n{\n "starting_block_hash": BLOCK_HASH\n}\n'})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_abortBlocks",\n "params": {\n "starting_block_hash": BLOCK_HASH\n }\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{\n "aborted": [BLOCK_HASH_0, BLOCK_HASH_1, ...]\n}\n'})})]})}function b(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b0477c6d.e4f6cf6c.js b/assets/js/b0477c6d.e4f6cf6c.js new file mode 100644 index 000000000..f1df1fec5 --- /dev/null +++ b/assets/js/b0477c6d.e4f6cf6c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5186],{686:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>r,toc:()=>a});var o=t(4848),c=t(8453);const s={},i="Blocks",r={id:"blocks",title:"Blocks",description:"By default, Devnet starts with a genesis block labelled with number zero. In forking mode, the genesis block number is equal to the forked block number plus one.",source:"@site/docs/blocks.md",sourceDirName:".",slug:"/blocks",permalink:"/starknet-devnet-rs/docs/next/blocks",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/blocks.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/next/balance"},next:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/next/dump-load-restart"}},l={},a=[{value:"Creating blocks on transaction",id:"creating-blocks-on-transaction",level:2},{value:"Creating blocks on demand",id:"creating-blocks-on-demand",level:2},{value:"Automatic periodic block creation",id:"automatic-periodic-block-creation",level:2},{value:"Request new block creation",id:"request-new-block-creation",level:2},{value:"Abort blocks",id:"abort-blocks",level:2},{value:"Example",id:"example",level:3},{value:"Limitations",id:"limitations",level:3},{value:"Request and response",id:"request-and-response",level:3}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"blocks",children:"Blocks"}),"\n",(0,o.jsxs)(n.p,{children:["By default, Devnet starts with a genesis block labelled with number zero. In ",(0,o.jsx)(n.a,{href:"./forking",children:"forking mode"}),", the genesis block number is equal to the forked block number plus one."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-transaction",children:"Creating blocks on transaction"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with ",(0,o.jsx)(n.code,{children:"--block-generation-on transaction"}),", a new block is generated with each new transaction. This is the default block generation regime. This mode also supports ",(0,o.jsx)(n.a,{href:"#request-new-block-creation",children:"empty block creation"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"creating-blocks-on-demand",children:"Creating blocks on demand"}),"\n",(0,o.jsxs)(n.p,{children:["If you start Devnet with the ",(0,o.jsx)(n.code,{children:"--block-generation-on demand"})," CLI option, you will enable the possibility to store more than one transaction in the pending block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"pending"'}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["Once you've added the desired transactions into the pending block, you can ",(0,o.jsx)(n.a,{href:"#request-new-block-creation",children:"request new block creation"}),". This will convert the pending block to the latest block (targetable via block tag ",(0,o.jsx)(n.code,{children:'"latest"'}),"), giving it a block hash and a block number. All subsequent transactions will be stored in a new pending block."]}),"\n",(0,o.jsx)(n.p,{children:"In case of demanding block creation with no pending transactions, a new empty block will be generated."}),"\n",(0,o.jsx)(n.p,{children:"The creation of the genesis block is not affected by this feature."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"POST /create_block\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_createBlock"\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"{'block_hash': '0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67'}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"automatic-periodic-block-creation",children:"Automatic periodic block creation"}),"\n",(0,o.jsxs)(n.p,{children:["If started with the ",(0,o.jsx)(n.code,{children:"--block-generation-on "})," CLI option, Devnet will behave as in ",(0,o.jsxs)(n.a,{href:"#creating-blocks-on-demand",children:[(0,o.jsx)(n.code,{children:"demand"})," mode"]}),", but new blocks will be mined automatically every ",(0,o.jsx)(n.code,{children:""})," seconds. Consider this example of spawning Devnet at moment ",(0,o.jsx)(n.code,{children:"t"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"# t\n$ starknet-devnet --block-generation-on 10\n\n# t + 1s\n# user: send tx1\n\n# t + 4s\n# user: send tx2\n\n# t + 10s\n# Devnet: block automatically generated, contains tx1 and tx2\n\n# t + 12s\n# user: send tx3\n\n# t + 14s\n# user: invoke empty block creation\n# Devnet: generated block contains tx3\n\n# t + 20s\n# Devnet: block automatically generated, contains no txs (manual creation did not restart the counter)\n"})}),"\n",(0,o.jsx)(n.h2,{id:"request-new-block-creation",children:"Request new block creation"}),"\n",(0,o.jsxs)(n.p,{children:["To request the creation of a new block, ",(0,o.jsx)(n.code,{children:"POST"})," a request with no body to ",(0,o.jsx)(n.code,{children:"/create_block"})," or send:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_createBlock"\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{"block_hash": "0x115e1b390cafa7942b6ab141ab85040defe7dee9bef3bc31d8b5b3d01cc9c67"}\n'})}),"\n",(0,o.jsx)(n.p,{children:"The newly created block will contain all pending transactions, if any, since the last block creation."}),"\n",(0,o.jsx)(n.h2,{id:"abort-blocks",children:"Abort blocks"}),"\n",(0,o.jsxs)(n.p,{children:["This functionality allows simulating block abortion that can occur on mainnet. It is supported in the ",(0,o.jsx)(n.code,{children:"--state-archive-capacity full"})," mode."]}),"\n",(0,o.jsx)(n.p,{children:"You can abort blocks and revert transactions from the specified block to the currently latest block. Newly created blocks after the abortion will have accepted status and will continue with numbering where the last accepted block left off."}),"\n",(0,o.jsx)(n.p,{children:"The state of Devnet will be reverted to the state of the last accepted block."}),"\n",(0,o.jsx)(n.h3,{id:"example",children:"Example"}),"\n",(0,o.jsx)(n.p,{children:"Assume there are 3 accepted blocks numbered 1, 2 and 3. Upon receiving a request to abort blocks starting with block 2, the blocks numbered 2 and 3 are aborted and their transactions reverted. The state of network will be as it was in block 1. Once a new block is mined, it will be accepted and it will have number 2."}),"\n",(0,o.jsx)(n.h3,{id:"limitations",children:"Limitations"}),"\n",(0,o.jsx)(n.p,{children:"Aborted blocks can only be queried by block hash. Devnet does not support the abortion of:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"blocks in the forking origin (i.e. blocks mined before the forked block)"}),"\n",(0,o.jsx)(n.li,{children:"already aborted blocks"}),"\n",(0,o.jsx)(n.li,{children:"Devnet's genesis block"}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"request-and-response",children:"Request and response"}),"\n",(0,o.jsx)(n.p,{children:"To abort, send one of the following:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'POST /abort_blocks\n{\n "starting_block_hash": BLOCK_HASH\n}\n'})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_abortBlocks",\n "params": {\n "starting_block_hash": BLOCK_HASH\n }\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:"Response:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'{\n "aborted": [BLOCK_HASH_0, BLOCK_HASH_1, ...]\n}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const c={},s=o.createContext(c);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b1ee2929.037d9b49.js b/assets/js/b1ee2929.037d9b49.js new file mode 100644 index 000000000..b8d3bf62e --- /dev/null +++ b/assets/js/b1ee2929.037d9b49.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8586],{2007:e=>{e.exports=JSON.parse('{"categoryGeneratedIndex":{"title":"Running","slug":"/category/running","permalink":"/starknet-devnet-rs/docs/0.0.7/category/running","sidebar":"docSidebar","navigation":{"previous":{"title":"Intro","permalink":"/starknet-devnet-rs/docs/0.0.7/intro"},"next":{"title":"Install and run","permalink":"/starknet-devnet-rs/docs/0.0.7/running/install"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/7923f30a.4aa28861.js b/assets/js/b7007dab.baf2f898.js similarity index 97% rename from assets/js/7923f30a.4aa28861.js rename to assets/js/b7007dab.baf2f898.js index dd12b76b7..0f64783a6 100644 --- a/assets/js/7923f30a.4aa28861.js +++ b/assets/js/b7007dab.baf2f898.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9998],{2432:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>s,default:()=>h,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var i=t(4848),r=t(8453);const l={sidebar_position:2.1},s="Install and run",a={id:"running/install",title:"Install and run",description:"Requirements",source:"@site/versioned_docs/version-0.0.7/running/install.md",sourceDirName:"running",slug:"/running/install",permalink:"/starknet-devnet-rs/docs/running/install",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/running/install.md",tags:[],version:"0.0.7",sidebarPosition:2.1,frontMatter:{sidebar_position:2.1},sidebar:"docSidebar",previous:{title:"Running",permalink:"/starknet-devnet-rs/docs/category/running"},next:{title:"Run with Docker",permalink:"/starknet-devnet-rs/docs/running/docker"}},o={},c=[{value:"Requirements",id:"requirements",level:2},{value:"Install an executable binary",id:"install-an-executable-binary",level:2},{value:"Remove Pythonic Devnet",id:"remove-pythonic-devnet",level:3},{value:"Install from crates.io",id:"install-from-cratesio",level:3},{value:"Install from GitHub",id:"install-from-github",level:3},{value:"Run the installed executable",id:"run-the-installed-executable",level:3},{value:"Fetch a pre-compiled binary executable",id:"fetch-a-pre-compiled-binary-executable",level:2},{value:"Run from source",id:"run-from-source",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"install-and-run",children:"Install and run"}),"\n",(0,i.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,i.jsxs)(n.p,{children:["Any of the approaches below that mention ",(0,i.jsx)(n.code,{children:"cargo"})," require you to have ",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"installed Rust"}),". You might also need to install ",(0,i.jsx)(n.code,{children:"pkg-config"})," and ",(0,i.jsx)(n.code,{children:"make"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The required Rust version is specified in ",(0,i.jsx)(n.code,{children:"rust-toolchain.toml"})," in the project root and handled automatically by ",(0,i.jsx)(n.code,{children:"cargo"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"install-an-executable-binary",children:"Install an executable binary"}),"\n",(0,i.jsxs)(n.p,{children:["Installing an executable binary is achievable with ",(0,i.jsx)(n.code,{children:"cargo install"})," via ",(0,i.jsx)(n.a,{href:"https://crates.io/",children:"crates.io"})," or ",(0,i.jsx)(n.a,{href:"https://github.com",children:"github.com"}),". This approach downloads the crate, builds it in release mode and copies it to ",(0,i.jsx)(n.code,{children:"~/.cargo/bin/"}),". To avoid needing to compile and wait, check the ",(0,i.jsx)(n.a,{href:"#fetch-a-pre-compiled-binary-executable",children:"pre-compiled binary section"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"remove-pythonic-devnet",children:"Remove Pythonic Devnet"}),"\n",(0,i.jsxs)(n.p,{children:["If in the past you installed ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet",children:"Pythonic Devnet"}),", be sure to remove it to avoid name collision of the old and the new executable - if by no other means, then by ",(0,i.jsx)(n.code,{children:"rm $(which starknet-devnet)"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"install-from-cratesio",children:"Install from crates.io"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo install starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h3,{id:"install-from-github",children:"Install from GitHub"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Use the ",(0,i.jsx)(n.code,{children:"--locked"})," flag to ensure using the dependencies listed in ",(0,i.jsx)(n.code,{children:"Cargo.lock"})," in the project root."]}),"\n",(0,i.jsxs)(n.li,{children:["Preferably familiarize yourself with the ",(0,i.jsx)(n.code,{children:"cargo install"})," command (",(0,i.jsx)(n.a,{href:"https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile",children:"docs"}),")."]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked\n"})}),"\n",(0,i.jsx)(n.h3,{id:"run-the-installed-executable",children:"Run the installed executable"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"cargo install"})," finishes, follow the output in your terminal. If properly configured, you should be able to run Devnet with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h2,{id:"fetch-a-pre-compiled-binary-executable",children:"Fetch a pre-compiled binary executable"}),"\n",(0,i.jsxs)(n.p,{children:["If you want to save time and skip project compilation on installation, since Devnet v0.0.5, the Assets section of each ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-rs/releases",children:"GitHub release"})," contains a set of platform-specific pre-compiled binary executables. Extract and run with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ curl https://github.com/0xSpaceShard/starknet-devnet-rs/releases/download// | tar -xvzf -C \n$ /starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h2,{id:"run-from-source",children:"Run from source"}),"\n",(0,i.jsxs)(n.p,{children:["To install the project from source, after ",(0,i.jsx)(n.a,{href:"https://github.com/git-guides/git-clone",children:"git-cloning"})," the ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-rs",children:"Devnet repository"}),", running the following command will install, build and start Devnet:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run\n"})}),"\n",(0,i.jsx)(n.p,{children:"Specify optional CLI params like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run -- [ARGS]\n"})}),"\n",(0,i.jsx)(n.p,{children:"For a more optimized performance (though with a longer compilation time), run:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run --release\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var i=t(6540);const r={},l=i.createContext(r);function s(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3950],{5873:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>s,default:()=>h,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var i=t(4848),r=t(8453);const l={sidebar_position:2.1},s="Install and run",a={id:"running/install",title:"Install and run",description:"Requirements",source:"@site/versioned_docs/version-0.1.1/running/install.md",sourceDirName:"running",slug:"/running/install",permalink:"/starknet-devnet-rs/docs/running/install",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/running/install.md",tags:[],version:"0.1.1",sidebarPosition:2.1,frontMatter:{sidebar_position:2.1},sidebar:"docSidebar",previous:{title:"Running",permalink:"/starknet-devnet-rs/docs/category/running"},next:{title:"Run with Docker",permalink:"/starknet-devnet-rs/docs/running/docker"}},o={},c=[{value:"Requirements",id:"requirements",level:2},{value:"Install an executable binary",id:"install-an-executable-binary",level:2},{value:"Remove Pythonic Devnet",id:"remove-pythonic-devnet",level:3},{value:"Install from crates.io",id:"install-from-cratesio",level:3},{value:"Install from GitHub",id:"install-from-github",level:3},{value:"Run the installed executable",id:"run-the-installed-executable",level:3},{value:"Fetch a pre-compiled binary executable",id:"fetch-a-pre-compiled-binary-executable",level:2},{value:"Run from source",id:"run-from-source",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"install-and-run",children:"Install and run"}),"\n",(0,i.jsx)(n.h2,{id:"requirements",children:"Requirements"}),"\n",(0,i.jsxs)(n.p,{children:["Any of the approaches below that mention ",(0,i.jsx)(n.code,{children:"cargo"})," require you to have ",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/tools/install",children:"installed Rust"}),". You might also need to install ",(0,i.jsx)(n.code,{children:"pkg-config"})," and ",(0,i.jsx)(n.code,{children:"make"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The required Rust version is specified in ",(0,i.jsx)(n.code,{children:"rust-toolchain.toml"})," in the project root and handled automatically by ",(0,i.jsx)(n.code,{children:"cargo"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"install-an-executable-binary",children:"Install an executable binary"}),"\n",(0,i.jsxs)(n.p,{children:["Installing an executable binary is achievable with ",(0,i.jsx)(n.code,{children:"cargo install"})," via ",(0,i.jsx)(n.a,{href:"https://crates.io/",children:"crates.io"})," or ",(0,i.jsx)(n.a,{href:"https://github.com",children:"github.com"}),". This approach downloads the crate, builds it in release mode and copies it to ",(0,i.jsx)(n.code,{children:"~/.cargo/bin/"}),". To avoid needing to compile and wait, check the ",(0,i.jsx)(n.a,{href:"#fetch-a-pre-compiled-binary-executable",children:"pre-compiled binary section"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"remove-pythonic-devnet",children:"Remove Pythonic Devnet"}),"\n",(0,i.jsxs)(n.p,{children:["If in the past you installed ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet",children:"Pythonic Devnet"}),", be sure to remove it to avoid name collision of the old and the new executable - if by no other means, then by ",(0,i.jsx)(n.code,{children:"rm $(which starknet-devnet)"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"install-from-cratesio",children:"Install from crates.io"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo install starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h3,{id:"install-from-github",children:"Install from GitHub"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Use the ",(0,i.jsx)(n.code,{children:"--locked"})," flag to ensure using the dependencies listed in ",(0,i.jsx)(n.code,{children:"Cargo.lock"})," in the project root."]}),"\n",(0,i.jsxs)(n.li,{children:["Preferably familiarize yourself with the ",(0,i.jsx)(n.code,{children:"cargo install"})," command (",(0,i.jsx)(n.a,{href:"https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile",children:"docs"}),")."]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked\n"})}),"\n",(0,i.jsx)(n.h3,{id:"run-the-installed-executable",children:"Run the installed executable"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"cargo install"})," finishes, follow the output in your terminal. If properly configured, you should be able to run Devnet with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h2,{id:"fetch-a-pre-compiled-binary-executable",children:"Fetch a pre-compiled binary executable"}),"\n",(0,i.jsxs)(n.p,{children:["If you want to save time and skip project compilation on installation, since Devnet v0.0.5, the Assets section of each ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-rs/releases",children:"GitHub release"})," contains a set of platform-specific pre-compiled binary executables. Extract and run with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ curl https://github.com/0xSpaceShard/starknet-devnet-rs/releases/download// | tar -xvzf -C \n$ /starknet-devnet\n"})}),"\n",(0,i.jsx)(n.h2,{id:"run-from-source",children:"Run from source"}),"\n",(0,i.jsxs)(n.p,{children:["To install the project from source, after ",(0,i.jsx)(n.a,{href:"https://github.com/git-guides/git-clone",children:"git-cloning"})," the ",(0,i.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-rs",children:"Devnet repository"}),", running the following command will install, build and start Devnet:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run\n"})}),"\n",(0,i.jsx)(n.p,{children:"Specify optional CLI params like this:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run -- [ARGS]\n"})}),"\n",(0,i.jsx)(n.p,{children:"For a more optimized performance (though with a longer compilation time), run:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"$ cargo run --release\n"})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var i=t(6540);const r={},l=i.createContext(r);function s(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ba738306.0c1ac6c3.js b/assets/js/ba738306.0c1ac6c3.js deleted file mode 100644 index ced9548b0..000000000 --- a/assets/js/ba738306.0c1ac6c3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9167],{2693:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var i=n(4848),s=n(8453);const r={},a="Starknet time",c={id:"starknet-time",title:"Starknet time",description:"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.",source:"@site/versioned_docs/version-0.0.7/starknet-time.md",sourceDirName:".",slug:"/starknet-time",permalink:"/starknet-devnet-rs/docs/starknet-time",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/starknet-time.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Server config",permalink:"/starknet-devnet-rs/docs/server-config"}},o={},d=[{value:"Set time",id:"set-time",level:2},{value:"Increase time",id:"increase-time",level:2},{value:"Start time argument",id:"start-time-argument",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"starknet-time",children:"Starknet time"}),"\n",(0,i.jsxs)(t.p,{children:["Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods ",(0,i.jsx)(t.code,{children:"/set_time"})," and ",(0,i.jsx)(t.code,{children:"/increase_time"})," generate a new block. This can be changed for ",(0,i.jsx)(t.code,{children:"/set_time"})," by setting the optional parameter ",(0,i.jsx)(t.code,{children:"generate_block"})," to ",(0,i.jsx)(t.code,{children:"false"}),". This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated."]}),"\n",(0,i.jsxs)(t.p,{children:["All values should be set in ",(0,i.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Unix_time",children:"Unix time seconds"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"set-time",children:"Set time"}),"\n",(0,i.jsx)(t.p,{children:"Sets the exact time and generates a new block."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /set_time\n{\n "time": TIME_IN_SECONDS\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Doesn't generate a new block, but sets the exact time for the next generated block."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /set_time\n{\n "time": TIME_IN_SECONDS,\n "generate_block": false\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Warning: block time can be set in the past which might lead to unexpected behavior!"}),"\n",(0,i.jsx)(t.h2,{id:"increase-time",children:"Increase time"}),"\n",(0,i.jsx)(t.p,{children:"Increases the block timestamp by the provided amount and generates a new block. All subsequent blocks will keep this increment."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /increase_time\n{\n "time": TIME_IN_SECONDS\n}\n'})}),"\n",(0,i.jsx)(t.h2,{id:"start-time-argument",children:"Start time argument"}),"\n",(0,i.jsxs)(t.p,{children:["Devnet can be started with ",(0,i.jsx)(t.code,{children:"--start-time"})," CLI argument, where ",(0,i.jsx)(t.code,{children:"START_TIME_IN_SECONDS"})," should be greater than 0."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"$ starknet-devnet --start-time \n"})})]})}function m(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>c});var i=n(6540);const s={},r=i.createContext(s);function a(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ba738306.fde851af.js b/assets/js/ba738306.fde851af.js new file mode 100644 index 000000000..21ba09ffd --- /dev/null +++ b/assets/js/ba738306.fde851af.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9167],{2693:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var i=n(4848),s=n(8453);const r={},a="Starknet time",c={id:"starknet-time",title:"Starknet time",description:"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.",source:"@site/versioned_docs/version-0.0.7/starknet-time.md",sourceDirName:".",slug:"/starknet-time",permalink:"/starknet-devnet-rs/docs/0.0.7/starknet-time",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/starknet-time.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Server config",permalink:"/starknet-devnet-rs/docs/0.0.7/server-config"}},o={},d=[{value:"Set time",id:"set-time",level:2},{value:"Increase time",id:"increase-time",level:2},{value:"Start time argument",id:"start-time-argument",level:2}];function l(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"starknet-time",children:"Starknet time"}),"\n",(0,i.jsxs)(t.p,{children:["Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods ",(0,i.jsx)(t.code,{children:"/set_time"})," and ",(0,i.jsx)(t.code,{children:"/increase_time"})," generate a new block. This can be changed for ",(0,i.jsx)(t.code,{children:"/set_time"})," by setting the optional parameter ",(0,i.jsx)(t.code,{children:"generate_block"})," to ",(0,i.jsx)(t.code,{children:"false"}),". This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated."]}),"\n",(0,i.jsxs)(t.p,{children:["All values should be set in ",(0,i.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Unix_time",children:"Unix time seconds"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"set-time",children:"Set time"}),"\n",(0,i.jsx)(t.p,{children:"Sets the exact time and generates a new block."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /set_time\n{\n "time": TIME_IN_SECONDS\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Doesn't generate a new block, but sets the exact time for the next generated block."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /set_time\n{\n "time": TIME_IN_SECONDS,\n "generate_block": false\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Warning: block time can be set in the past which might lead to unexpected behavior!"}),"\n",(0,i.jsx)(t.h2,{id:"increase-time",children:"Increase time"}),"\n",(0,i.jsx)(t.p,{children:"Increases the block timestamp by the provided amount and generates a new block. All subsequent blocks will keep this increment."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /increase_time\n{\n "time": TIME_IN_SECONDS\n}\n'})}),"\n",(0,i.jsx)(t.h2,{id:"start-time-argument",children:"Start time argument"}),"\n",(0,i.jsxs)(t.p,{children:["Devnet can be started with ",(0,i.jsx)(t.code,{children:"--start-time"})," CLI argument, where ",(0,i.jsx)(t.code,{children:"START_TIME_IN_SECONDS"})," should be greater than 0."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"$ starknet-devnet --start-time \n"})})]})}function m(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>c});var i=n(6540);const s={},r=i.createContext(s);function a(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bca784a7.0edf2fc8.js b/assets/js/bca784a7.0edf2fc8.js new file mode 100644 index 000000000..990f78380 --- /dev/null +++ b/assets/js/bca784a7.0edf2fc8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8626],{5787:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>i});var t=s(4848),r=s(8453);const a={},d="L1-L2 interaction via Postman",o={id:"postman",title:"L1-L2 interaction via Postman",description:"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-devnet-js to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.",source:"@site/docs/postman.md",sourceDirName:".",slug:"/postman",permalink:"/starknet-devnet-rs/docs/next/postman",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/postman.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/next/lite"},next:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/next/predeployed"}},c={},i=[{value:"Load",id:"load",level:2},{value:"Flush",id:"flush",level:2},{value:"Disclaimer",id:"disclaimer",level:2},{value:"Mock transactions",id:"mock-transactions",level:2},{value:"L1->L2",id:"l1-l2",level:3},{value:"L2->L1",id:"l2-l1",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"l1-l2-interaction-via-postman",children:"L1-L2 interaction via Postman"}),"\n",(0,t.jsxs)(n.p,{children:["Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, ",(0,t.jsx)(n.a,{href:"#load",children:"load"})," a messaging contract, and ",(0,t.jsx)(n.a,{href:"#flush",children:"flush"})," the queue when needed. You can use ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-js",children:(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"starknet-devnet-js"})})})," to perform these actions, as witnessed in ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-js/blob/master/test/postman.test.ts",children:(0,t.jsx)(n.strong,{children:"this example"})}),", or directly send requests to the endpoints specified below."]}),"\n",(0,t.jsx)(n.h2,{id:"load",children:"Load"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/load_l1_messaging_contract\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanLoad",\n "params": {\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Loads a ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract. The ",(0,t.jsx)(n.code,{children:"address"})," parameter is optional; if provided, the ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract will be fetched from that address, otherwise a new one will be deployed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"networkUrl"})," is the URL of the JSON-RPC API of the L1 node you've run locally or that already exists; possibilities include, and are not limited to:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/foundry-rs/foundry/tree/master/crates/anvil",children:(0,t.jsx)(n.strong,{children:"Anvil"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://sepolia.etherscan.io/",children:(0,t.jsx)(n.strong,{children:"Sepolia testnet"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/ganache",children:(0,t.jsx)(n.strong,{children:"Ganache"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/ethereum/go-ethereum#docker-quick-start",children:(0,t.jsx)(n.strong,{children:"Geth"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://hardhat.org/hardhat-network/#running-stand-alone-in-order-to-support-wallets-and-other-software",children:(0,t.jsx)(n.strong,{children:"Hardhat node"})})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"flush",children:"Flush"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanFlush"\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Goes through the newly enqueued messages, sending them from L1 to L2 and from L2 to L1. Requires no body. Optionally, set the ",(0,t.jsx)(n.code,{children:"dry_run"})," specifier to just see the result of flushing, without actually triggering it:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "dry_run": true }\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanFlush",\n "params": {\n "dry_run": true\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is required if ",(0,t.jsx)(n.code,{children:"dry_run"})," is not set."]}),"\n",(0,t.jsx)(n.h2,{id:"disclaimer",children:"Disclaimer"}),"\n",(0,t.jsxs)(n.p,{children:["This method of L1-L2 communication testing differs from how Starknet mainnet and testnets work. Taking ",(0,t.jsx)(n.a,{href:"https://github.com/MikeSpa/starknet-test/blob/6a68d033cd7ddb5df937154f860f1c06174e6860/L1L2Example.sol#L46",children:(0,t.jsx)(n.strong,{children:"L1L2Example.sol"})})," (originally from Starknet documentation, no longer available there):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(IStarknetCore starknetCore_) public {\n starknetCore = starknetCore_;\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The constructor takes an ",(0,t.jsx)(n.code,{children:"IStarknetCore"})," contract as argument, however for Devnet's L1-L2 communication testing, this has to be replaced with the logic in ",(0,t.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/testing/MockStarknetMessaging.sol",children:(0,t.jsx)(n.strong,{children:"MockStarknetMessaging.sol"})}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(MockStarknetMessaging mockStarknetMessaging_) public {\n starknetCore = mockStarknetMessaging_;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"mock-transactions",children:"Mock transactions"}),"\n",(0,t.jsx)(n.h3,{id:"l1-l2",children:"L1->L2"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L1 to L2 without the need for running L1. Deployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"entry_point_selector"})," must be valid otherwise new block will not be created."]}),"\n",(0,t.jsxs)(n.p,{children:["Normally ",(0,t.jsx)(n.code,{children:"nonce"})," is calculated by L1 StarknetContract and it's used in L1 and L2. In this case, we need to provide it manually."]}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is ",(0,t.jsx)(n.strong,{children:"not"})," required for this operation."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/send_message_to_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanSendMessageToL2",\n "params": {\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "transaction_hash": "0x0548c761a9fd5512782998b2da6f44c42bf78fb88c3794eea330a91c9abb10bb" }\n'})}),"\n",(0,t.jsx)(n.h3,{id:"l2-l1",children:"L2->L1"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L2 to L1.\nDeployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"l1_contract_address"})," must be valid."]}),"\n",(0,t.jsx)(n.p,{children:"A running L1 node is required for this operation."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/consume_message_from_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanConsumeMessageFromL2",\n "params": {\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{"message_hash": "0xae14f241131b524ac8d043d9cb4934253ac5c5589afef19f0d761816a9c7e26d"}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>d,x:()=>o});var t=s(6540);const r={},a=t.createContext(r);function d(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bca784a7.547f56bd.js b/assets/js/bca784a7.547f56bd.js deleted file mode 100644 index f111c756a..000000000 --- a/assets/js/bca784a7.547f56bd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8626],{5787:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>i});var t=s(4848),r=s(8453);const a={},d="L1-L2 interaction via Postman",o={id:"postman",title:"L1-L2 interaction via Postman",description:"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.",source:"@site/docs/postman.md",sourceDirName:".",slug:"/postman",permalink:"/starknet-devnet-rs/docs/next/postman",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/docs/postman.md",tags:[],version:"current",frontMatter:{},sidebar:"docSidebar",previous:{title:"Lite mode",permalink:"/starknet-devnet-rs/docs/next/lite"},next:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/next/predeployed"}},c={},i=[{value:"Load",id:"load",level:2},{value:"Flush",id:"flush",level:2},{value:"Disclaimer",id:"disclaimer",level:2},{value:"Mock transactions",id:"mock-transactions",level:2},{value:"L1->L2",id:"l1-l2",level:3},{value:"L2->L1",id:"l2-l1",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"l1-l2-interaction-via-postman",children:"L1-L2 interaction via Postman"}),"\n",(0,t.jsxs)(n.p,{children:["Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, ",(0,t.jsx)(n.a,{href:"#load",children:"load"})," a messaging contract, and ",(0,t.jsx)(n.a,{href:"#flush",children:"flush"})," the queue when needed. You can use ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-plugin",children:(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"starknet-hardhat-plugin"})})})," to perform these actions, as witnessed in ",(0,t.jsx)(n.a,{href:"https://github.com/0xSpaceShard/starknet-hardhat-example/blob/master/test/postman.test.ts",children:(0,t.jsx)(n.strong,{children:"this example"})}),", or directly send requests to the endpoints specified below."]}),"\n",(0,t.jsx)(n.h2,{id:"load",children:"Load"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/load_l1_messaging_contract\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-json",children:'{\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanLoad",\n "params": {\n "networkUrl": "http://localhost:8545",\n "address": "0x123...def"\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Loads a ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract. The ",(0,t.jsx)(n.code,{children:"address"})," parameter is optional; if provided, the ",(0,t.jsx)(n.code,{children:"MockStarknetMessaging"})," contract will be fetched from that address, otherwise a new one will be deployed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"networkUrl"})," is the URL of the JSON-RPC API of the L1 node you've run locally or that already exists; possibilities include, and are not limited to:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/foundry-rs/foundry/tree/master/crates/anvil",children:(0,t.jsx)(n.strong,{children:"Anvil"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://sepolia.etherscan.io/",children:(0,t.jsx)(n.strong,{children:"Sepolia testnet"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://www.npmjs.com/package/ganache",children:(0,t.jsx)(n.strong,{children:"Ganache"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://github.com/ethereum/go-ethereum#docker-quick-start",children:(0,t.jsx)(n.strong,{children:"Geth"})})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://hardhat.org/hardhat-network/#running-stand-alone-in-order-to-support-wallets-and-other-software",children:(0,t.jsx)(n.strong,{children:"Hardhat node"})})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"flush",children:"Flush"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanFlush"\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Goes through the newly enqueued messages, sending them from L1 to L2 and from L2 to L1. Requires no body. Optionally, set the ",(0,t.jsx)(n.code,{children:"dry_run"})," specifier to just see the result of flushing, without actually triggering it:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/flush\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "dry_run": true }\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanFlush",\n "params": {\n "dry_run": true\n }\n}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is required if ",(0,t.jsx)(n.code,{children:"dry_run"})," is not set."]}),"\n",(0,t.jsx)(n.h2,{id:"disclaimer",children:"Disclaimer"}),"\n",(0,t.jsxs)(n.p,{children:["This method of L1-L2 communication testing differs from how Starknet mainnet and testnets work. Taking ",(0,t.jsx)(n.a,{href:"https://github.com/MikeSpa/starknet-test/blob/6a68d033cd7ddb5df937154f860f1c06174e6860/L1L2Example.sol#L46",children:(0,t.jsx)(n.strong,{children:"L1L2Example.sol"})})," (originally from Starknet documentation, no longer available there):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(IStarknetCore starknetCore_) public {\n starknetCore = starknetCore_;\n}\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The constructor takes an ",(0,t.jsx)(n.code,{children:"IStarknetCore"})," contract as argument, however for Devnet's L1-L2 communication testing, this has to be replaced with the logic in ",(0,t.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/testing/MockStarknetMessaging.sol",children:(0,t.jsx)(n.strong,{children:"MockStarknetMessaging.sol"})}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-solidity",children:"constructor(MockStarknetMessaging mockStarknetMessaging_) public {\n starknetCore = mockStarknetMessaging_;\n}\n"})}),"\n",(0,t.jsx)(n.h2,{id:"mock-transactions",children:"Mock transactions"}),"\n",(0,t.jsx)(n.h3,{id:"l1-l2",children:"L1->L2"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L1 to L2 without the need for running L1. Deployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"entry_point_selector"})," must be valid otherwise new block will not be created."]}),"\n",(0,t.jsxs)(n.p,{children:["Normally ",(0,t.jsx)(n.code,{children:"nonce"})," is calculated by L1 StarknetContract and it's used in L1 and L2. In this case, we need to provide it manually."]}),"\n",(0,t.jsxs)(n.p,{children:["A running L1 node is ",(0,t.jsx)(n.strong,{children:"not"})," required for this operation."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/send_message_to_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanSendMessageToL2",\n "params": {\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "entry_point_selector": "0xC73F681176FC7B3F9693986FD7B14581E8D540519E27400E88B8713932BE01",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": [\n "0x1",\n "0x2"\n ],\n "paid_fee_on_l1": "0x123456abcdef"\n "nonce":"0x0"\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{ "transaction_hash": "0x0548c761a9fd5512782998b2da6f44c42bf78fb88c3794eea330a91c9abb10bb" }\n'})}),"\n",(0,t.jsx)(n.h3,{id:"l2-l1",children:"L2->L1"}),"\n",(0,t.jsxs)(n.p,{children:["Sending mock transactions from L2 to L1.\nDeployed L2 contract address ",(0,t.jsx)(n.code,{children:"l2_contract_address"})," and ",(0,t.jsx)(n.code,{children:"l1_contract_address"})," must be valid."]}),"\n",(0,t.jsx)(n.p,{children:"A running L1 node is required for this operation."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"POST /postman/consume_message_from_l2\n"})}),"\n",(0,t.jsx)(n.p,{children:"Request:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n}\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_postmanConsumeMessageFromL2",\n "params": {\n "l2_contract_address": "0x00285ddb7e5c777b310d806b9b2a0f7c7ba0a41f12b420219209d97a3b7f25b2",\n "l1_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",\n "payload": ["0x0", "0x1", "0x3e8"],\n }\n}\n'})}),"\n",(0,t.jsx)(n.p,{children:"Response:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'{"message_hash": "0xae14f241131b524ac8d043d9cb4934253ac5c5589afef19f0d761816a9c7e26d"}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>d,x:()=>o});var t=s(6540);const r={},a=t.createContext(r);function d(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c4d2e5c1.3039254f.js b/assets/js/c4d2e5c1.3039254f.js new file mode 100644 index 000000000..fe2715a07 --- /dev/null +++ b/assets/js/c4d2e5c1.3039254f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2134],{4500:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>a,default:()=>l,frontMatter:()=>r,metadata:()=>c,toc:()=>o});var i=n(4848),s=n(8453);const r={},a="Starknet time",c={id:"starknet-time",title:"Starknet time",description:"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime, /increasetime and JSON-RPC methods devnetsetTime, devnetincreaseTime generate a new block. This can be changed for /settime (devnetsetTime) by setting the optional parameter generate_block to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.",source:"@site/versioned_docs/version-0.1.1/starknet-time.md",sourceDirName:".",slug:"/starknet-time",permalink:"/starknet-devnet-rs/docs/starknet-time",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/starknet-time.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Server config",permalink:"/starknet-devnet-rs/docs/server-config"}},d={},o=[{value:"Set time",id:"set-time",level:2},{value:"Increase time",id:"increase-time",level:2},{value:"Start time argument",id:"start-time-argument",level:2}];function m(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"starknet-time",children:"Starknet time"}),"\n",(0,i.jsxs)(t.p,{children:["Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods ",(0,i.jsx)(t.code,{children:"/set_time"}),", ",(0,i.jsx)(t.code,{children:"/increase_time"})," and ",(0,i.jsx)(t.code,{children:"JSON-RPC"})," methods ",(0,i.jsx)(t.code,{children:"devnet_setTime"}),", ",(0,i.jsx)(t.code,{children:"devnet_increaseTime"})," generate a new block. This can be changed for ",(0,i.jsx)(t.code,{children:"/set_time"})," (",(0,i.jsx)(t.code,{children:"devnet_setTime"}),") by setting the optional parameter ",(0,i.jsx)(t.code,{children:"generate_block"})," to ",(0,i.jsx)(t.code,{children:"false"}),". This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated."]}),"\n",(0,i.jsxs)(t.p,{children:["All values should be set in ",(0,i.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/Unix_time",children:"Unix time seconds"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"set-time",children:"Set time"}),"\n",(0,i.jsx)(t.p,{children:"Sets the exact time and generates a new block."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /set_time\n{\n "time": TIME_IN_SECONDS\n}\n'})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_setTime",\n "params": {\n "time": TIME_IN_SECONDS\n }\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Doesn't generate a new block, but sets the exact time for the next generated block."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /set_time\n{\n "time": TIME_IN_SECONDS,\n "generate_block": false\n}\n'})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_setTime",\n "params": {\n "time": TIME_IN_SECONDS,\n "generate_block": false\n }\n}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Warning: block time can be set in the past which might lead to unexpected behavior!"}),"\n",(0,i.jsx)(t.h2,{id:"increase-time",children:"Increase time"}),"\n",(0,i.jsx)(t.p,{children:"Increases the block timestamp by the provided amount and generates a new block. All subsequent blocks will keep this increment."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'POST /increase_time\n{\n "time": TIME_IN_SECONDS\n}\n'})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_increaseTime",\n "params": {\n "time": TIME_IN_SECONDS\n }\n}\n'})}),"\n",(0,i.jsx)(t.h2,{id:"start-time-argument",children:"Start time argument"}),"\n",(0,i.jsxs)(t.p,{children:["Devnet can be started with ",(0,i.jsx)(t.code,{children:"--start-time"})," CLI argument, where ",(0,i.jsx)(t.code,{children:"START_TIME_IN_SECONDS"})," should be greater than 0."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"$ starknet-devnet --start-time \n"})})]})}function l(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(m,{...e})}):m(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>c});var i=n(6540);const s={},r=i.createContext(s);function a(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/cc2baa30.c74667a4.js b/assets/js/cc2baa30.ab62794b.js similarity index 70% rename from assets/js/cc2baa30.c74667a4.js rename to assets/js/cc2baa30.ab62794b.js index d15b8e3f3..1a328c0ff 100644 --- a/assets/js/cc2baa30.c74667a4.js +++ b/assets/js/cc2baa30.ab62794b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9218],{8947:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"0.0.7","label":"0.0.7","banner":null,"badge":true,"noIndex":false,"className":"docs-version-0.0.7","isLast":true,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"Starknet API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"Devnet starts with a genesis block (with a block number equal to 0). In forking mode, the genesis block number will be equal to the forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-hardhat-plugin to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Configure your Devnet instance by specifying CLI parameters on startup.","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"To read generally about ways to configure your Devnet instance, check out the CLI section.","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime and /increasetime generate a new block. This can be changed for /settime by setting the optional parameter generateblock to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9218],{8947:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"0.1.1","label":"0.1.1","banner":null,"badge":true,"noIndex":false,"className":"docs-version-0.1.1","isLast":true,"docsSidebars":{"docSidebar":[{"type":"link","label":"Intro","href":"/starknet-devnet-rs/docs/intro","docId":"intro","unlisted":false},{"type":"category","label":"Running","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Install and run","href":"/starknet-devnet-rs/docs/running/install","docId":"running/install","unlisted":false},{"type":"link","label":"Run with Docker","href":"/starknet-devnet-rs/docs/running/docker","docId":"running/docker","unlisted":false},{"type":"link","label":"CLI options","href":"/starknet-devnet-rs/docs/running/cli","docId":"running/cli","unlisted":false}],"href":"/starknet-devnet-rs/docs/category/running"},{"type":"link","label":"Account impersonation","href":"/starknet-devnet-rs/docs/account-impersonation","docId":"account-impersonation","unlisted":false},{"type":"link","label":"API","href":"/starknet-devnet-rs/docs/api","docId":"api","unlisted":false},{"type":"link","label":"Account balance","href":"/starknet-devnet-rs/docs/balance","docId":"balance","unlisted":false},{"type":"link","label":"Blocks","href":"/starknet-devnet-rs/docs/blocks","docId":"blocks","unlisted":false},{"type":"link","label":"Dump, load, restart","href":"/starknet-devnet-rs/docs/dump-load-restart","docId":"dump-load-restart","unlisted":false},{"type":"link","label":"Forking","href":"/starknet-devnet-rs/docs/forking","docId":"forking","unlisted":false},{"type":"link","label":"Historic state support","href":"/starknet-devnet-rs/docs/historic-state","docId":"historic-state","unlisted":false},{"type":"link","label":"Lite mode","href":"/starknet-devnet-rs/docs/lite","docId":"lite","unlisted":false},{"type":"link","label":"L1-L2 interaction via Postman","href":"/starknet-devnet-rs/docs/postman","docId":"postman","unlisted":false},{"type":"link","label":"Predeployed contracts","href":"/starknet-devnet-rs/docs/predeployed","docId":"predeployed","unlisted":false},{"type":"link","label":"Server config","href":"/starknet-devnet-rs/docs/server-config","docId":"server-config","unlisted":false},{"type":"link","label":"Starknet time","href":"/starknet-devnet-rs/docs/starknet-time","docId":"starknet-time","unlisted":false}]},"docs":{"account-impersonation":{"id":"account-impersonation","title":"Account impersonation","description":"This page is about account impersonation. To read about account class selection and deployment, click here.","sidebar":"docSidebar"},"api":{"id":"api","title":"API","description":"JSON-RPC API","sidebar":"docSidebar"},"balance":{"id":"balance","title":"Account balance","description":"Other than using prefunded predeployed accounts, you can also add funds to an account that you deployed yourself.","sidebar":"docSidebar"},"blocks":{"id":"blocks","title":"Blocks","description":"By default, Devnet starts with a genesis block labelled with number zero. In forking mode, the genesis block number is equal to the forked block number plus one.","sidebar":"docSidebar"},"dump-load-restart":{"id":"dump-load-restart","title":"Dump, load, restart","description":"Dumping","sidebar":"docSidebar"},"forking":{"id":"forking","title":"Forking","description":"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.","sidebar":"docSidebar"},"historic-state":{"id":"historic-state","title":"Historic state support","description":"With state archive capacity set to full, Devnet will store full state history, enabling its querying by block hash or number. The default mode is none, where no old states are stored and only the latest is available for querying.","sidebar":"docSidebar"},"intro":{"id":"intro","title":"Intro","description":"- Devnet should not be used as a replacement for official testnets. After testing on Devnet, be sure to test on a testnet (alpha-sepolia)!","sidebar":"docSidebar"},"lite":{"id":"lite","title":"Lite mode","description":"To run Devnet in a minimal lite mode, provide the flag:","sidebar":"docSidebar"},"postman":{"id":"postman","title":"L1-L2 interaction via Postman","description":"Postman is a Starknet utility that allows testing L1-L2 interaction. Ensure you have an L1 node and a Devnet (L2 node) running, load a messaging contract, and flush the queue when needed. You can use starknet-devnet-js to perform these actions, as witnessed in this example, or directly send requests to the endpoints specified below.","sidebar":"docSidebar"},"predeployed":{"id":"predeployed","title":"Predeployed contracts","description":"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.","sidebar":"docSidebar"},"running/cli":{"id":"running/cli","title":"CLI options","description":"Configure your Devnet instance by specifying CLI parameters on startup.","sidebar":"docSidebar"},"running/docker":{"id":"running/docker","title":"Run with Docker","description":"Devnet is available as a Docker image (Docker Hub link). To download the latest image, run:","sidebar":"docSidebar"},"running/install":{"id":"running/install","title":"Install and run","description":"Requirements","sidebar":"docSidebar"},"server-config":{"id":"server-config","title":"Server config","description":"To read generally about ways to configure your Devnet instance, check out the CLI section.","sidebar":"docSidebar"},"starknet-time":{"id":"starknet-time","title":"Starknet time","description":"Block and state timestamp can be manipulated by setting the exact time or setting the time offset. By default, timestamp methods /settime, /increasetime and JSON-RPC methods devnetsetTime, devnetincreaseTime generate a new block. This can be changed for /settime (devnetsetTime) by setting the optional parameter generate_block to false. This skips immediate new block generation, but will use the specified timestamp whenever the next block is supposed to be generated.","sidebar":"docSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/def2ee80.c9b52201.js b/assets/js/def2ee80.c9b52201.js new file mode 100644 index 000000000..23d7b69ed --- /dev/null +++ b/assets/js/def2ee80.c9b52201.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6928],{1565:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>r,default:()=>l,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var i=n(4848),a=n(8453);const s={},r="API",c={id:"api",title:"API",description:"JSON-RPC API",source:"@site/versioned_docs/version-0.1.1/api.md",sourceDirName:".",slug:"/api",permalink:"/starknet-devnet-rs/docs/api",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/api.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation"},next:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/balance"}},o={},d=[{value:"JSON-RPC API",id:"json-rpc-api",level:2},{value:"Starknet API",id:"starknet-api",level:3},{value:"Devnet API",id:"devnet-api",level:3},{value:"Interacting with Devnet in JavaScript and TypeScript",id:"interacting-with-devnet-in-javascript-and-typescript",level:2},{value:"Config API",id:"config-api",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"api",children:"API"}),"\n",(0,i.jsx)(t.h2,{id:"json-rpc-api",children:"JSON-RPC API"}),"\n",(0,i.jsxs)(t.p,{children:["Both Starknet's and Devnet's JSON-RPC API are reachable at ",(0,i.jsx)(t.code,{children:"/rpc"})," and ",(0,i.jsx)(t.code,{children:"/"}),". E.g. if spawning Devnet with default settings, these URLs are functionally equivalent: ",(0,i.jsx)(t.code,{children:"http://127.0.0.1:5050/rpc"})," and ",(0,i.jsx)(t.code,{children:"http://127.0.0.1:5050/"}),". The difference between these two groups of methods is their prefix: ",(0,i.jsx)(t.code,{children:"starknet_"})," (e.g. ",(0,i.jsx)(t.code,{children:"starknet_getNonce"}),") and ",(0,i.jsx)(t.code,{children:"devnet_"})," (e.g. ",(0,i.jsx)(t.code,{children:"devnet_mint"}),")."]}),"\n",(0,i.jsx)(t.h3,{id:"starknet-api",children:"Starknet API"}),"\n",(0,i.jsxs)(t.p,{children:["Unlike Pythonic Devnet, which also supported Starknet's gateway and feeder gateway API, Devnet in Rust supports ",(0,i.jsx)(t.a,{href:"https://github.com/starkware-libs/starknet-specs/tree/master/api",children:"Starknet's JSON-RPC API"}),". Since JSON-RPC v0.6.0, to find out which JSON-RPC version is supported by which Devnet version, check out the ",(0,i.jsx)(t.a,{href:"https://github.com/0xspaceshard/starknet-devnet-rs/releases",children:"releases page"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"devnet-api",children:"Devnet API"}),"\n",(0,i.jsx)(t.p,{children:"Devnet has many additional features which are available via their own endpoints and JSON-RPC, which are all mentioned throughout the documentation."}),"\n",(0,i.jsx)(t.h2,{id:"interacting-with-devnet-in-javascript-and-typescript",children:"Interacting with Devnet in JavaScript and TypeScript"}),"\n",(0,i.jsxs)(t.p,{children:["To interact with Devnet using the ",(0,i.jsx)(t.a,{href:"#devnet-api",children:"Devnet API"}),", you can use ",(0,i.jsx)(t.a,{href:"https://github.com/0xSpaceShard/starknet-devnet-js/",children:(0,i.jsx)(t.code,{children:"starknet-devnet-js"})}),". This can be especially useful in achieving ",(0,i.jsx)(t.a,{href:"/starknet-devnet-rs/docs/postman#l1-l2-interaction-via-postman",children:"L1-L2 communication"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["To interact with Devnet usings the ",(0,i.jsx)(t.a,{href:"#starknet-api",children:"Starknet API"}),", use ",(0,i.jsx)(t.a,{href:"https://www.starknetjs.com/",children:"starknet.js"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"config-api",children:"Config API"}),"\n",(0,i.jsxs)(t.p,{children:["To retrieve the current configuration of Devnet, send a ",(0,i.jsx)(t.code,{children:"GET"})," request to ",(0,i.jsx)(t.code,{children:"/config"})," or ",(0,i.jsx)(t.code,{children:"JSON-RPC"})," request with method name ",(0,i.jsx)(t.code,{children:"devnet_getConfig"}),". Example response is attached below. It can be interpreted as a JSON mapping of CLI input parameters, both specified and default ones, with some irrelevant parameters omitted. So use ",(0,i.jsx)(t.code,{children:"starknet-devnet --help"})," to better understand the meaning of each value, though keep in mind that some of the parameters have slightly modified names."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-json",children:'{\n "seed": 4063802897,\n "total_accounts": 10,\n "account_contract_class_hash": "0x61dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",\n "predeployed_accounts_initial_balance": "1000000000000000000000",\n "start_time": null,\n "gas_price_wei": 100000000000,\n "gas_price_strk": 100000000000,\n "data_gas_price_wei": 100000000000,\n "data_gas_price_strk": 100000000000,\n "chain_id": "SN_SEPOLIA",\n "dump_on": "exit",\n "dump_path": "dump_path.json",\n "state_archive": "none",\n "fork_config": {\n "url": "http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7",\n "block_number": 26429\n },\n "server_config": {\n "host": "127.0.0.1",\n "port": 5050,\n "timeout": 120,\n "request_body_size_limit": 2000000\n },\n "block_generation": null,\n "lite_mode": false\n}\n'})})]})}function l(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>c});var i=n(6540);const a={},s=i.createContext(a);function r(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e120dcd9.466337be.js b/assets/js/e120dcd9.466337be.js new file mode 100644 index 000000000..aa8c742a1 --- /dev/null +++ b/assets/js/e120dcd9.466337be.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9337],{9120:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>d});var o=t(4848),s=t(8453);const i={},a="Account impersonation",r={id:"account-impersonation",title:"Account impersonation",description:"This page is about account impersonation. To read about account class selection and deployment, click here.",source:"@site/versioned_docs/version-0.1.1/account-impersonation.md",sourceDirName:".",slug:"/account-impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/account-impersonation.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"CLI options",permalink:"/starknet-devnet-rs/docs/running/cli"},next:{title:"API",permalink:"/starknet-devnet-rs/docs/api"}},c={},d=[{value:"Introduction",id:"introduction",level:2},{value:"Disabling impersonation",id:"disabling-impersonation",level:2},{value:"API",id:"api",level:2},{value:"devnet_impersonateAccount",id:"devnet_impersonateaccount",level:3},{value:"devnet_stopImpersonateAccount",id:"devnet_stopimpersonateaccount",level:3},{value:"devnet_autoImpersonate",id:"devnet_autoimpersonate",level:3},{value:"devnet_stopAutoImpersonate",id:"devnet_stopautoimpersonate",level:3}];function l(n){const e={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h1,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsx)(e.admonition,{type:"info",children:(0,o.jsxs)(e.p,{children:["This page is about account impersonation. To read about account class selection and deployment, click ",(0,o.jsx)(e.a,{href:"./predeployed",children:"here"}),"."]})}),"\n",(0,o.jsx)(e.h2,{id:"introduction",children:"Introduction"}),"\n",(0,o.jsxs)(e.p,{children:["Devnet allows you to use impersonated account from mainnet/testnet. This means that a transaction sent from an impersonated account will not fail with an invalid signature error. In the general case, a transaction sent with an account that is not in the local state fails with the aforementioned error. For impersonation to work, Devnet needs to be run in ",(0,o.jsx)(e.a,{href:"/starknet-devnet-rs/docs/forking",children:"forking mode"}),"."]}),"\n",(0,o.jsx)(e.admonition,{title:"Caveat",type:"warning",children:(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["Only ",(0,o.jsx)(e.code,{children:"INVOKE"})," and ",(0,o.jsx)(e.code,{children:"DECLARE"})," transactions are supported. ",(0,o.jsx)(e.code,{children:"DEPLOY_ACCOUNT"})," transaction is not supported, but you can create an ",(0,o.jsx)(e.code,{children:"INVOKE"})," transaction to UDC."]}),"\n",(0,o.jsx)(e.li,{children:"Overall fee, for transactions sent with an impersonated account, will be lower compared to normal transactions. The reason is that validation part is skipped."}),"\n",(0,o.jsxs)(e.li,{children:["The most common way of sending a transaction is via starknet-rs/starknet.js or starkli. Trying to send with an account that ",(0,o.jsx)(e.strong,{children:"does not"})," exist even in the origin network will return an error:","\n",(0,o.jsxs)(e.ul,{children:["\n",(0,o.jsxs)(e.li,{children:["In transaction construction, if account nonce is not hardcoded, Devnet is queried and returns ",(0,o.jsx)(e.code,{children:"ContractNotFound"}),"."]}),"\n",(0,o.jsxs)(e.li,{children:["Otherwise the nonce fetching part is skipped and ",(0,o.jsx)(e.code,{children:"InsufficientAccountBalance"})," is returned."]}),"\n"]}),"\n"]}),"\n"]})}),"\n",(0,o.jsx)(e.h2,{id:"disabling-impersonation",children:"Disabling impersonation"}),"\n",(0,o.jsxs)(e.p,{children:["Users can disable account impersonation by starting Devnet with CLI flag ",(0,o.jsx)(e.code,{children:"--disable-account-impersonation"})," or by setting environment variable ",(0,o.jsx)(e.code,{children:"DISABLE_ACCOUNT_IMPERSONATION"}),". Every subsequent JSON-RPC impersonation request will return an error. This feature can be used in CTFs to prevent participants from easily solving the task."]}),"\n",(0,o.jsx)(e.h2,{id:"api",children:"API"}),"\n",(0,o.jsx)(e.p,{children:"Account impersonation follows JSON-RPC method specification. Each method returns an empty response:"}),"\n",(0,o.jsx)(e.h3,{id:"devnet_impersonateaccount",children:"devnet_impersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Impersonates a specific account address nonexistent in the local state."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_impersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopimpersonateaccount",children:"devnet_stopImpersonateAccount"}),"\n",(0,o.jsx)(e.p,{children:"Stops the impersonation of an account previously marked for impersonation."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopImpersonateAccount",\n "params": {\n "account_address": "0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7"\n }\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_autoimpersonate",children:"devnet_autoImpersonate"}),"\n",(0,o.jsx)(e.p,{children:"Enables automatic account impersonation. Every account that does not exist in the local state will be impersonated."}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_autoImpersonate",\n "params": {}\n}\n'})}),"\n",(0,o.jsx)(e.h3,{id:"devnet_stopautoimpersonate",children:"devnet_stopAutoImpersonate"}),"\n",(0,o.jsxs)(e.p,{children:["Stops the effect of ",(0,o.jsx)(e.a,{href:"#devnet_autoimpersonate",children:"automatic impersonation"}),"."]}),"\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-js",children:'{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_stopAutoImpersonate",\n "params": {}\n}\n'})})]})}function p(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(l,{...n})}):l(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>a,x:()=>r});var o=t(6540);const s={},i=o.createContext(s);function a(n){const e=o.useContext(i);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:a(n.components),o.createElement(i.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/9875b4b5.0aaf62d5.js b/assets/js/e2538a57.55fbf779.js similarity index 68% rename from assets/js/9875b4b5.0aaf62d5.js rename to assets/js/e2538a57.55fbf779.js index b44a73d3d..37aa51a43 100644 --- a/assets/js/9875b4b5.0aaf62d5.js +++ b/assets/js/e2538a57.55fbf779.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9629],{2480:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>i});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",a={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/versioned_docs/version-0.0.7/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/predeployed.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/server-config"}},d={},i=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:["If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use ",(0,o.jsx)(n.a,{href:"./forking",children:"forking"}),". Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release."]}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet."]})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7883],{2889:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>p,frontMatter:()=>r,metadata:()=>d,toc:()=>i});var o=t(4848),c=t(8453);const r={},s="Predeployed contracts",d={id:"predeployed",title:"Predeployed contracts",description:"Devnet predeploys a UDC, an ERC20 (fee token) contract and a set of predeployed funded accounts.",source:"@site/versioned_docs/version-0.1.1/predeployed.md",sourceDirName:".",slug:"/predeployed",permalink:"/starknet-devnet-rs/docs/predeployed",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/predeployed.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"L1-L2 interaction via Postman",permalink:"/starknet-devnet-rs/docs/postman"},next:{title:"Server config",permalink:"/starknet-devnet-rs/docs/server-config"}},a={},i=[{value:"Account class selection",id:"account-class-selection",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2},{value:"How to get predeployment info?",id:"how-to-get-predeployment-info",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"predeployed-contracts",children:"Predeployed contracts"}),"\n",(0,o.jsxs)(n.p,{children:["Devnet predeploys a ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.6.1/udc",children:"UDC"}),", an ",(0,o.jsx)(n.a,{href:"https://docs.openzeppelin.com/contracts-cairo/0.8.1/erc20",children:"ERC20 (fee token)"})," contract and a set of predeployed funded accounts."]}),"\n",(0,o.jsxs)(n.p,{children:["The set of accounts can be controlled via ",(0,o.jsx)(n.a,{href:"./running/cli",children:"CLI options"}),": ",(0,o.jsx)(n.code,{children:"--accounts "}),", ",(0,o.jsx)(n.code,{children:"--initial-balance "}),", ",(0,o.jsx)(n.code,{children:"--seed "}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"account-class-selection",children:"Account class selection"}),"\n",(0,o.jsx)(n.p,{children:"Choose between predeploying Cairo 0 (OpenZeppelin 0.5.1) or Cairo 1 (default; OpenZeppelin 0.8.1) accounts by using:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class [cairo0 | cairo1]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Alternatively, provide a path to the ",(0,o.jsx)(n.a,{href:"https://github.com/starkware-libs/cairo#compiling-and-running-cairo-files",children:"Sierra artifact"})," of your custom account using:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"--account-class-custom \n"})}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:["If you want to deploy an instance of an account contract class not predeclared on Devnet, you can use ",(0,o.jsx)(n.a,{href:"./forking",children:"forking"}),". Just fork an origin network which has the needed class already declared, e.g. the Sepolia testnet. Why? Because new versions of wallets like ArgentX and Braavos tend to be declared on testnet/mainnet soon after release."]}),"\n",(0,o.jsx)(n.h2,{id:"how-to-get-predeployment-info",children:"How to get predeployment info?"}),"\n",(0,o.jsxs)(n.p,{children:["The predeployment information is logged on Devnet startup. Predeployed accounts can be retrieved in JSON format by sending a ",(0,o.jsx)(n.code,{children:"GET"})," request to ",(0,o.jsx)(n.code,{children:"/predeployed_accounts"})," of your Devnet or ",(0,o.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,o.jsx)(n.code,{children:"devnet_getPredeployedAccounts"}),". With additional query string ",(0,o.jsx)(n.code,{children:"with_balance=true"})," WEI and FRI balances at the pending state will be provided."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"GET /predeployed_accounts?with_balance=true\n"})})]})}function p(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>d});var o=t(6540);const c={},r=o.createContext(c);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e2f00550.76a5e6d2.js b/assets/js/e2f00550.76a5e6d2.js deleted file mode 100644 index a06bcbc8c..000000000 --- a/assets/js/e2f00550.76a5e6d2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6286],{3687:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>s,metadata:()=>o,toc:()=>d});var a=t(4848),i=t(8453);const s={},r="API",o={id:"api",title:"API",description:"Starknet API",source:"@site/versioned_docs/version-0.0.7/api.md",sourceDirName:".",slug:"/api",permalink:"/starknet-devnet-rs/docs/api",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/api.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/account-impersonation"},next:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/balance"}},c={},d=[{value:"Starknet API",id:"starknet-api",level:2},{value:"Devnet API",id:"devnet-api",level:2},{value:"Config API",id:"config-api",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"api",children:"API"}),"\n",(0,a.jsx)(n.h2,{id:"starknet-api",children:"Starknet API"}),"\n",(0,a.jsxs)(n.p,{children:["Unlike Pythonic Devnet, which also supported Starknet's gateway and feeder gateway API, Devnet in Rust supports Starknet's JSON-RPC API. Since JSON-RPC v0.6.0, to find out which JSON-RPC version is supported by which Devnet version, check out the ",(0,a.jsx)(n.a,{href:"https://github.com/0xspaceshard/starknet-devnet-rs/releases",children:"releases page"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["The JSON-RPC API is reachable via ",(0,a.jsx)(n.code,{children:"/rpc"})," and ",(0,a.jsx)(n.code,{children:"/"})," (e.g. if spawning Devnet with default settings, these URLs are functionally equivalent: ",(0,a.jsx)(n.code,{children:"http://127.0.0.1:5050/rpc"})," and ",(0,a.jsx)(n.code,{children:"http://127.0.0.1:5050/"}),")"]}),"\n",(0,a.jsx)(n.h2,{id:"devnet-api",children:"Devnet API"}),"\n",(0,a.jsx)(n.p,{children:"Devnet has many other functional features which are available via their own endpoints, which are all mentioned throughout the documentation."}),"\n",(0,a.jsx)(n.h2,{id:"config-api",children:"Config API"}),"\n",(0,a.jsxs)(n.p,{children:["To retrieve the current configuration of Devnet, send a ",(0,a.jsx)(n.code,{children:"GET"})," request to ",(0,a.jsx)(n.code,{children:"/config"}),". Example response is attached below. It can be interpreted as a JSON mapping of CLI input parameters, both specified and default ones, with some irrelevant parameters omitted. So use ",(0,a.jsx)(n.code,{children:"starknet-devnet --help"})," to better understand the meaning of each value, though keep in mind that some of the parameters have slightly modified names."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "seed": 4063802897,\n "total_accounts": 10,\n "account_contract_class_hash": "0x61dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",\n "predeployed_accounts_initial_balance": "1000000000000000000000",\n "start_time": null,\n "gas_price_wei": 100000000000,\n "gas_price_strk": 100000000000,\n "data_gas_price_wei": 100000000000,\n "data_gas_price_strk": 100000000000,\n "chain_id": "SN_SEPOLIA",\n "dump_on": "exit",\n "dump_path": "dump_path.json",\n "state_archive": "none",\n "fork_config": {\n "url": "http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7",\n "block_number": 26429\n },\n "server_config": {\n "host": "127.0.0.1",\n "port": 5050,\n "timeout": 120,\n "request_body_size_limit": 2000000\n },\n "blocks_on_demand": false,\n "lite_mode": false\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var a=t(6540);const i={},s=a.createContext(i);function r(e){const n=a.useContext(s);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e2f00550.8ca4e8a2.js b/assets/js/e2f00550.8ca4e8a2.js new file mode 100644 index 000000000..428a47400 --- /dev/null +++ b/assets/js/e2f00550.8ca4e8a2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6286],{3687:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>s,metadata:()=>o,toc:()=>d});var a=t(4848),i=t(8453);const s={},r="API",o={id:"api",title:"API",description:"Starknet API",source:"@site/versioned_docs/version-0.0.7/api.md",sourceDirName:".",slug:"/api",permalink:"/starknet-devnet-rs/docs/0.0.7/api",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/api.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Account impersonation",permalink:"/starknet-devnet-rs/docs/0.0.7/account-impersonation"},next:{title:"Account balance",permalink:"/starknet-devnet-rs/docs/0.0.7/balance"}},c={},d=[{value:"Starknet API",id:"starknet-api",level:2},{value:"Devnet API",id:"devnet-api",level:2},{value:"Config API",id:"config-api",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"api",children:"API"}),"\n",(0,a.jsx)(n.h2,{id:"starknet-api",children:"Starknet API"}),"\n",(0,a.jsxs)(n.p,{children:["Unlike Pythonic Devnet, which also supported Starknet's gateway and feeder gateway API, Devnet in Rust supports Starknet's JSON-RPC API. Since JSON-RPC v0.6.0, to find out which JSON-RPC version is supported by which Devnet version, check out the ",(0,a.jsx)(n.a,{href:"https://github.com/0xspaceshard/starknet-devnet-rs/releases",children:"releases page"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["The JSON-RPC API is reachable via ",(0,a.jsx)(n.code,{children:"/rpc"})," and ",(0,a.jsx)(n.code,{children:"/"})," (e.g. if spawning Devnet with default settings, these URLs are functionally equivalent: ",(0,a.jsx)(n.code,{children:"http://127.0.0.1:5050/rpc"})," and ",(0,a.jsx)(n.code,{children:"http://127.0.0.1:5050/"}),")"]}),"\n",(0,a.jsx)(n.h2,{id:"devnet-api",children:"Devnet API"}),"\n",(0,a.jsx)(n.p,{children:"Devnet has many other functional features which are available via their own endpoints, which are all mentioned throughout the documentation."}),"\n",(0,a.jsx)(n.h2,{id:"config-api",children:"Config API"}),"\n",(0,a.jsxs)(n.p,{children:["To retrieve the current configuration of Devnet, send a ",(0,a.jsx)(n.code,{children:"GET"})," request to ",(0,a.jsx)(n.code,{children:"/config"}),". Example response is attached below. It can be interpreted as a JSON mapping of CLI input parameters, both specified and default ones, with some irrelevant parameters omitted. So use ",(0,a.jsx)(n.code,{children:"starknet-devnet --help"})," to better understand the meaning of each value, though keep in mind that some of the parameters have slightly modified names."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "seed": 4063802897,\n "total_accounts": 10,\n "account_contract_class_hash": "0x61dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",\n "predeployed_accounts_initial_balance": "1000000000000000000000",\n "start_time": null,\n "gas_price_wei": 100000000000,\n "gas_price_strk": 100000000000,\n "data_gas_price_wei": 100000000000,\n "data_gas_price_strk": 100000000000,\n "chain_id": "SN_SEPOLIA",\n "dump_on": "exit",\n "dump_path": "dump_path.json",\n "state_archive": "none",\n "fork_config": {\n "url": "http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7",\n "block_number": 26429\n },\n "server_config": {\n "host": "127.0.0.1",\n "port": 5050,\n "timeout": 120,\n "request_body_size_limit": 2000000\n },\n "blocks_on_demand": false,\n "lite_mode": false\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var a=t(6540);const i={},s=a.createContext(i);function r(e){const n=a.useContext(s);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),a.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e8953dad.ac67425e.js b/assets/js/e3e59843.3ed551b6.js similarity index 93% rename from assets/js/e8953dad.ac67425e.js rename to assets/js/e3e59843.3ed551b6.js index e7acda9ad..fd51b03cd 100644 --- a/assets/js/e8953dad.ac67425e.js +++ b/assets/js/e3e59843.3ed551b6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3768],{1051:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=t(4848),r=t(8453);const i={},a="Forking",c={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/versioned_docs/version-0.0.7/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/forking.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/historic-state"}},s={},d=[{value:"Account impersonation",id:"account-impersonation",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(n.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The value passed to ",(0,o.jsx)(n.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(n.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(n.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(n.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./predeployed#deploying-an-undeclared-account",children:"Here"})," you can read about deploying an account not declared on Devnet."]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(6540);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9497],{8354:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=t(4848),r=t(8453);const i={},a="Forking",c={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/versioned_docs/version-0.1.1/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/forking.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/historic-state"}},s={},d=[{value:"Account impersonation",id:"account-impersonation",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(n.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The value passed to ",(0,o.jsx)(n.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(n.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(n.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(n.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./predeployed#deploying-an-undeclared-account",children:"Here"})," you can read about deploying an account not declared on Devnet."]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(6540);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e8953dad.d8af09d8.js b/assets/js/e8953dad.d8af09d8.js new file mode 100644 index 000000000..9dd7f424c --- /dev/null +++ b/assets/js/e8953dad.d8af09d8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3768],{1051:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=t(4848),r=t(8453);const i={},a="Forking",c={id:"forking",title:"Forking",description:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself.",source:"@site/versioned_docs/version-0.0.7/forking.md",sourceDirName:".",slug:"/forking",permalink:"/starknet-devnet-rs/docs/0.0.7/forking",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/forking.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Dump, load, restart",permalink:"/starknet-devnet-rs/docs/0.0.7/dump-load-restart"},next:{title:"Historic state support",permalink:"/starknet-devnet-rs/docs/0.0.7/historic-state"}},s={},d=[{value:"Account impersonation",id:"account-impersonation",level:2},{value:"Deploying an undeclared account",id:"deploying-an-undeclared-account",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"forking",children:"Forking"}),"\n",(0,o.jsx)(n.p,{children:"To interact with contracts deployed on mainnet or testnet, you can use forking. Simulate the origin and experiment with it locally, making no changes to the origin itself."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ starknet-devnet --fork-network [--fork-block ]\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The value passed to ",(0,o.jsx)(n.code,{children:"--fork-network"})," should be the URL to a Starknet JSON-RPC API provider. Specifying a ",(0,o.jsx)(n.code,{children:"--fork-block"})," is optional; it defaults to the ",(0,o.jsx)(n.code,{children:'"latest"'})," block at the time of Devnet's start-up. All calls will first try Devnet's state and then fall back to the forking block."]}),"\n",(0,o.jsx)(n.h2,{id:"account-impersonation",children:"Account impersonation"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./account-impersonation",children:"Here"})," you can read more about acting as an account deployed on the origin."]}),"\n",(0,o.jsx)(n.h2,{id:"deploying-an-undeclared-account",children:"Deploying an undeclared account"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"./predeployed#deploying-an-undeclared-account",children:"Here"})," you can read about deploying an account not declared on Devnet."]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var o=t(6540);const r={},i=o.createContext(r);function a(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ef2a8751.55c47ebe.js b/assets/js/ef2a8751.55c47ebe.js new file mode 100644 index 000000000..e7e9fc769 --- /dev/null +++ b/assets/js/ef2a8751.55c47ebe.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3124],{6805:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var d=t(4848),r=t(8453);const s={},o="Dump, load, restart",i={id:"dump-load-restart",title:"Dump, load, restart",description:"Dumping",source:"@site/versioned_docs/version-0.1.1/dump-load-restart.md",sourceDirName:".",slug:"/dump-load-restart",permalink:"/starknet-devnet-rs/docs/dump-load-restart",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/dump-load-restart.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Blocks",permalink:"/starknet-devnet-rs/docs/blocks"},next:{title:"Forking",permalink:"/starknet-devnet-rs/docs/forking"}},a={},l=[{value:"Dumping",id:"dumping",level:2},{value:"Loading",id:"loading",level:2},{value:"Loading disclaimer",id:"loading-disclaimer",level:3},{value:"Restarting",id:"restarting",level:2},{value:"Docker",id:"docker",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h1,{id:"dump-load-restart",children:"Dump, load, restart"}),"\n",(0,d.jsx)(n.h2,{id:"dumping",children:"Dumping"}),"\n",(0,d.jsx)(n.p,{children:"To preserve your Devnet instance for future use, these are the options:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Dumping on exit (handles Ctrl+C, i.e. SIGINT; doesn't handle SIGKILL):"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-on exit --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Dumping after each block:"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-on block --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Dumping on request requires providing --dump-on mode on the startup. Example usage in ",(0,d.jsx)(n.code,{children:"exit"})," mode (replace ",(0,d.jsx)(n.code,{children:""}),", ",(0,d.jsx)(n.code,{children:""})," and ",(0,d.jsx)(n.code,{children:""})," with your own):"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'$ starknet-devnet --dump-on exit --dump-path \n$ curl -X POST http://:/dump -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_dump",\n "params": {\n "path": PATH\n }\n}\n'})}),"\n",(0,d.jsx)(n.h2,{id:"loading",children:"Loading"}),"\n",(0,d.jsx)(n.p,{children:"To load a preserved Devnet instance, the options are:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Loading on startup (note the argument name is not ",(0,d.jsx)(n.code,{children:"--load-path"})," as it was in Devnet-py):"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$ starknet-devnet --dump-path \n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"Loading on request:"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'curl -X POST http://:/load -d \'{ "path": }\' -H "Content-Type: application/json"\n'})}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_load",\n "params": {\n "path": PATH\n }\n}\n'})}),"\n",(0,d.jsxs)(n.p,{children:["Currently, dumping produces a list of received transactions that is stored on disk. Conversely, loading is implemented as the re-execution of transactions from a dump. This means that timestamps of ",(0,d.jsx)(n.code,{children:"StarknetBlock"})," will be different on each load."]}),"\n",(0,d.jsx)(n.h3,{id:"loading-disclaimer",children:"Loading disclaimer"}),"\n",(0,d.jsx)(n.p,{children:"Dumping and loading are not guaranteed to work across versions. I.e. if you dumped one version of Devnet, do not expect it to be loadable with a different version."}),"\n",(0,d.jsxs)(n.p,{children:["If you dumped a Devnet utilizing one class for account predeployment (e.g. ",(0,d.jsx)(n.code,{children:"--account-class cairo0"}),"), you should use the same option when loading. The same applies for dumping a Devnet in ",(0,d.jsx)(n.code,{children:"--block-generation-on demand"})," mode."]}),"\n",(0,d.jsx)(n.h2,{id:"restarting",children:"Restarting"}),"\n",(0,d.jsxs)(n.p,{children:["Devnet can be restarted by making a ",(0,d.jsx)(n.code,{children:"POST /restart"})," request (no body required) or ",(0,d.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,d.jsx)(n.code,{children:"devnet_restart"}),". All of the deployed contracts (including predeployed), blocks and storage updates will be restarted to the original state, without the transactions and requests that may have been loaded from a dump file on startup."]}),"\n",(0,d.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,d.jsx)(n.p,{children:"To enable dumping and loading with dockerized Devnet, you must bind the container path to the path on your host machine."}),"\n",(0,d.jsx)(n.p,{children:"This example:"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["Relies on ",(0,d.jsx)(n.a,{href:"https://docs.docker.com/storage/bind-mounts/",children:"Docker bind mount"}),"; try ",(0,d.jsx)(n.a,{href:"https://docs.docker.com/storage/volumes/",children:"Docker volume"})," instead."]}),"\n",(0,d.jsxs)(n.li,{children:["Assumes that ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir"})," exists. If unsure, use absolute paths."]}),"\n",(0,d.jsxs)(n.li,{children:["Assumes you are listening on ",(0,d.jsx)(n.code,{children:"127.0.0.1:5050"}),"."]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["If there is ",(0,d.jsx)(n.code,{children:"mydump"})," inside ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir"}),", you can load it with:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-path /path/to/dumpdir/mydump\n"})}),"\n",(0,d.jsxs)(n.p,{children:["To dump to ",(0,d.jsx)(n.code,{children:"/path/to/dumpdir/mydump"})," on Devnet shutdown, run:"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"docker run \\\n -p 127.0.0.1:5050:5050 \\\n --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \\\n shardlabs/starknet-devnet-rs \\\n --dump-on exit --dump-path /path/to/dumpdir/mydump\n"})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>i});var d=t(6540);const r={},s=d.createContext(r);function o(e){const n=d.useContext(s);return d.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),d.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/16a2713f.7d2fd4b2.js b/assets/js/f44adc48.565b24cf.js similarity index 78% rename from assets/js/16a2713f.7d2fd4b2.js rename to assets/js/f44adc48.565b24cf.js index fab0bee21..5f2995acc 100644 --- a/assets/js/16a2713f.7d2fd4b2.js +++ b/assets/js/f44adc48.565b24cf.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2412],{4103:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=t(4848),s=t(8453);const i={},o="Server config",d={id:"server-config",title:"Server config",description:"To read generally about ways to configure your Devnet instance, check out the CLI section.",source:"@site/versioned_docs/version-0.0.7/server-config.md",sourceDirName:".",slug:"/server-config",permalink:"/starknet-devnet-rs/docs/server-config",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.0.7/server-config.md",tags:[],version:"0.0.7",frontMatter:{},sidebar:"docSidebar",previous:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/predeployed"},next:{title:"Starknet time",permalink:"/starknet-devnet-rs/docs/starknet-time"}},c={},l=[{value:"Host and port",id:"host-and-port",level:2},{value:"Logging",id:"logging",level:2},{value:"Timeout",id:"timeout",level:2},{value:"Request body size limit",id:"request-body-size-limit",level:2},{value:"API",id:"api",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"server-config",children:"Server config"}),"\n",(0,r.jsxs)(n.p,{children:["To read generally about ways to configure your Devnet instance, check out the ",(0,r.jsx)(n.a,{href:"/starknet-devnet-rs/docs/running/cli",children:"CLI section"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"host-and-port",children:"Host and port"}),"\n",(0,r.jsxs)(n.p,{children:["Specify the host and the port used by the server with ",(0,r.jsx)(n.code,{children:"--host
"})," and ",(0,r.jsx)(n.code,{children:"--port "})," CLI arguments. If running with Docker, check out the ",(0,r.jsx)(n.a,{href:"./running/docker#container-port-publishing",children:"port publishing docs"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"logging",children:"Logging"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the logging level is ",(0,r.jsx)(n.code,{children:"INFO"}),", but this can be changed via the ",(0,r.jsx)(n.code,{children:"RUST_LOG"})," environment variable."]}),"\n",(0,r.jsxs)(n.p,{children:["All logging levels: ",(0,r.jsx)(n.code,{children:"TRACE"}),", ",(0,r.jsx)(n.code,{children:"DEBUG"}),", ",(0,r.jsx)(n.code,{children:"INFO"}),", ",(0,r.jsx)(n.code,{children:"WARN"}),", ",(0,r.jsx)(n.code,{children:"ERROR"})]}),"\n",(0,r.jsx)(n.p,{children:"To specify the logging level and run Devnet on the same line:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ RUST_LOG= starknet-devnet\n"})}),"\n",(0,r.jsx)(n.p,{children:"or if using dockerized Devnet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker run -e RUST_LOG= shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By default, logging of request and response data is turned off.\nTo see the request and/or response body, additional levels can be specified via the ",(0,r.jsx)(n.code,{children:"RUST_LOG"})," environment variable: ",(0,r.jsx)(n.code,{children:"REQUEST"})," for request body, ",(0,r.jsx)(n.code,{children:"RESPONSE"})," for response body."]}),"\n",(0,r.jsxs)(n.admonition,{type:"note",children:[(0,r.jsxs)(n.p,{children:["Logging request and response requires at least logging level ",(0,r.jsx)(n.code,{children:"INFO"}),"."]}),(0,r.jsxs)(n.p,{children:["For example, the following two commands will log request and response data with log level ",(0,r.jsx)(n.code,{children:"INFO"}),"."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ RUST_LOG="REQUEST,RESPONSE" starknet-devnet\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ RUST_LOG="REQUEST,RESPONSE,INFO" starknet-devnet\n'})})]}),"\n",(0,r.jsx)(n.h2,{id:"timeout",children:"Timeout"}),"\n",(0,r.jsx)(n.p,{children:"Specify the maximum amount of time an HTTP request can be served. This makes it possible to deploy and manage large contracts that take longer to execute."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --timeout \n"})}),"\n",(0,r.jsx)(n.h2,{id:"request-body-size-limit",children:"Request body size limit"}),"\n",(0,r.jsx)(n.p,{children:"Specify the maximum size of an incoming HTTP request body. This makes it possible to deploy and manage large contracts that take up more space."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --request-body-size-limit \n"})}),"\n",(0,r.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,r.jsxs)(n.p,{children:["Retrieve the server config by sending a ",(0,r.jsx)(n.code,{children:"GET"})," request to ",(0,r.jsx)(n.code,{children:"/config"})," and extracting its ",(0,r.jsx)(n.code,{children:"server_config"})," property."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ curl localhost:5050/config | jq .server_config\n"})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>d});var r=t(6540);const s={},i=r.createContext(s);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4643],{9922:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var r=t(4848),s=t(8453);const i={},o="Server config",d={id:"server-config",title:"Server config",description:"To read generally about ways to configure your Devnet instance, check out the CLI section.",source:"@site/versioned_docs/version-0.1.1/server-config.md",sourceDirName:".",slug:"/server-config",permalink:"/starknet-devnet-rs/docs/server-config",draft:!1,unlisted:!1,editUrl:"https://github.com/0xSpaceShard/starknet-devnet-rs/blob/master/website/versioned_docs/version-0.1.1/server-config.md",tags:[],version:"0.1.1",frontMatter:{},sidebar:"docSidebar",previous:{title:"Predeployed contracts",permalink:"/starknet-devnet-rs/docs/predeployed"},next:{title:"Starknet time",permalink:"/starknet-devnet-rs/docs/starknet-time"}},c={},l=[{value:"Host and port",id:"host-and-port",level:2},{value:"Logging",id:"logging",level:2},{value:"Timeout",id:"timeout",level:2},{value:"Request body size limit",id:"request-body-size-limit",level:2},{value:"API",id:"api",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"server-config",children:"Server config"}),"\n",(0,r.jsxs)(n.p,{children:["To read generally about ways to configure your Devnet instance, check out the ",(0,r.jsx)(n.a,{href:"/starknet-devnet-rs/docs/running/cli",children:"CLI section"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"host-and-port",children:"Host and port"}),"\n",(0,r.jsxs)(n.p,{children:["Specify the host and the port used by the server with ",(0,r.jsx)(n.code,{children:"--host
"})," and ",(0,r.jsx)(n.code,{children:"--port "})," CLI arguments. If running with Docker, check out the ",(0,r.jsx)(n.a,{href:"./running/docker#container-port-publishing",children:"port publishing docs"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"logging",children:"Logging"}),"\n",(0,r.jsxs)(n.p,{children:["By default, the logging level is ",(0,r.jsx)(n.code,{children:"INFO"}),", but this can be changed via the ",(0,r.jsx)(n.code,{children:"RUST_LOG"})," environment variable."]}),"\n",(0,r.jsxs)(n.p,{children:["All logging levels: ",(0,r.jsx)(n.code,{children:"TRACE"}),", ",(0,r.jsx)(n.code,{children:"DEBUG"}),", ",(0,r.jsx)(n.code,{children:"INFO"}),", ",(0,r.jsx)(n.code,{children:"WARN"}),", ",(0,r.jsx)(n.code,{children:"ERROR"})]}),"\n",(0,r.jsx)(n.p,{children:"To specify the logging level and run Devnet on the same line:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ RUST_LOG= starknet-devnet\n"})}),"\n",(0,r.jsx)(n.p,{children:"or if using dockerized Devnet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ docker run -e RUST_LOG= shardlabs/starknet-devnet-rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By default, logging of request and response data is turned off.\nTo see the request and/or response body, additional levels can be specified via the ",(0,r.jsx)(n.code,{children:"RUST_LOG"})," environment variable: ",(0,r.jsx)(n.code,{children:"REQUEST"})," for request body, ",(0,r.jsx)(n.code,{children:"RESPONSE"})," for response body."]}),"\n",(0,r.jsxs)(n.admonition,{type:"note",children:[(0,r.jsxs)(n.p,{children:["Logging request and response requires at least logging level ",(0,r.jsx)(n.code,{children:"INFO"}),"."]}),(0,r.jsxs)(n.p,{children:["For example, the following two commands will log request and response data with log level ",(0,r.jsx)(n.code,{children:"INFO"}),"."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ RUST_LOG="REQUEST,RESPONSE" starknet-devnet\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ RUST_LOG="REQUEST,RESPONSE,INFO" starknet-devnet\n'})})]}),"\n",(0,r.jsx)(n.h2,{id:"timeout",children:"Timeout"}),"\n",(0,r.jsx)(n.p,{children:"Specify the maximum amount of time an HTTP request can be served. This makes it possible to deploy and manage large contracts that take longer to execute."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --timeout \n"})}),"\n",(0,r.jsx)(n.h2,{id:"request-body-size-limit",children:"Request body size limit"}),"\n",(0,r.jsx)(n.p,{children:"Specify the maximum size of an incoming HTTP request body. This makes it possible to deploy and manage large contracts that take up more space."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ starknet-devnet --request-body-size-limit \n"})}),"\n",(0,r.jsx)(n.h2,{id:"api",children:"API"}),"\n",(0,r.jsxs)(n.p,{children:["Retrieve the server config by sending a ",(0,r.jsx)(n.code,{children:"GET"})," request to ",(0,r.jsx)(n.code,{children:"/config"})," or ",(0,r.jsx)(n.code,{children:"JSON-RPC"})," request with method name ",(0,r.jsx)(n.code,{children:"devnet_getConfig"})," and extracting its ",(0,r.jsx)(n.code,{children:"server_config"})," property."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"$ curl localhost:5050/config | jq .server_config\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'JSON-RPC\n{\n "jsonrpc": "2.0",\n "id": "1",\n "method": "devnet_getConfig"\n}\n'})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>d});var r=t(6540);const s={},i=r.createContext(s);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.0f3c2237.js b/assets/js/main.0f3c2237.js new file mode 100644 index 000000000..cab17e625 --- /dev/null +++ b/assets/js/main.0f3c2237.js @@ -0,0 +1,2 @@ +/*! For license information please see main.0f3c2237.js.LICENSE.txt */ +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8792],{8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});n(6540);var r=n(3259),a=n.n(r),o=n(4054);const i={"0657c530":[()=>n.e(5960).then(n.t.bind(n,2324,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-next-category-running-fae.json",2324],"0debafb6":[()=>n.e(7595).then(n.t.bind(n,548,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-0-0-6-category-running-c91.json",548],"0e384e19":[()=>n.e(3976).then(n.bind(n,1512)),"@site/docs/intro.md",1512],"1151f991":[()=>n.e(1914).then(n.bind(n,154)),"@site/versioned_docs/version-0.0.6/running/docker.md",154],"119a2918":[()=>n.e(6131).then(n.bind(n,5254)),"@site/versioned_docs/version-0.1.1/blocks.md",5254],"14eb3368":[()=>Promise.all([n.e(1869),n.e(6969)]).then(n.bind(n,7247)),"@theme/DocCategoryGeneratedIndexPage",7247],"16a2713f":[()=>n.e(2412).then(n.bind(n,4103)),"@site/versioned_docs/version-0.0.7/server-config.md",4103],17682634:[()=>n.e(4876).then(n.bind(n,828)),"@site/versioned_docs/version-0.0.6/blocks.md",828],17896441:[()=>Promise.all([n.e(1869),n.e(3658),n.e(8401)]).then(n.bind(n,3652)),"@theme/DocItem",3652],"1b560adb":[()=>n.e(1316).then(n.bind(n,2758)),"@site/versioned_docs/version-0.0.6/running/cli.md",2758],"1df93b7f":[()=>Promise.all([n.e(1869),n.e(4583)]).then(n.bind(n,5579)),"@site/src/pages/index.tsx",5579],"1e29fbdb":[()=>n.e(7780).then(n.bind(n,8660)),"@site/versioned_docs/version-0.1.1/running/cli.md",8660],"1f391b9e":[()=>Promise.all([n.e(1869),n.e(3658),n.e(6061)]).then(n.bind(n,7973)),"@theme/MDXPage",7973],"2146f16f":[()=>n.e(6773).then(n.bind(n,1017)),"@site/versioned_docs/version-0.0.7/account-impersonation.md",1017],24503201:[()=>n.e(4676).then(n.bind(n,8433)),"@site/docs/historic-state.md",8433],"28a0cb7e":[()=>n.e(141).then(n.bind(n,5040)),"@site/versioned_docs/version-0.1.1/postman.md",5040],"2d66ba60":[()=>n.e(952).then(n.bind(n,3946)),"@site/docs/forking.md",3946],"393be207":[()=>n.e(4134).then(n.bind(n,6602)),"@site/src/pages/markdown-page.md",6602],"3c883fc4":[()=>n.e(2871).then(n.bind(n,8432)),"@site/versioned_docs/version-0.0.6/forking.md",8432],"3f194bb7":[()=>n.e(337).then(n.bind(n,4647)),"@site/versioned_docs/version-0.0.6/historic-state.md",4647],"425e1ae2":[()=>n.e(2916).then(n.bind(n,1161)),"@site/versioned_docs/version-0.0.7/intro.md",1161],"4769fc4e":[()=>n.e(2627).then(n.bind(n,4570)),"@site/versioned_docs/version-0.0.6/postman.md",4570],"49885c5e":[()=>n.e(2828).then(n.bind(n,433)),"@site/versioned_docs/version-0.0.7/running/cli.md",433],"4adc7347":[()=>n.e(9736).then(n.bind(n,3806)),"@site/versioned_docs/version-0.1.1/balance.md",3806],"5402810c":[()=>n.e(5348).then(n.bind(n,1296)),"@site/versioned_docs/version-0.1.1/intro.md",1296],"5985dcf4":[()=>n.e(7969).then(n.bind(n,6127)),"@site/versioned_docs/version-0.0.7/running/docker.md",6127],"5b870ab8":[()=>n.e(9378).then(n.bind(n,8032)),"@site/versioned_docs/version-0.0.6/api.md",8032],"5e95c892":[()=>n.e(9647).then(n.bind(n,7121)),"@theme/DocsRoot",7121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"5fadd32f":[()=>n.e(562).then(n.bind(n,6920)),"@site/docs/account-impersonation.md",6920],"5fbc5cf1":[()=>n.e(7624).then(n.bind(n,8946)),"@site/docs/api.md",8946],"673b87a5":[()=>n.e(484).then(n.bind(n,3673)),"@site/versioned_docs/version-0.1.1/historic-state.md",3673],"682c6856":[()=>n.e(463).then(n.bind(n,5851)),"@site/versioned_docs/version-0.0.6/dump-load-restart.md",5851],"6d990bb1":[()=>n.e(2282).then(n.t.bind(n,7164,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-next-40c.json",7164],"778bcc8b":[()=>n.e(1527).then(n.bind(n,9260)),"@site/docs/starknet-time.md",9260],"7923f30a":[()=>n.e(9998).then(n.bind(n,2432)),"@site/versioned_docs/version-0.0.7/running/install.md",2432],"7b998695":[()=>n.e(646).then(n.bind(n,5833)),"@site/docs/running/install.md",5833],"80526ee6":[()=>n.e(5480).then(n.bind(n,2434)),"@site/versioned_docs/version-0.0.6/lite.md",2434],"8d820236":[()=>n.e(9440).then(n.bind(n,5266)),"@site/versioned_docs/version-0.0.6/starknet-time.md",5266],"8d981dc3":[()=>n.e(6017).then(n.bind(n,9823)),"@site/versioned_docs/version-0.0.7/balance.md",9823],"8e76450a":[()=>n.e(1437).then(n.t.bind(n,8287,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-0-0-7-808.json",8287],"8f2e4180":[()=>n.e(5771).then(n.t.bind(n,1651,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-category-running-b96.json",1651],"93f3c2aa":[()=>n.e(4291).then(n.bind(n,2640)),"@site/versioned_docs/version-0.1.1/lite.md",2640],"93f75803":[()=>n.e(7230).then(n.bind(n,1335)),"@site/versioned_docs/version-0.0.6/running/install.md",1335],"9875b4b5":[()=>n.e(9629).then(n.bind(n,2480)),"@site/versioned_docs/version-0.0.7/predeployed.md",2480],"9976ff42":[()=>n.e(6828).then(n.bind(n,9698)),"@site/versioned_docs/version-0.0.6/intro.md",9698],"9abfa349":[()=>n.e(2408).then(n.bind(n,8521)),"@site/versioned_docs/version-0.0.7/blocks.md",8521],"9b932233":[()=>n.e(5624).then(n.bind(n,8938)),"@site/versioned_docs/version-0.0.7/historic-state.md",8938],"9c3aeb12":[()=>n.e(1475).then(n.bind(n,8423)),"@site/versioned_docs/version-0.0.7/lite.md",8423],a0ea14c4:[()=>n.e(3956).then(n.bind(n,4207)),"@site/versioned_docs/version-0.0.6/server-config.md",4207],a56dc942:[()=>n.e(7817).then(n.bind(n,3024)),"@site/versioned_docs/version-0.1.1/running/docker.md",3024],a5ad27b1:[()=>n.e(5120).then(n.bind(n,6989)),"@site/docs/dump-load-restart.md",6989],a5e062ff:[()=>n.e(3726).then(n.bind(n,6909)),"@site/versioned_docs/version-0.0.7/postman.md",6909],a7456010:[()=>n.e(1235).then(n.t.bind(n,8552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a7bd4aaa:[()=>n.e(7098).then(n.bind(n,4532)),"@theme/DocVersionRoot",4532],a94703ab:[()=>Promise.all([n.e(1869),n.e(9048)]).then(n.bind(n,2559)),"@theme/DocRoot",2559],aba21aa0:[()=>n.e(5742).then(n.t.bind(n,7093,19)),"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],ad6bd692:[()=>n.e(6439).then(n.bind(n,9552)),"@site/versioned_docs/version-0.0.7/dump-load-restart.md",9552],ae603a5f:[()=>n.e(4290).then(n.bind(n,415)),"@site/versioned_docs/version-0.0.6/predeployed.md",415],b0477c6d:[()=>n.e(5186).then(n.bind(n,686)),"@site/docs/blocks.md",686],b1ee2929:[()=>n.e(8586).then(n.t.bind(n,2007,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-0-0-7-category-running-0d3.json",2007],b4513eec:[()=>n.e(1863).then(n.bind(n,9025)),"@site/docs/predeployed.md",9025],b7007dab:[()=>n.e(3950).then(n.bind(n,5873)),"@site/versioned_docs/version-0.1.1/running/install.md",5873],b7bb6147:[()=>n.e(134).then(n.bind(n,4214)),"@site/versioned_docs/version-0.0.6/account-impersonation.md",4214],b9f7b2ab:[()=>n.e(5700).then(n.bind(n,7516)),"@site/docs/running/cli.md",7516],ba738306:[()=>n.e(9167).then(n.bind(n,2693)),"@site/versioned_docs/version-0.0.7/starknet-time.md",2693],bca784a7:[()=>n.e(8626).then(n.bind(n,5787)),"@site/docs/postman.md",5787],c25a813d:[()=>n.e(598).then(n.bind(n,2952)),"@site/versioned_docs/version-0.0.6/balance.md",2952],c4d2e5c1:[()=>n.e(2134).then(n.bind(n,4500)),"@site/versioned_docs/version-0.1.1/starknet-time.md",4500],cc2baa30:[()=>n.e(9218).then(n.t.bind(n,8947,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-c2e.json",8947],cc3979e2:[()=>n.e(6900).then(n.bind(n,1304)),"@site/docs/lite.md",1304],def2ee80:[()=>n.e(6928).then(n.bind(n,1565)),"@site/versioned_docs/version-0.1.1/api.md",1565],e120dcd9:[()=>n.e(9337).then(n.bind(n,9120)),"@site/versioned_docs/version-0.1.1/account-impersonation.md",9120],e2538a57:[()=>n.e(7883).then(n.bind(n,2889)),"@site/versioned_docs/version-0.1.1/predeployed.md",2889],e28eadbb:[()=>n.e(3332).then(n.bind(n,1498)),"@site/docs/server-config.md",1498],e2f00550:[()=>n.e(6286).then(n.bind(n,3687)),"@site/versioned_docs/version-0.0.7/api.md",3687],e3e59843:[()=>n.e(9497).then(n.bind(n,8354)),"@site/versioned_docs/version-0.1.1/forking.md",8354],e44e17f8:[()=>n.e(6187).then(n.bind(n,2470)),"@site/docs/balance.md",2470],e81f6410:[()=>n.e(5532).then(n.t.bind(n,9186,19)),"@generated/docusaurus-plugin-content-docs/default/p/starknet-devnet-rs-docs-0-0-6-12a.json",9186],e8953dad:[()=>n.e(3768).then(n.bind(n,1051)),"@site/versioned_docs/version-0.0.7/forking.md",1051],eb78b783:[()=>n.e(7229).then(n.bind(n,9800)),"@site/docs/running/docker.md",9800],ef2a8751:[()=>n.e(3124).then(n.bind(n,6805)),"@site/versioned_docs/version-0.1.1/dump-load-restart.md",6805],f44adc48:[()=>n.e(4643).then(n.bind(n,9922)),"@site/versioned_docs/version-0.1.1/server-config.md",9922]};var s=n(4848);function l(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,s.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,s.jsx)("p",{children:String(t)}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,s.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,s.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,s.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,s.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var c=n(6921),u=n(3102);function d(e,t){if("*"===e)return a()({loading:l,loader:()=>n.e(2237).then(n.bind(n,2237)),modules:["@theme/NotFound"],webpack:()=>[2237],render(e,t){const n=e.default;return(0,s.jsx)(u.W,{value:{plugin:{name:"native",id:"default"}},children:(0,s.jsx)(n,{...t})})}});const r=o[`${e}-${t}`],d={},p=[],f=[],m=(0,c.A)(r);return Object.entries(m).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],p.push(r[1]),f.push(r[2]))})),a().Map({loading:l,loader:d,modules:p,webpack:()=>f,render(t,n){const a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let i=a;const s=n.split(".");s.slice(0,-1).forEach((e=>{i=i[e]})),i[s[s.length-1]]=o}));const o=a.__comp;delete a.__comp;const i=a.__context;delete a.__context;const l=a.__props;return delete a.__props,(0,s.jsx)(u.W,{value:i,children:(0,s.jsx)(o,{...a,...l,...n})})}})}const p=[{path:"/starknet-devnet-rs/markdown-page",component:d("/starknet-devnet-rs/markdown-page","05b"),exact:!0},{path:"/starknet-devnet-rs/docs",component:d("/starknet-devnet-rs/docs","e6a"),routes:[{path:"/starknet-devnet-rs/docs/0.0.6",component:d("/starknet-devnet-rs/docs/0.0.6","e49"),routes:[{path:"/starknet-devnet-rs/docs/0.0.6",component:d("/starknet-devnet-rs/docs/0.0.6","6ff"),routes:[{path:"/starknet-devnet-rs/docs/0.0.6/account-impersonation",component:d("/starknet-devnet-rs/docs/0.0.6/account-impersonation","c51"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/api",component:d("/starknet-devnet-rs/docs/0.0.6/api","8d2"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/balance",component:d("/starknet-devnet-rs/docs/0.0.6/balance","7dd"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/blocks",component:d("/starknet-devnet-rs/docs/0.0.6/blocks","548"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/category/running",component:d("/starknet-devnet-rs/docs/0.0.6/category/running","e17"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/dump-load-restart",component:d("/starknet-devnet-rs/docs/0.0.6/dump-load-restart","bb0"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/forking",component:d("/starknet-devnet-rs/docs/0.0.6/forking","52c"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/historic-state",component:d("/starknet-devnet-rs/docs/0.0.6/historic-state","544"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/intro",component:d("/starknet-devnet-rs/docs/0.0.6/intro","3d5"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/lite",component:d("/starknet-devnet-rs/docs/0.0.6/lite","4a2"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/postman",component:d("/starknet-devnet-rs/docs/0.0.6/postman","d2d"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/predeployed",component:d("/starknet-devnet-rs/docs/0.0.6/predeployed","122"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/running/cli",component:d("/starknet-devnet-rs/docs/0.0.6/running/cli","ebd"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/running/docker",component:d("/starknet-devnet-rs/docs/0.0.6/running/docker","760"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/running/install",component:d("/starknet-devnet-rs/docs/0.0.6/running/install","64d"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/server-config",component:d("/starknet-devnet-rs/docs/0.0.6/server-config","de5"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.6/starknet-time",component:d("/starknet-devnet-rs/docs/0.0.6/starknet-time","b54"),exact:!0,sidebar:"docSidebar"}]}]},{path:"/starknet-devnet-rs/docs/0.0.7",component:d("/starknet-devnet-rs/docs/0.0.7","389"),routes:[{path:"/starknet-devnet-rs/docs/0.0.7",component:d("/starknet-devnet-rs/docs/0.0.7","fcd"),routes:[{path:"/starknet-devnet-rs/docs/0.0.7/account-impersonation",component:d("/starknet-devnet-rs/docs/0.0.7/account-impersonation","67a"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/api",component:d("/starknet-devnet-rs/docs/0.0.7/api","478"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/balance",component:d("/starknet-devnet-rs/docs/0.0.7/balance","afb"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/blocks",component:d("/starknet-devnet-rs/docs/0.0.7/blocks","541"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/category/running",component:d("/starknet-devnet-rs/docs/0.0.7/category/running","1b3"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/dump-load-restart",component:d("/starknet-devnet-rs/docs/0.0.7/dump-load-restart","797"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/forking",component:d("/starknet-devnet-rs/docs/0.0.7/forking","de8"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/historic-state",component:d("/starknet-devnet-rs/docs/0.0.7/historic-state","8b6"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/intro",component:d("/starknet-devnet-rs/docs/0.0.7/intro","7f1"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/lite",component:d("/starknet-devnet-rs/docs/0.0.7/lite","3b9"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/postman",component:d("/starknet-devnet-rs/docs/0.0.7/postman","ca4"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/predeployed",component:d("/starknet-devnet-rs/docs/0.0.7/predeployed","aa7"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/running/cli",component:d("/starknet-devnet-rs/docs/0.0.7/running/cli","e18"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/running/docker",component:d("/starknet-devnet-rs/docs/0.0.7/running/docker","43d"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/running/install",component:d("/starknet-devnet-rs/docs/0.0.7/running/install","ff6"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/server-config",component:d("/starknet-devnet-rs/docs/0.0.7/server-config","c90"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/0.0.7/starknet-time",component:d("/starknet-devnet-rs/docs/0.0.7/starknet-time","348"),exact:!0,sidebar:"docSidebar"}]}]},{path:"/starknet-devnet-rs/docs/next",component:d("/starknet-devnet-rs/docs/next","56b"),routes:[{path:"/starknet-devnet-rs/docs/next",component:d("/starknet-devnet-rs/docs/next","678"),routes:[{path:"/starknet-devnet-rs/docs/next/account-impersonation",component:d("/starknet-devnet-rs/docs/next/account-impersonation","cc9"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/api",component:d("/starknet-devnet-rs/docs/next/api","d0b"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/balance",component:d("/starknet-devnet-rs/docs/next/balance","7c3"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/blocks",component:d("/starknet-devnet-rs/docs/next/blocks","445"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/category/running",component:d("/starknet-devnet-rs/docs/next/category/running","11b"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/dump-load-restart",component:d("/starknet-devnet-rs/docs/next/dump-load-restart","2e1"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/forking",component:d("/starknet-devnet-rs/docs/next/forking","80e"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/historic-state",component:d("/starknet-devnet-rs/docs/next/historic-state","565"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/intro",component:d("/starknet-devnet-rs/docs/next/intro","5e6"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/lite",component:d("/starknet-devnet-rs/docs/next/lite","963"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/postman",component:d("/starknet-devnet-rs/docs/next/postman","cf5"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/predeployed",component:d("/starknet-devnet-rs/docs/next/predeployed","23c"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/running/cli",component:d("/starknet-devnet-rs/docs/next/running/cli","ed9"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/running/docker",component:d("/starknet-devnet-rs/docs/next/running/docker","31a"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/running/install",component:d("/starknet-devnet-rs/docs/next/running/install","b30"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/server-config",component:d("/starknet-devnet-rs/docs/next/server-config","16f"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/next/starknet-time",component:d("/starknet-devnet-rs/docs/next/starknet-time","a22"),exact:!0,sidebar:"docSidebar"}]}]},{path:"/starknet-devnet-rs/docs",component:d("/starknet-devnet-rs/docs","564"),routes:[{path:"/starknet-devnet-rs/docs",component:d("/starknet-devnet-rs/docs","447"),routes:[{path:"/starknet-devnet-rs/docs/account-impersonation",component:d("/starknet-devnet-rs/docs/account-impersonation","c65"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/api",component:d("/starknet-devnet-rs/docs/api","264"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/balance",component:d("/starknet-devnet-rs/docs/balance","299"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/blocks",component:d("/starknet-devnet-rs/docs/blocks","8d9"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/category/running",component:d("/starknet-devnet-rs/docs/category/running","93a"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/dump-load-restart",component:d("/starknet-devnet-rs/docs/dump-load-restart","e0d"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/forking",component:d("/starknet-devnet-rs/docs/forking","725"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/historic-state",component:d("/starknet-devnet-rs/docs/historic-state","318"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/intro",component:d("/starknet-devnet-rs/docs/intro","1dd"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/lite",component:d("/starknet-devnet-rs/docs/lite","4e7"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/postman",component:d("/starknet-devnet-rs/docs/postman","0f4"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/predeployed",component:d("/starknet-devnet-rs/docs/predeployed","268"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/running/cli",component:d("/starknet-devnet-rs/docs/running/cli","65b"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/running/docker",component:d("/starknet-devnet-rs/docs/running/docker","992"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/running/install",component:d("/starknet-devnet-rs/docs/running/install","bca"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/server-config",component:d("/starknet-devnet-rs/docs/server-config","b0e"),exact:!0,sidebar:"docSidebar"},{path:"/starknet-devnet-rs/docs/starknet-time",component:d("/starknet-devnet-rs/docs/starknet-time","a99"),exact:!0,sidebar:"docSidebar"}]}]}]},{path:"/starknet-devnet-rs/",component:d("/starknet-devnet-rs/","5f7"),exact:!0},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o,x:()=>i});var r=n(6540),a=n(4848);const o=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,a.jsx)(o.Provider,{value:n,children:t})}},8536:(e,t,n)=>{"use strict";var r=n(6540),a=n(5338),o=n(4625),i=n(545),s=n(8193);const l=[n(119),n(6134),n(6294),n(1043)];var c=n(8328),u=n(6347),d=n(2831),p=n(4848);function f(e){let{children:t}=e;return(0,p.jsx)(p.Fragment,{children:t})}var m=n(5260),h=n(4586),g=n(6025),b=n(6342),v=n(1003),y=n(2131),k=n(4090),w=n(2967),x=n(440),S=n(1463);function _(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,h.A)(),r=(0,y.o)(),a=n[e].htmlLang,o=e=>e.replace("-","_");return(0,p.jsxs)(m.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,p.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,p.jsx)("meta",{property:"og:locale",content:o(a)}),Object.values(n).filter((e=>a!==e.htmlLang)).map((e=>(0,p.jsx)("meta",{property:"og:locale:alternate",content:o(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function E(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,h.A)(),{pathname:r}=(0,u.zy)();return e+(0,x.applyTrailingSlash)((0,g.A)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:r;return(0,p.jsxs)(m.A,{children:[(0,p.jsx)("meta",{property:"og:url",content:a}),(0,p.jsx)("link",{rel:"canonical",href:a})]})}function C(){const{i18n:{currentLocale:e}}=(0,h.A)(),{metadata:t,image:n}=(0,b.p)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(m.A,{children:[(0,p.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,p.jsx)("body",{className:k.w})]}),n&&(0,p.jsx)(v.be,{image:n}),(0,p.jsx)(E,{}),(0,p.jsx)(_,{}),(0,p.jsx)(S.A,{tag:w.Cy,locale:e}),(0,p.jsx)(m.A,{children:t.map(((e,t)=>(0,p.jsx)("meta",{...e},t)))})]})}const A=new Map;var T=n(6125),j=n(6988),N=n(205);function L(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const R=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,N.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),L("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function P(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.u)(c.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class O extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=s.A.canUseDOM?L("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=L("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),P(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,p.jsx)(R,{previousLocation:this.previousLocation,location:t,children:(0,p.jsx)(u.qh,{location:t,render:()=>e})})}}const D=O,I="__docusaurus-base-url-issue-banner-container",M="__docusaurus-base-url-issue-banner",F="__docusaurus-base-url-issue-banner-suggestion-container";function z(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${I}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{let{route:t}=e;return!0===t.exact})))return A.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return A.set(e.pathname,t),{...e,pathname:t}}((0,u.zy)());return(0,p.jsx)(D,{location:e,children:V})}function Q(){return(0,p.jsx)(q.A,{children:(0,p.jsx)(j.l,{children:(0,p.jsxs)(T.x,{children:[(0,p.jsxs)(f,{children:[(0,p.jsx)(U,{}),(0,p.jsx)(C,{}),(0,p.jsx)($,{}),(0,p.jsx)(W,{})]}),(0,p.jsx)(G,{})]})})})}var K=n(4054);const Y=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Z=n(6921);const X=new Set,J=new Set,ee=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,te={prefetch:e=>{if(!(e=>!ee()&&!J.has(e)&&!X.has(e))(e))return!1;X.add(e);const t=(0,d.u)(c.A,e).flatMap((e=>{return t=e.route.path,Object.entries(K).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Z.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Y(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!ee()&&!J.has(e))(e)&&(J.add(e),P(e))},ne=Object.freeze(te),re=Boolean(!0);if(s.A.canUseDOM){window.docusaurus=ne;const e=document.getElementById("__docusaurus"),t=(0,p.jsx)(i.vd,{children:(0,p.jsx)(o.Kd,{children:(0,p.jsx)(Q,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},s=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(re)window.docusaurusRoot=a.hydrateRoot(e,t,{onRecoverableError:n});else{const r=a.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};P(window.location.pathname).then((()=>{(0,r.startTransition)(s)}))}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>p});var r=n(6540),a=n(4784);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/starknet-devnet-rs/docs","versions":[{"name":"current","label":"Next","isLast":false,"path":"/starknet-devnet-rs/docs/next","mainDocId":"intro","docs":[{"id":"account-impersonation","path":"/starknet-devnet-rs/docs/next/account-impersonation","sidebar":"docSidebar"},{"id":"api","path":"/starknet-devnet-rs/docs/next/api","sidebar":"docSidebar"},{"id":"balance","path":"/starknet-devnet-rs/docs/next/balance","sidebar":"docSidebar"},{"id":"blocks","path":"/starknet-devnet-rs/docs/next/blocks","sidebar":"docSidebar"},{"id":"dump-load-restart","path":"/starknet-devnet-rs/docs/next/dump-load-restart","sidebar":"docSidebar"},{"id":"forking","path":"/starknet-devnet-rs/docs/next/forking","sidebar":"docSidebar"},{"id":"historic-state","path":"/starknet-devnet-rs/docs/next/historic-state","sidebar":"docSidebar"},{"id":"intro","path":"/starknet-devnet-rs/docs/next/intro","sidebar":"docSidebar"},{"id":"lite","path":"/starknet-devnet-rs/docs/next/lite","sidebar":"docSidebar"},{"id":"postman","path":"/starknet-devnet-rs/docs/next/postman","sidebar":"docSidebar"},{"id":"predeployed","path":"/starknet-devnet-rs/docs/next/predeployed","sidebar":"docSidebar"},{"id":"running/cli","path":"/starknet-devnet-rs/docs/next/running/cli","sidebar":"docSidebar"},{"id":"running/docker","path":"/starknet-devnet-rs/docs/next/running/docker","sidebar":"docSidebar"},{"id":"running/install","path":"/starknet-devnet-rs/docs/next/running/install","sidebar":"docSidebar"},{"id":"server-config","path":"/starknet-devnet-rs/docs/next/server-config","sidebar":"docSidebar"},{"id":"starknet-time","path":"/starknet-devnet-rs/docs/next/starknet-time","sidebar":"docSidebar"},{"id":"/category/running","path":"/starknet-devnet-rs/docs/next/category/running","sidebar":"docSidebar"}],"draftIds":[],"sidebars":{"docSidebar":{"link":{"path":"/starknet-devnet-rs/docs/next/intro","label":"intro"}}}},{"name":"0.1.1","label":"0.1.1","isLast":true,"path":"/starknet-devnet-rs/docs","mainDocId":"intro","docs":[{"id":"account-impersonation","path":"/starknet-devnet-rs/docs/account-impersonation","sidebar":"docSidebar"},{"id":"api","path":"/starknet-devnet-rs/docs/api","sidebar":"docSidebar"},{"id":"balance","path":"/starknet-devnet-rs/docs/balance","sidebar":"docSidebar"},{"id":"blocks","path":"/starknet-devnet-rs/docs/blocks","sidebar":"docSidebar"},{"id":"dump-load-restart","path":"/starknet-devnet-rs/docs/dump-load-restart","sidebar":"docSidebar"},{"id":"forking","path":"/starknet-devnet-rs/docs/forking","sidebar":"docSidebar"},{"id":"historic-state","path":"/starknet-devnet-rs/docs/historic-state","sidebar":"docSidebar"},{"id":"intro","path":"/starknet-devnet-rs/docs/intro","sidebar":"docSidebar"},{"id":"lite","path":"/starknet-devnet-rs/docs/lite","sidebar":"docSidebar"},{"id":"postman","path":"/starknet-devnet-rs/docs/postman","sidebar":"docSidebar"},{"id":"predeployed","path":"/starknet-devnet-rs/docs/predeployed","sidebar":"docSidebar"},{"id":"running/cli","path":"/starknet-devnet-rs/docs/running/cli","sidebar":"docSidebar"},{"id":"running/docker","path":"/starknet-devnet-rs/docs/running/docker","sidebar":"docSidebar"},{"id":"running/install","path":"/starknet-devnet-rs/docs/running/install","sidebar":"docSidebar"},{"id":"server-config","path":"/starknet-devnet-rs/docs/server-config","sidebar":"docSidebar"},{"id":"starknet-time","path":"/starknet-devnet-rs/docs/starknet-time","sidebar":"docSidebar"},{"id":"/category/running","path":"/starknet-devnet-rs/docs/category/running","sidebar":"docSidebar"}],"draftIds":[],"sidebars":{"docSidebar":{"link":{"path":"/starknet-devnet-rs/docs/intro","label":"intro"}}}},{"name":"0.0.7","label":"0.0.7","isLast":false,"path":"/starknet-devnet-rs/docs/0.0.7","mainDocId":"intro","docs":[{"id":"account-impersonation","path":"/starknet-devnet-rs/docs/0.0.7/account-impersonation","sidebar":"docSidebar"},{"id":"api","path":"/starknet-devnet-rs/docs/0.0.7/api","sidebar":"docSidebar"},{"id":"balance","path":"/starknet-devnet-rs/docs/0.0.7/balance","sidebar":"docSidebar"},{"id":"blocks","path":"/starknet-devnet-rs/docs/0.0.7/blocks","sidebar":"docSidebar"},{"id":"dump-load-restart","path":"/starknet-devnet-rs/docs/0.0.7/dump-load-restart","sidebar":"docSidebar"},{"id":"forking","path":"/starknet-devnet-rs/docs/0.0.7/forking","sidebar":"docSidebar"},{"id":"historic-state","path":"/starknet-devnet-rs/docs/0.0.7/historic-state","sidebar":"docSidebar"},{"id":"intro","path":"/starknet-devnet-rs/docs/0.0.7/intro","sidebar":"docSidebar"},{"id":"lite","path":"/starknet-devnet-rs/docs/0.0.7/lite","sidebar":"docSidebar"},{"id":"postman","path":"/starknet-devnet-rs/docs/0.0.7/postman","sidebar":"docSidebar"},{"id":"predeployed","path":"/starknet-devnet-rs/docs/0.0.7/predeployed","sidebar":"docSidebar"},{"id":"running/cli","path":"/starknet-devnet-rs/docs/0.0.7/running/cli","sidebar":"docSidebar"},{"id":"running/docker","path":"/starknet-devnet-rs/docs/0.0.7/running/docker","sidebar":"docSidebar"},{"id":"running/install","path":"/starknet-devnet-rs/docs/0.0.7/running/install","sidebar":"docSidebar"},{"id":"server-config","path":"/starknet-devnet-rs/docs/0.0.7/server-config","sidebar":"docSidebar"},{"id":"starknet-time","path":"/starknet-devnet-rs/docs/0.0.7/starknet-time","sidebar":"docSidebar"},{"id":"/category/running","path":"/starknet-devnet-rs/docs/0.0.7/category/running","sidebar":"docSidebar"}],"draftIds":[],"sidebars":{"docSidebar":{"link":{"path":"/starknet-devnet-rs/docs/0.0.7/intro","label":"intro"}}}},{"name":"0.0.6","label":"0.0.6","isLast":false,"path":"/starknet-devnet-rs/docs/0.0.6","mainDocId":"intro","docs":[{"id":"account-impersonation","path":"/starknet-devnet-rs/docs/0.0.6/account-impersonation","sidebar":"docSidebar"},{"id":"api","path":"/starknet-devnet-rs/docs/0.0.6/api","sidebar":"docSidebar"},{"id":"balance","path":"/starknet-devnet-rs/docs/0.0.6/balance","sidebar":"docSidebar"},{"id":"blocks","path":"/starknet-devnet-rs/docs/0.0.6/blocks","sidebar":"docSidebar"},{"id":"dump-load-restart","path":"/starknet-devnet-rs/docs/0.0.6/dump-load-restart","sidebar":"docSidebar"},{"id":"forking","path":"/starknet-devnet-rs/docs/0.0.6/forking","sidebar":"docSidebar"},{"id":"historic-state","path":"/starknet-devnet-rs/docs/0.0.6/historic-state","sidebar":"docSidebar"},{"id":"intro","path":"/starknet-devnet-rs/docs/0.0.6/intro","sidebar":"docSidebar"},{"id":"lite","path":"/starknet-devnet-rs/docs/0.0.6/lite","sidebar":"docSidebar"},{"id":"postman","path":"/starknet-devnet-rs/docs/0.0.6/postman","sidebar":"docSidebar"},{"id":"predeployed","path":"/starknet-devnet-rs/docs/0.0.6/predeployed","sidebar":"docSidebar"},{"id":"running/cli","path":"/starknet-devnet-rs/docs/0.0.6/running/cli","sidebar":"docSidebar"},{"id":"running/docker","path":"/starknet-devnet-rs/docs/0.0.6/running/docker","sidebar":"docSidebar"},{"id":"running/install","path":"/starknet-devnet-rs/docs/0.0.6/running/install","sidebar":"docSidebar"},{"id":"server-config","path":"/starknet-devnet-rs/docs/0.0.6/server-config","sidebar":"docSidebar"},{"id":"starknet-time","path":"/starknet-devnet-rs/docs/0.0.6/starknet-time","sidebar":"docSidebar"},{"id":"/category/running","path":"/starknet-devnet-rs/docs/0.0.6/category/running","sidebar":"docSidebar"}],"draftIds":[],"sidebars":{"docSidebar":{"link":{"path":"/starknet-devnet-rs/docs/0.0.6/intro","label":"intro"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var s=n(2654);const l=JSON.parse('{"docusaurusVersion":"3.3.2","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.3.2"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.3.2"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.3.2"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.3.2"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.3.2"}}}');var c=n(4848);const u={siteConfig:a.default,siteMetadata:l,globalData:o,i18n:i,codeTranslations:s},d=r.createContext(u);function p(e){let{children:t}=e;return(0,c.jsx)(d.Provider,{value:u,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(6540),a=n(8193),o=n(5260),i=n(440),s=n(781),l=n(3102),c=n(4848);function u(e){let{error:t,tryAgain:n}=e;return(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,c.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,c.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,c.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function p(e){let{children:t}=e;return(0,c.jsx)(l.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function f(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)(p,{children:(0,c.jsxs)(h,{fallback:()=>(0,c.jsx)(u,{error:t,tryAgain:n}),children:[(0,c.jsx)(o.A,{children:(0,c.jsx)("title",{children:"Page Error"})}),(0,c.jsx)(s.A,{children:(0,c.jsx)(u,{error:t,tryAgain:n})})]})})}const m=e=>(0,c.jsx)(f,{...e});class h extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??m)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(545),a=n(4848);function o(e){return(0,a.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(6540),a=n(4625),o=n(440),i=n(4586),s=n(6654),l=n(8193),c=n(3427),u=n(6025),d=n(4848);function p(e,t){let{isNavLink:n,to:p,href:f,activeClassName:m,isActive:h,"data-noBrokenLinkCheck":g,autoAddBaseUrl:b=!0,...v}=e;const{siteConfig:{trailingSlash:y,baseUrl:k}}=(0,i.A)(),{withBaseUrl:w}=(0,u.h)(),x=(0,c.A)(),S=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>S.current));const _=p||f;const E=(0,s.A)(_),C=_?.replace("pathname://","");let A=void 0!==C?(T=C,b&&(e=>e.startsWith("/"))(T)?w(T):T):void 0;var T;A&&E&&(A=(0,o.applyTrailingSlash)(A,{trailingSlash:y,baseUrl:k}));const j=(0,r.useRef)(!1),N=n?a.k2:a.N_,L=l.A.canUseIntersectionObserver,R=(0,r.useRef)(),P=()=>{j.current||null==A||(window.docusaurus.preload(A),j.current=!0)};(0,r.useEffect)((()=>(!L&&E&&null!=A&&window.docusaurus.prefetch(A),()=>{L&&R.current&&R.current.disconnect()})),[R,A,L,E]);const O=A?.startsWith("#")??!1,D=!v.target||"_self"===v.target,I=!A||!E||!D||O;return g||!O&&I||x.collectLink(A),v.id&&x.collectAnchor(v.id),I?(0,d.jsx)("a",{ref:S,href:A,..._&&!E&&{target:"_blank",rel:"noopener noreferrer"},...v}):(0,d.jsx)(N,{...v,onMouseEnter:P,onTouchStart:P,innerRef:e=>{S.current=e,L&&e&&E&&(R.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(R.current.unobserve(e),R.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),R.current.observe(e))},to:A,...n&&{isActive:h,activeClassName:m}})}const f=r.forwardRef(p)},418:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=()=>null},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>c,T:()=>l});var r=n(6540),a=n(4848);function o(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function s(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return o(s({message:n,id:r}),t)}function c(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=s({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,h:()=>i});var r=n(6540),a=n(4586),o=n(6654);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,a.A)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:a=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,o.z)(n))return n;if(a)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const s=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+s:s}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function s(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const a=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),o=()=>(0,r.useContext)(a);function i(){return o()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6988);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const s=a?`${a}.${o}`:o;r(i)?e(i,s):t[s]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>o});var r=n(6540),a=n(4848);const o=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(o),s=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,a.jsx)(o.Provider,{value:s,children:t})}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>h,vT:()=>p,Gy:()=>u,HW:()=>g,ht:()=>d,r7:()=>m,jh:()=>f});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const s=e=>e.versions.find((e=>e.isLast));function l(e,t){const n=function(e,t){const n=s(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),a=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const c={},u=()=>i("docusaurus-plugin-content-docs")??c,d=e=>{try{return function(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function p(e){void 0===e&&(e={});const t=u(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function f(e){return d(e).versions}function m(e){const t=d(e);return s(t)}function h(e){const t=d(e),{pathname:n}=(0,r.zy)();return l(t,n)}function g(e){const t=d(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=s(e);return{latestDocSuggestion:l(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},6134:(e,t,n)=>{"use strict";n.r(t);var r=n(1765),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(8692)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(6540);var r=n(4164),a=n(1312),o=n(6342),i=n(8774),s=n(3427);const l={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var c=n(4848);function u(e){let{as:t,id:n,...u}=e;const d=(0,s.A)(),{navbar:{hideOnScroll:p}}=(0,o.p)();if("h1"===t||!n)return(0,c.jsx)(t,{...u,id:void 0});d.collectAnchor(n);const f=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof u.children?u.children:n});return(0,c.jsxs)(t,{...u,className:(0,r.A)("anchor",p?l.anchorWithHideOnScrollNavbar:l.anchorWithStickyNavbar,u.className),id:n,children:[u.children,(0,c.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":f,title:f,children:"\u200b"})]})}},3186:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);const r={iconExternalLink:"iconExternalLink_nPIU"};var a=n(4848);function o(e){let{width:t=13.5,height:n=13.5}=e;return(0,a.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},781:(e,t,n)=>{"use strict";n.d(t,{A:()=>ft});var r=n(6540),a=n(4164),o=n(7489),i=n(1003),s=n(6347),l=n(1312),c=n(5062),u=n(4848);const d="__docusaurus_skipToContent_fallback";function p(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function f(){const e=(0,r.useRef)(null),{action:t}=(0,s.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&p(t)}),[]);return(0,c.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&p(e.current)})),{containerRef:e,onClick:n}}const m=(0,l.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function h(e){const t=e.children??m,{containerRef:n,onClick:r}=f();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":m,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var g=n(7559),b=n(4090);const v={skipToContent:"skipToContent_fXgn"};function y(){return(0,u.jsx)(h,{className:v.skipToContent})}var k=n(6342),w=n(5041);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:a=1.2,className:o,...i}=e;return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,u.jsx)("g",{stroke:r,strokeWidth:a,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function _(e){return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,a.A)("clean-btn close",S.closeButton,e.className),children:(0,u.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const E={content:"content_knG7"};function C(e){const{announcementBar:t}=(0,k.p)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,a.A)(E.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const A={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function T(){const{announcementBar:e}=(0,k.p)(),{isActive:t,close:n}=(0,w.Mj)();if(!t)return null;const{backgroundColor:r,textColor:a,isCloseable:o}=e;return(0,u.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:r,color:a},role:"banner",children:[o&&(0,u.jsx)("div",{className:A.announcementBarPlaceholder}),(0,u.jsx)(C,{className:A.announcementBarContent}),o&&(0,u.jsx)(_,{onClick:n,className:A.announcementBarClose})]})}var j=n(9876),N=n(3104);var L=n(9532),R=n(5600);const P=r.createContext(null);function O(e){let{children:t}=e;const n=function(){const e=(0,j.M)(),t=(0,R.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,L.ZC)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return(0,u.jsx)(P.Provider,{value:n,children:t})}function D(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function I(){const e=(0,r.useContext)(P);if(!e)throw new L.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,R.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:D(o)})),[a,o,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:o}=I();return(0,u.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,u.jsxs)("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var F=n(5293),z=n(2303);function B(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function $(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function q(e){let{className:t,buttonClassName:n,value:r,onChange:o}=e;const i=(0,z.A)(),s=(0,l.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,l.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,l.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,u.jsx)("div",{className:(0,a.A)(U.toggle,t),children:(0,u.jsxs)("button",{className:(0,a.A)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===r?"light":"dark"),disabled:!i,title:s,"aria-label":s,"aria-live":"polite",children:[(0,u.jsx)(B,{className:(0,a.A)(U.toggleIcon,U.lightToggleIcon)}),(0,u.jsx)($,{className:(0,a.A)(U.toggleIcon,U.darkToggleIcon)})]})})}const H=r.memo(q),G={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function V(e){let{className:t}=e;const n=(0,k.p)().navbar.style,r=(0,k.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,F.G)();return r?null:(0,u.jsx)(H,{className:t,buttonClassName:"dark"===n?G.darkNavbarColorModeToggle:void 0,value:a,onChange:o})}var W=n(3465);function Q(){return(0,u.jsx)(W.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function K(){const e=(0,j.M)();return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,u.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function Y(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(Q,{}),(0,u.jsx)(V,{className:"margin-right--md"}),(0,u.jsx)(K,{})]})}var Z=n(8774),X=n(6025),J=n(6654);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(3186);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:a,label:o,html:i,isDropdownLink:s,prependBaseUrlToHref:l,...c}=e;const d=(0,X.A)(r),p=(0,X.A)(t),f=(0,X.A)(a,{forcePrependBaseUrl:!0}),m=o&&a&&!(0,J.A)(a),h=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,u.jsxs)(u.Fragment,{children:[o,m&&(0,u.jsx)(te.A,{...s&&{width:12,height:12}})]})};return a?(0,u.jsx)(Z.A,{href:l?f:a,...c,...h}):(0,u.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(p)},...c,...h})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const o=(0,u.jsx)(ne,{className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,u.jsx)("li",{children:o}):o}function ae(e){let{className:t,isDropdownItem:n,...r}=e;return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(ne,{className:(0,a.A)("menu__link",t),...r})})}function oe(e){let{mobile:t=!1,position:n,...r}=e;const a=t?ae:re;return(0,u.jsx)(a,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1422),se=n(9169),le=n(4586);const ce={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};function ue(e,t){return e.some((e=>function(e,t){return!!(0,se.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:o,onClick:i,...s}=e;const l=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{l.current&&!l.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[l]),(0,u.jsxs)("div",{ref:l,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c}),children:[(0,u.jsx)(ne,{"aria-haspopup":"true","aria-expanded":c,role:"button",href:s.to?void 0:"#",className:(0,a.A)("navbar__link",o),...s,onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))},children:s.children??s.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(Ee,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function pe(e){let{items:t,className:n,position:o,onClick:i,...l}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,le.A)(),{pathname:t}=(0,s.zy)();return t.replace(e,"/")}(),d=ue(t,c),{collapsed:p,toggleCollapsed:f,setCollapsed:m}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&m(!d)}),[c,d,m]),(0,u.jsxs)("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":p}),children:[(0,u.jsx)(ne,{role:"button",className:(0,a.A)(ce.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...l,onClick:e=>{e.preventDefault(),f()},children:l.children??l.label}),(0,u.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:p,children:t.map(((e,t)=>(0,r.createElement)(Ee,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function fe(e){let{mobile:t=!1,...n}=e;const r=t?pe:de;return(0,u.jsx)(r,{...n})}var me=n(2131);function he(e){let{width:t=20,height:n=20,...r}=e;return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const ge="iconLanguage_nlXk";var be=n(418);const ve={navbarSearchContainer:"navbarSearchContainer_Bca1"};function ye(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:(0,a.A)(n,ve.navbarSearchContainer),children:t})}var ke=n(4070),we=n(1754);var xe=n(5597);const Se=e=>e.docs.find((t=>t.id===e.mainDocId));const _e={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:a="",...o}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,le.A)(),p=(0,me.o)(),{search:f,hash:m}=(0,s.zy)(),h=[...n,...c.map((e=>{const n=`${`pathname://${p.createUrl({locale:e,fullyQualified:!1})}`}${f}${m}${a}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],g=t?(0,l.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,u.jsx)(fe,{...o,mobile:t,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(he,{className:ge}),g]}),items:h})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,u.jsx)(ye,{className:n,children:(0,u.jsx)(be.A,{})})},dropdown:fe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:o=!1}=e;const i=o?"li":"div";return(0,u.jsx)(i,{className:(0,a.A)({navbar__item:!r&&!o,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,ke.zK)(r),i=(0,we.QB)(t,r),s=o?.path===i?.path;return null===i||i.unlisted&&!s?null:(0,u.jsx)(oe,{exact:!0,...a,isActive:()=>s||!!o?.sidebar&&o.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,ke.zK)(r),i=(0,we.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,u.jsx)(oe,{exact:!0,...a,isActive:()=>o?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...a}=e;const o=(0,we.Vd)(r)[0],i=t??o.label,s=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return(0,u.jsx)(oe,{...a,label:i,to:s})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:a,dropdownItemsAfter:o,...i}=e;const{search:c,hash:d}=(0,s.zy)(),p=(0,ke.zK)(n),f=(0,ke.jh)(n),{savePreferredVersionName:m}=(0,xe.g1)(n),h=[...a,...f.map((e=>{const t=p.alternateDocVersions[e.name]??Se(e);return{label:e.label,to:`${t.path}${c}${d}`,isActive:()=>e===p.activeVersion,onClick:()=>m(e.name)}})),...o],g=(0,we.Vd)(n)[0],b=t&&h.length>1?(0,l.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):g.label,v=t&&h.length>1?void 0:Se(g).path;return h.length<=1?(0,u.jsx)(oe,{...i,mobile:t,label:b,to:v,isActive:r?()=>!1:void 0}):(0,u.jsx)(fe,{...i,mobile:t,label:b,to:v,items:h,isActive:r?()=>!1:void 0})}};function Ee(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=_e[r];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,u.jsx)(a,{...n})}function Ce(){const e=(0,j.M)(),t=(0,k.p)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(Ee,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Ae(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.jsx)(l.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function Te(){const e=0===(0,k.p)().navbar.items.length,t=I();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(Ae,{onClick:()=>t.hide()}),t.content]})}function je(){const e=(0,j.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,u.jsx)(M,{header:(0,u.jsx)(Y,{}),primaryMenu:(0,u.jsx)(Ce,{}),secondaryMenu:(0,u.jsx)(Te,{})}):null}const Ne={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Le(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,a.A)("navbar-sidebar__backdrop",e.className)})}function Re(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,k.p)(),i=(0,j.M)(),{navbarRef:s,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,N.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=s?n(!1):i+c{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,u.jsxs)("nav",{ref:s,"aria-label":(0,l.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.A)("navbar","navbar--fixed-top",n&&[Ne.navbarHideable,!d&&Ne.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown}),children:[t,(0,u.jsx)(Le,{onClick:i.toggle}),(0,u.jsx)(je,{})]})}var Pe=n(440);const Oe={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function De(e){return(0,u.jsx)("button",{type:"button",...e,children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Ie(e){let{error:t}=e;const n=(0,Pe.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{className:Oe.errorBoundaryError,children:n})}class Me extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const Fe="right";function ze(e){let{width:t=30,height:n=30,className:r,...a}=e;return(0,u.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...a,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Be(){const{toggle:e,shown:t}=(0,j.M)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,l.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(ze,{})})}const $e={colorModeToggle:"colorModeToggle_DEke"};function Ue(e){let{items:t}=e;return(0,u.jsx)(u.Fragment,{children:t.map(((e,t)=>(0,u.jsx)(Me,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,u.jsx)(Ee,{...e})},t)))})}function qe(e){let{left:t,right:n}=e;return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:"navbar__items",children:t}),(0,u.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function He(){const e=(0,j.M)(),t=(0,k.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??Fe)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return(0,u.jsx)(qe,{left:(0,u.jsxs)(u.Fragment,{children:[!e.disabled&&(0,u.jsx)(Be,{}),(0,u.jsx)(Q,{}),(0,u.jsx)(Ue,{items:n})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ue,{items:r}),(0,u.jsx)(V,{className:$e.colorModeToggle}),!a&&(0,u.jsx)(ye,{children:(0,u.jsx)(be.A,{})})]})})}function Ge(){return(0,u.jsx)(Re,{children:(0,u.jsx)(He,{})})}function Ve(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:o,...i}=t,s=(0,X.A)(n),l=(0,X.A)(r,{forcePrependBaseUrl:!0});return(0,u.jsxs)(Z.A,{className:"footer__link-item",...r?{href:o?l:r}:{to:s},...i,children:[a,r&&!(0,J.A)(r)&&(0,u.jsx)(te.A,{})]})}function We(e){let{item:t}=e;return t.html?(0,u.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(Ve,{item:t})},t.href??t.to)}function Qe(e){let{column:t}=e;return(0,u.jsxs)("div",{className:"col footer__col",children:[(0,u.jsx)("div",{className:"footer__title",children:t.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,u.jsx)(We,{item:e},t)))})]})}function Ke(e){let{columns:t}=e;return(0,u.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,u.jsx)(Qe,{column:e},t)))})}function Ye(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Ze(e){let{item:t}=e;return t.html?(0,u.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)(Ve,{item:t})}function Xe(e){let{links:t}=e;return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(Ze,{item:e}),t.length!==n+1&&(0,u.jsx)(Ye,{})]},n)))})})}function Je(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,u.jsx)(Ke,{columns:t}):(0,u.jsx)(Xe,{links:t})}var et=n(1122);const tt={footerLogoLink:"footerLogoLink_BH7S"};function nt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.h)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,u.jsx)(et.A,{className:(0,a.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function rt(e){let{logo:t}=e;return t.href?(0,u.jsx)(Z.A,{href:t.href,className:tt.footerLogoLink,target:t.target,children:(0,u.jsx)(nt,{logo:t})}):(0,u.jsx)(nt,{logo:t})}function at(e){let{copyright:t}=e;return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ot(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,u.jsx)("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,u.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function it(){const{footer:e}=(0,k.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:a}=e;return(0,u.jsx)(ot,{style:a,links:n&&n.length>0&&(0,u.jsx)(Je,{links:n}),logo:r&&(0,u.jsx)(rt,{logo:r}),copyright:t&&(0,u.jsx)(at,{copyright:t})})}const st=r.memo(it),lt=(0,L.fM)([F.a,w.oq,N.Tv,xe.VQ,i.Jx,function(e){let{children:t}=e;return(0,u.jsx)(R.y_,{children:(0,u.jsx)(j.e,{children:(0,u.jsx)(O,{children:t})})})}]);function ct(e){let{children:t}=e;return(0,u.jsx)(lt,{children:t})}var ut=n(1107);function dt(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(ut.A,{as:"h1",className:"hero__title",children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(De,{onClick:n,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(Ie,{error:t})})]})})})}const pt={mainWrapper:"mainWrapper_z2l0"};function ft(e){const{children:t,noFooter:n,wrapperClassName:r,title:s,description:l}=e;return(0,b.J)(),(0,u.jsxs)(ct,{children:[(0,u.jsx)(i.be,{title:s,description:l}),(0,u.jsx)(y,{}),(0,u.jsx)(T,{}),(0,u.jsx)(Ge,{}),(0,u.jsx)("div",{id:d,className:(0,a.A)(g.G.wrapper.main,pt.mainWrapper,r),children:(0,u.jsx)(o.A,{fallback:e=>(0,u.jsx)(dt,{...e}),children:t})}),!n&&(0,u.jsx)(st,{})]})}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(6540);var r=n(8774),a=n(6025),o=n(4586),i=n(6342),s=n(1122),l=n(4848);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,a.A)(t.src),dark:(0,a.A)(t.srcDark||t.src)},i=(0,l.jsx)(s.A,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,l.jsx)("div",{className:r,children:i}):i}function u(e){const{siteConfig:{title:t}}=(0,o.A)(),{navbar:{title:n,logo:s}}=(0,i.p)(),{imageClassName:u,titleClassName:d,...p}=e,f=(0,a.A)(s?.href||"/"),m=n?"":t,h=s?.alt??m;return(0,l.jsxs)(r.A,{to:f,...p,...s?.target&&{target:s.target},children:[s&&(0,l.jsx)(c,{logo:s,alt:h,imageClassName:u}),null!=n&&(0,l.jsx)("b",{className:d,children:n})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(5260),a=n(4848);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return(0,a.jsxs)(r.A,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},1122:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(6540),a=n(4164),o=n(2303),i=n(5293);const s={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var l=n(4848);function c(e){let{className:t,children:n}=e;const c=(0,o.A)(),{colorMode:u}=(0,i.G)();return(0,l.jsx)(l.Fragment,{children:(c?"dark"===u?["dark"]:["light"]:["light","dark"]).map((e=>{const o=n({theme:e,className:(0,a.A)(t,s.themedComponent,s[`themedComponent--${e}`])});return(0,l.jsx)(r.Fragment,{children:o},e)}))})}function u(e){const{sources:t,className:n,alt:r,...a}=e;return(0,l.jsx)(c,{className:n,children:e=>{let{theme:n,className:o}=e;return(0,l.jsx)("img",{src:t[n],alt:r,className:o,...a})}})}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>b,u:()=>c});var r=n(6540),a=n(8193),o=n(205),i=n(3109),s=n(4848);const l="ease-in-out";function c(e){let{initialState:t}=e;const[n,a]=(0,r.useState)(t??!1),o=(0,r.useCallback)((()=>{a((e=>!e))}),[]);return{collapsed:n,setCollapsed:a,toggleCollapsed:o}}const u={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function p(e,t){const n=t?u:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function f(e){let{collapsibleRef:t,collapsed:n,animation:a}=e;const o=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=a?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${a?.easing??l}`,height:`${t}px`}}function s(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return p(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(s(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{s()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,a])}function m(e){if(!a.A.canUseDOM)return e?u:d}function h(e){let{as:t="div",collapsed:n,children:a,animation:o,onCollapseTransitionEnd:i,className:l,disableSSRStyle:c}=e;const u=(0,r.useRef)(null);return f({collapsibleRef:u,collapsed:n,animation:o}),(0,s.jsx)(t,{ref:u,style:c?void 0:m(n),onTransitionEnd:e=>{"height"===e.propertyName&&(p(u.current,n),i?.(n))},className:l,children:a})}function g(e){let{collapsed:t,...n}=e;const[a,i]=(0,r.useState)(!t),[l,c]=(0,r.useState)(t);return(0,o.A)((()=>{t||i(!0)}),[t]),(0,o.A)((()=>{a&&c(t)}),[a,t]),a?(0,s.jsx)(h,{...n,collapsed:l}):null}function b(e){let{lazy:t,...n}=e;const r=t?g:h;return(0,s.jsx)(r,{...n})}},5041:(e,t,n)=>{"use strict";n.d(t,{Mj:()=>h,oq:()=>m});var r=n(6540),a=n(2303),o=n(9466),i=n(9532),s=n(6342),l=n(4848);const c=(0,o.Wf)("docusaurus.announcement.dismiss"),u=(0,o.Wf)("docusaurus.announcement.id"),d=()=>"true"===c.get(),p=e=>c.set(String(e)),f=r.createContext(null);function m(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,s.p)(),t=(0,a.A)(),[n,o]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{o(d())}),[]);const i=(0,r.useCallback)((()=>{p(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&p(!1),!r&&d()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,l.jsx)(f.Provider,{value:n,children:t})}function h(){const e=(0,r.useContext)(f);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>b,a:()=>g});var r=n(6540),a=n(8193),o=n(9532),i=n(9466),s=n(6342),l=n(4848);const c=r.createContext(void 0),u="theme",d=(0,i.Wf)(u),p={light:"light",dark:"dark"},f=e=>e===p.dark?p.dark:p.light,m=e=>a.A.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),h=e=>{d.set(f(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,s.p)(),[a,o]=(0,r.useState)(m(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&h(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?p.dark:p.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=d.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const l=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||l.current?l.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===p.dark},setLightTheme(){i(p.light)},setDarkTheme(){i(p.dark)}})),[a,i])}();return(0,l.jsx)(c.Provider,{value:n,children:t})}function b(){const e=(0,r.useContext)(c);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5597:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>b,g1:()=>y});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),s=n(1754),l=n(9532),c=n(9466),u=n(4848);const d=e=>`docs-preferred-version-${e}`,p={save:(e,t,n)=>{(0,c.Wf)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.Wf)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.Wf)(d(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const m=r.createContext(null);function h(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,s]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{s(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=p.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(p.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){p.save(e,t,n),s((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=h();return(0,u.jsx)(m.Provider,{value:n,children:t})}function b(e){let{children:t}=e;return s.C5?(0,u.jsx)(g,{children:t}):(0,u.jsx)(u.Fragment,{children:t})}function v(){const e=(0,r.useContext)(m);if(!e)throw new l.dV("DocsPreferredVersionContextProvider");return e}function y(e){void 0===e&&(e=o.W);const t=(0,a.ht)(e),[n,i]=v(),{preferredVersionName:s}=n[e];return{preferredVersion:t.versions.find((e=>e.name===s))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}},6588:(e,t,n)=>{"use strict";n.d(t,{V:()=>l,t:()=>c});var r=n(6540),a=n(9532),o=n(4848);const i=Symbol("EmptyContext"),s=r.createContext(i);function l(e){let{children:t,name:n,items:a}=e;const i=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return(0,o.jsx)(s.Provider,{value:i,children:t})}function c(){const e=(0,r.useContext)(s);if(e===i)throw new a.dV("DocsSidebarProvider");return e}},2252:(e,t,n)=>{"use strict";n.d(t,{n:()=>s,r:()=>l});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function s(e){let{children:t,version:n}=e;return(0,o.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(null===e)throw new a.dV("DocsVersionProvider");return e}},9876:(e,t,n)=>{"use strict";n.d(t,{e:()=>f,M:()=>m});var r=n(6540),a=n(5600),o=n(4581),i=n(6347),s=n(9532);function l(e){!function(e){const t=(0,i.W6)(),n=(0,s._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var c=n(6342),u=n(4848);const d=r.createContext(void 0);function p(){const e=function(){const e=(0,a.YL)(),{items:t}=(0,c.p)().navbar;return 0===t.length&&!e.component}(),t=(0,o.l)(),n=!e&&"mobile"===t,[i,s]=(0,r.useState)(!1);l((()=>{if(i)return s(!1),!1}));const u=(0,r.useCallback)((()=>{s((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&s(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:i})),[e,n,u,i])}function f(e){let{children:t}=e;const n=p();return(0,u.jsx)(d.Provider,{value:n,children:t})}function m(){const e=r.useContext(d);if(void 0===e)throw new s.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>c,YL:()=>l,y_:()=>s});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function s(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function c(e){let{component:t,props:n}=e;const o=(0,r.useContext)(i);if(!o)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,s]=o,l=(0,a.Be)(n);return(0,r.useEffect)((()=>{s({component:t,props:l})}),[s,t,l]),(0,r.useEffect)((()=>()=>s({component:null,props:null})),[s]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function s(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,s]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){s(function(e){if(!a.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},3109:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},1754:(e,t,n)=>{"use strict";n.d(t,{d1:()=>A,Nr:()=>m,w8:()=>v,C5:()=>p,$S:()=>h,cC:()=>f,B5:()=>C,Vd:()=>S,QB:()=>E,fW:()=>_,OF:()=>x,Y:()=>k});var r=n(6540),a=n(6347),o=n(2831),i=n(4070),s=n(5597),l=n(2252),c=n(6588);function u(e){return Array.from(new Set(e))}var d=n(9169);const p=!!i.Gy;function f(e){const t=(0,l.r)();if(!e)return;const n=t.docs[e];if(!n)throw new Error(`no version doc found by id=${e}`);return n}function m(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=m(t);if(e)return e}}(e):void 0:e.href}function h(){const{pathname:e}=(0,a.zy)(),t=(0,c.t)();if(!t)throw new Error("Unexpected: cant find current sidebar in context");const n=w({sidebarItems:t.items,pathname:e,onlyCategories:!0}).slice(-1)[0];if(!n)throw new Error(`${e} is not associated with a category. useCurrentSidebarCategory() should only be used on category index pages.`);return n}const g=(e,t)=>void 0!==e&&(0,d.ys)(e,t),b=(e,t)=>e.some((e=>v(e,t)));function v(e,t){return"link"===e.type?g(e.href,t):"category"===e.type&&(g(e.href,t)||b(e.items,t))}function y(e,t){switch(e.type){case"category":return v(e,t)||e.items.some((e=>y(e,t)));case"link":return!e.unlisted||v(e,t);default:return!0}}function k(e,t){return(0,r.useMemo)((()=>e.filter((e=>y(e,t)))),[e,t])}function w(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,d.ys)(o.href,n)||e(o.items))||"link"===o.type&&(0,d.ys)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function x(){const e=(0,c.t)(),{pathname:t}=(0,a.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?w({sidebarItems:e.items,pathname:t}):null}function S(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,s.g1)(e),a=(0,i.r7)(e);return(0,r.useMemo)((()=>u([t,n,a].filter(Boolean))),[t,n,a])}function _(e,t){const n=S(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function E(e,t){const n=S(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${u(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function C(e){let{route:t}=e;const n=(0,a.zy)(),r=(0,l.r)(),i=t.routes,s=i.find((e=>(0,a.B6)(n.pathname,e)));if(!s)return null;const c=s.sidebar,u=c?r.docsSidebars[c]:void 0;return{docElement:(0,o.v)(i),sidebarName:c,sidebarItems:u}}function A(e){return e.filter((e=>!("category"===e.type||"link"===e.type)||!!m(e)))}},1003:(e,t,n)=>{"use strict";n.d(t,{e3:()=>f,be:()=>d,Jx:()=>m});var r=n(6540),a=n(4164),o=n(5260),i=n(3102);function s(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var l=n(6025),c=n(4586);var u=n(4848);function d(e){let{title:t,description:n,keywords:r,image:a,children:i}=e;const s=function(e){const{siteConfig:t}=(0,c.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,l.h)(),p=a?d(a,{absolute:!0}):void 0;return(0,u.jsxs)(o.A,{children:[t&&(0,u.jsx)("title",{children:s}),t&&(0,u.jsx)("meta",{property:"og:title",content:s}),n&&(0,u.jsx)("meta",{name:"description",content:n}),n&&(0,u.jsx)("meta",{property:"og:description",content:n}),r&&(0,u.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),p&&(0,u.jsx)("meta",{property:"og:image",content:p}),p&&(0,u.jsx)("meta",{name:"twitter:image",content:p}),i]})}const p=r.createContext(void 0);function f(e){let{className:t,children:n}=e;const i=r.useContext(p),s=(0,a.A)(i,t);return(0,u.jsxs)(p.Provider,{value:s,children:[(0,u.jsx)(o.A,{children:(0,u.jsx)("html",{className:s})}),n]})}function m(e){let{children:t}=e;const n=s(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return(0,u.jsx)(f,{className:(0,a.A)(r,o),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>c,ZC:()=>s,_q:()=>i,dV:()=>l,fM:()=>u});var r=n(6540),a=n(205),o=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,a.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function s(e){const t=(0,r.useRef)();return(0,a.A)((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function c(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return(0,o.jsx)(o.Fragment,{children:e.reduceRight(((e,t)=>(0,o.jsx)(t,{children:e})),n)})}}},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>s,ys:()=>i});var r=n(6540),a=n(8328),o=n(4586);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function s(){const{baseUrl:e}=(0,o.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>p,Tv:()=>c,gk:()=>f});var r=n(6540),a=n(8193),o=n(2303),i=(n(205),n(9532)),s=n(4848);const l=r.createContext(void 0);function c(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,s.jsx)(l.Provider,{value:n,children:t})}function u(){const e=(0,r.useContext)(l);if(null==e)throw new i.dV("ScrollControllerProvider");return e}const d=()=>a.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function p(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=u(),a=(0,r.useRef)(d()),o=(0,i._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=d();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function f(){const e=(0,r.useRef)(null),t=(0,o.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},2967:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>r,tU:()=>a});n(4586);const r="default";function a(e,t){return`docs-${e}-${t}`}},9466:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>l});n(6540);const r="localStorage";function a(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function o(e){if(void 0===e&&(e=r),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,i||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),i=!0),null}var t}let i=!1;const s={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function l(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=o(t?.persistence);return null===n?s:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),a({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),a({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),a=n(6347),o=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:s}}=(0,r.A)(),{pathname:l}=(0,a.zy)(),c=(0,o.applyTrailingSlash)(l,{trailingSlash:n,baseUrl:e}),u=s===i?e:e.replace(`/${s}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),a=n(6347),o=n(9532);function i(e){const t=(0,a.zy)(),n=(0,o.ZC)(t),i=(0,o._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=void 0;const r=n(2566);function a(e){return e.endsWith("/")?e:`${e}/`}function o(e){return(0,r.removeSuffix)(e,"/")}t.addTrailingSlash=a,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),s="/"===i||i===r?i:(l=i,n?a(l):o(l));var l;return e.replace(i,s)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=o},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},440:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(2983);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}}),Object.defineProperty(t,"addTrailingSlash",{enumerable:!0,get:function(){return a.addTrailingSlash}}),Object.defineProperty(t,"addLeadingSlash",{enumerable:!0,get:function(){return a.addLeadingSlash}}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return a.removeTrailingSlash}});var o=n(2566);Object.defineProperty(t,"addPrefix",{enumerable:!0,get:function(){return o.addPrefix}}),Object.defineProperty(t,"removeSuffix",{enumerable:!0,get:function(){return o.removeSuffix}}),Object.defineProperty(t,"addSuffix",{enumerable:!0,get:function(){return o.addSuffix}}),Object.defineProperty(t,"removePrefix",{enumerable:!0,get:function(){return o.removePrefix}});var i=n(253);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},2566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=void 0,t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){return""===t?e:e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>k,TM:()=>C,yJ:()=>f,sC:()=>T,AO:()=>p});var r=n(8168);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;p--){var f=i[p];"."===f?o(i,p):".."===f?(o(i,p),d++):d&&(o(i,p),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var s=n(1561);function l(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function f(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=f(e,t,h(),k.location);u.confirmTransitionTo(a,r,n,(function(e){e&&(k.entries[k.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=k.index+e;return t>=0&&t{"use strict";var r=n(4363),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||a}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=f(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),h=l(n),g=0;g{"use strict";e.exports=function(e,t,n,r,a,o,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,s],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),c=o.querySelector(r.barSelector),u=r.speed,d=r.easing;return o.offsetWidth,s((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,i(e,u,d)),1===e?(l(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){l(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),s=e?"-100":o(n.status||0),c=document.querySelector(r.parent);return l(i,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&f(a),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},5302:(e,t,n)=>{var r=n(4634);e.exports=f,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,s="",u=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],p=n[1],f=n.index;if(s+=e.slice(i,f),i=f+d.length,p)s+=p[1];else{var m=e[i],h=n[2],g=n[3],b=n[4],v=n[5],y=n[6],k=n[7];s&&(r.push(s),s="");var w=null!=h&&null!=m&&m!==h,x="+"===y||"*"===y,S="?"===y||"*"===y,_=n[2]||u,E=b||v;r.push({name:g||o++,prefix:h||"",delimiter:_,optional:S,repeat:x,partial:w,asterisk:!!k,pattern:E?c(E):k?".*":"[^"+l(_)+"]+?"})}}return i{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},8722:(e,t,n)=>{const r=n(6969),a=n(8380),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(3157).resolve(t)],delete Prism.languages[e],n(3157)(t),o.add(e)}))}i.silent=!1,e.exports=i},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,s=i.length;-1!==n.code.indexOf(a=t(r,s));)++s;return i[s]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(s){for(var l=0;l=o.length);l++){var c=s[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[a],d=n.tokenStack[u],p="string"==typeof c?c:c.content,f=t(r,u),m=p.indexOf(f);if(m>-1){++a;var h=p.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=p.substring(m+f.length),v=[];h&&v.push.apply(v,i([h])),v.push(g),b&&v.push.apply(v,i([b])),"string"==typeof c?s.splice.apply(s,[l,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return s}(n.tokens)}}}})}(Prism)},8692:(e,t,n)=>{var r={"./":8722};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=8692},3157:(e,t,n)=>{var r={"./":8722};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=3157},8380:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var s={},l=e[r];if(l){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in s))for(var i in a(t,o),s[t]=!0,n[t])s[i]=!0}t(l.require,c),t(l.optional,c),t(l.modify,c)}n[r]=s,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,s){var l=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(l);i=i.map(c),s=(s||[]).map(c);var u=n(i),d=n(s);i.forEach((function e(n){var r=l[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var p,f=r(l),m=u;a(m);){for(var h in p={},m){var g=l[h];t(g&&g.modify,(function(e){e in d&&(p[e]=!0)}))}for(var b in d)if(!(b in u))for(var v in f(b))if(v in u){p[b]=!0;break}for(var y in m=p)u[y]=!0}var k={getIds:function(){var e=[];return k.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,s={},l={};function c(e){if(e in s)return s[e];l[e]=!0;var a,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)a=r(e);else{var p=i(u.map((function(e){var t=c(e);return delete l[e],t})));o?a=o(p,(function(){return r(e)})):r(e)}return s[e]=a}for(var u in n)c(u);var d=[];for(var p in l)d.push(s[p]);return i(d)}(f,u,t,n)}};return k}}();e.exports=t},2694:(e,t,n)=>{"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n