[{"data":1,"prerenderedAt":1677},["Reactive",2],{"content-query-VTb9GVGyqv":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"body":10,"_type":1672,"_id":1673,"_source":1674,"_file":1675,"_extension":1676},"/docs/dev/using-beam-shaders","dev",false,"","Using Beam Shaders","This tutorial describes using Beam Shaders on DAppnet",{"type":11,"children":12,"toc":1662},"root",[13,21,36,41,77,84,97,111,116,122,127,160,172,183,193,199,219,256,269,282,293,327,347,357,363,368,389,398,410,423,428,434,454,464,476,481,503,541,547,552,557,565,592,597,615,620,1432,1453,1480,1488,1493,1501,1506,1521,1534,1542,1559,1564,1584,1589,1604,1617,1632,1644,1656],{"type":14,"tag":15,"props":16,"children":18},"element","h1",{"id":17},"using-beam-shaders",[19],{"type":20,"value":8},"text",{"type":14,"tag":22,"props":23,"children":24},"p",{},[25,34],{"type":14,"tag":26,"props":27,"children":31},"a",{"href":28,"rel":29},"https://dappnet.beam.mw/downloads/",[30],"nofollow",[32],{"type":20,"value":33},"Why DAppnet",{"type":20,"value":35},"?",{"type":14,"tag":22,"props":37,"children":38},{},[39],{"type":20,"value":40},"Beam consists of three public networks:",{"type":14,"tag":42,"props":43,"children":44},"ol",{},[45,57,67],{"type":14,"tag":46,"props":47,"children":48},"li",{},[49,55],{"type":14,"tag":50,"props":51,"children":52},"strong",{},[53],{"type":20,"value":54},"DAppnet:",{"type":20,"value":56}," a testing sandbox that produces a pseudo-mining block every 15 seconds.",{"type":14,"tag":46,"props":58,"children":59},{},[60,65],{"type":14,"tag":50,"props":61,"children":62},{},[63],{"type":20,"value":64},"Testnet:",{"type":20,"value":66}," produces genuine mining blocks but is mostly a testing site before Mainnet deployment.",{"type":14,"tag":46,"props":68,"children":69},{},[70,75],{"type":14,"tag":50,"props":71,"children":72},{},[73],{"type":20,"value":74},"Mainnet:",{"type":20,"value":76}," the living Beam network with real assets.",{"type":14,"tag":78,"props":79,"children":81},"h3",{"id":80},"install-dappnet-wallet",[82],{"type":20,"value":83},"Install DAppnet wallet",{"type":14,"tag":22,"props":85,"children":86},{},[87,89,95],{"type":20,"value":88},"The latest version of the Beam DAppnet Wallet is on our ",{"type":14,"tag":26,"props":90,"children":92},{"href":28,"rel":91},[30],[93],{"type":20,"value":94},"website",{"type":20,"value":96},".",{"type":14,"tag":22,"props":98,"children":99},{},[100,102,109],{"type":20,"value":101},"When ",{"type":14,"tag":26,"props":103,"children":106},{"href":104,"rel":105},"https://beamx.gitbook.io/dappnet-user-guide/settings",[30],[107],{"type":20,"value":108},"installing DAppnet",{"type":20,"value":110},", choose the default settings to operate the local node (required) to run Beam Shader contracts.  Create a new wallet (save the seed phrase).",{"type":14,"tag":22,"props":112,"children":113},{},[114],{"type":20,"value":115},"Beam Shaders require the use of the integrated node found in the DAppnet Wallet and must remain open for this tutorial.",{"type":14,"tag":78,"props":117,"children":119},{"id":118},"withdraw-from-the-faucet",[120],{"type":20,"value":121},"Withdraw from the Faucet",{"type":14,"tag":22,"props":123,"children":124},{},[125],{"type":20,"value":126},"All DAppnet transactions (including Beam Shader deployment) contain transaction fees that are paid in Beam coins, and require a positive wallet balance.",{"type":14,"tag":22,"props":128,"children":129},{},[130,132,139,141,147,149,154,155,159],{"type":20,"value":131},"Launch ",{"type":14,"tag":26,"props":133,"children":136},{"href":134,"rel":135},"https://beamx.gitbook.io/dappnet-user-guide/my-dapp-store",[30],[137],{"type":20,"value":138},"My DApp Store",{"type":20,"value":140}," ",{"type":14,"tag":142,"props":143,"children":146},"img",{"src":144,"alt":7,"dataSize":145},".gitbook/assets/Screen Shot 2023-05-10 at 10.27.02 PM.png","line",[],{"type":20,"value":148}," and find the ",{"type":14,"tag":50,"props":150,"children":151},{},[152],{"type":20,"value":153},"Faucet Application",{"type":20,"value":140},{"type":14,"tag":142,"props":156,"children":158},{"src":157,"alt":7,"dataSize":145},".gitbook/assets/Screen Shot 2023-05-11 at 5.38.24 PM.png",[],{"type":20,"value":96},{"type":14,"tag":161,"props":162,"children":163},"figure",{},[164,168],{"type":14,"tag":142,"props":165,"children":167},{"src":166,"alt":7},".gitbook/assets/image (2).png",[],{"type":14,"tag":169,"props":170,"children":171},"figcaption",{},[],{"type":14,"tag":22,"props":173,"children":174},{},[175,176,181],{"type":20,"value":131},{"type":14,"tag":50,"props":177,"children":178},{},[179],{"type":20,"value":180},"Faucet >>> Get your first Beam >>> Confirm,",{"type":20,"value":182},"  and Beam coins will deposit into your wallet after the next mining block.",{"type":14,"tag":161,"props":184,"children":185},{},[186,190],{"type":14,"tag":142,"props":187,"children":189},{"src":188,"alt":7},".gitbook/assets/image (16).png",[],{"type":14,"tag":169,"props":191,"children":192},{},[],{"type":14,"tag":78,"props":194,"children":196},{"id":195},"configuring-your-cli-wallet",[197],{"type":20,"value":198},"Configuring your CLI wallet",{"type":14,"tag":22,"props":200,"children":201},{},[202,204,209,211,217],{"type":20,"value":203},"Beam shaders are deployed via CLI wallet which can be found on our ",{"type":14,"tag":26,"props":205,"children":207},{"href":28,"rel":206},[30],[208],{"type":20,"value":94},{"type":20,"value":210},". This tutorial uses Windows Command Prompt, but users can substitute ",{"type":14,"tag":26,"props":212,"children":214},{"href":213},"shader-sdk-mac",[215],{"type":20,"value":216},"Mac",{"type":20,"value":218}," and Linux commands if desired.",{"type":14,"tag":22,"props":220,"children":221},{},[222,224,231,233,238,240,246,248,254],{"type":20,"value":223},"Create a ",{"type":14,"tag":225,"props":226,"children":228},"code",{"className":227},[],[229],{"type":20,"value":230},"shader",{"type":20,"value":232}," folder in your hard drive, and transfer CLI wallet archive. The ",{"type":14,"tag":225,"props":234,"children":236},{"className":235},[],[237],{"type":20,"value":230},{"type":20,"value":239}," folder should contain two files: two files: the ",{"type":14,"tag":225,"props":241,"children":243},{"className":242},[],[244],{"type":20,"value":245},"CLI wallet archive",{"type":20,"value":247}," and wallet ",{"type":14,"tag":225,"props":249,"children":251},{"className":250},[],[252],{"type":20,"value":253},"config",{"type":20,"value":255}," file.",{"type":14,"tag":22,"props":257,"children":258},{},[259,261,267],{"type":20,"value":260},"For this tutorial, we will use our DAppnet's ",{"type":14,"tag":225,"props":262,"children":264},{"className":263},[],[265],{"type":20,"value":266},"wallet.db",{"type":20,"value":268},"(for testing purposes only. This practice is not recommended with wallets containing real assets).",{"type":14,"tag":78,"props":270,"children":272},{"id":271},"copy-walletdb-from-dappnet-wallet",[273,275,280],{"type":20,"value":274},"Copy ",{"type":14,"tag":225,"props":276,"children":278},{"className":277},[],[279],{"type":20,"value":266},{"type":20,"value":281}," from DAppnet Wallet",{"type":14,"tag":22,"props":283,"children":284},{},[285,287,292],{"type":20,"value":286},"Beam wallets store wallet metadata (transaction history, balance, etc) locally on your hard drive in the ",{"type":14,"tag":225,"props":288,"children":290},{"className":289},[],[291],{"type":20,"value":266},{"type":20,"value":255},{"type":14,"tag":22,"props":294,"children":295},{},[296,298,303,305,311,313,318,320,325],{"type":20,"value":297},"Locate your DAppnet ",{"type":14,"tag":225,"props":299,"children":301},{"className":300},[],[302],{"type":20,"value":266},{"type":20,"value":304}," in the ",{"type":14,"tag":225,"props":306,"children":308},{"className":307},[],[309],{"type":20,"value":310},"%LOCALAPPDATA%\\Beam Wallet folder",{"type":20,"value":312},". Transfer the ",{"type":14,"tag":225,"props":314,"children":316},{"className":315},[],[317],{"type":20,"value":266},{"type":20,"value":319}," in the same ",{"type":14,"tag":225,"props":321,"children":323},{"className":322},[],[324],{"type":20,"value":230},{"type":20,"value":326}," folder.",{"type":14,"tag":22,"props":328,"children":329},{},[330,332,338,340,345],{"type":20,"value":331},"Refer to our ",{"type":14,"tag":26,"props":333,"children":335},{"href":334},"beam-wallets/desktop-wallet",[336],{"type":20,"value":337},"Desktop Wallet guide",{"type":20,"value":339}," for ",{"type":14,"tag":225,"props":341,"children":343},{"className":342},[],[344],{"type":20,"value":266},{"type":20,"value":346}," file location for macOS and Linux operating systems.",{"type":14,"tag":161,"props":348,"children":349},{},[350,354],{"type":14,"tag":142,"props":351,"children":353},{"src":352,"alt":7},".gitbook/assets/image (11).png",[],{"type":14,"tag":169,"props":355,"children":356},{},[],{"type":14,"tag":78,"props":358,"children":360},{"id":359},"configure-cli-wallet-settings",[361],{"type":20,"value":362},"Configure CLI wallet settings",{"type":14,"tag":22,"props":364,"children":365},{},[366],{"type":20,"value":367},"One more crucial step before running Shader contracts involves configuring the CLI wallet settings to simplify and shorten commands.",{"type":14,"tag":22,"props":369,"children":370},{},[371,373,378,380,387],{"type":20,"value":372},"To connect CLI wallet's to the built-in node, first edit the ",{"type":14,"tag":225,"props":374,"children":376},{"className":375},[],[377],{"type":20,"value":253},{"type":20,"value":379}," file using text editor (such as ",{"type":14,"tag":26,"props":381,"children":384},{"href":382,"rel":383},"https://code.visualstudio.com/",[30],[385],{"type":20,"value":386},"Visual Studio Code",{"type":20,"value":388},") and enter the following:",{"type":14,"tag":390,"props":391,"children":393},"pre",{"code":392},"log_level=debug\npass=\u003Cyour wallet password>\nnode_addr=127.0.0.1:10005\nwallet_path=wallet.db\n",[394],{"type":14,"tag":225,"props":395,"children":396},{"__ignoreMap":7},[397],{"type":20,"value":392},{"type":14,"tag":22,"props":399,"children":400},{},[401,403,408],{"type":20,"value":402},"The ",{"type":14,"tag":225,"props":404,"children":406},{"className":405},[],[407],{"type":20,"value":253},{"type":20,"value":409}," file should resemble the following:",{"type":14,"tag":390,"props":411,"children":412},{},[413],{"type":14,"tag":225,"props":414,"children":415},{},[416,421],{"type":14,"tag":50,"props":417,"children":418},{},[419],{"type":20,"value":420},"################################################################################\n",{"type":20,"value":422},"# General options:\n################################################################################\n\n# log level [info|debug|verbose]\nlog_level=debug\n\n# file log level [info|debug|verbose]\n# file_log_level=debug\n\n# old logs cleanup period (days)\n# log_cleanup_days=5\n\n################################################################################\n# Wallet options:\n################################################################################\n\n# password for the wallet\npass=123\n\n# phrase to generate secret key according to BIP-39.\n# seed_phrase=\n\n# address of node\nnode_addr=127.0.0.1:10005\n\n# path to wallet file\nwallet_path=wallet.db\n\n# command to execute [new_addr|send|receive|listen|init|info|export_miner_key|export_owner_key|generate_phrase]\n# command=listen\n\n\n",{"type":14,"tag":22,"props":424,"children":425},{},[426],{"type":20,"value":427},"The testing environment is ready to deploy Shaders, all that remains is selecting the Shader contract.",{"type":14,"tag":78,"props":429,"children":431},{"id":430},"choosing-a-shader-application",[432],{"type":20,"value":433},"Choosing a  Shader application",{"type":14,"tag":22,"props":435,"children":436},{},[437,438,445,447,452],{"type":20,"value":402},{"type":14,"tag":26,"props":439,"children":442},{"href":440,"rel":441},"https://dappnet.explorer.beam.mw/",[30],[443],{"type":20,"value":444},"Dappnet Blockchain Explorer",{"type":20,"value":446}," (see ",{"type":14,"tag":50,"props":448,"children":449},{},[450],{"type":20,"value":451},"Contracts",{"type":20,"value":453}," tab) contains a list of Shader contract applications ready for testing.",{"type":14,"tag":161,"props":455,"children":456},{},[457,461],{"type":14,"tag":142,"props":458,"children":460},{"src":459,"alt":7},".gitbook/assets/image (6).png",[],{"type":14,"tag":169,"props":462,"children":463},{},[],{"type":14,"tag":22,"props":465,"children":466},{},[467,469,474],{"type":20,"value":468},"For the purposes of this tutorial, we will select the ",{"type":14,"tag":50,"props":470,"children":471},{},[472],{"type":20,"value":473},"Vault",{"type":20,"value":475}," Shader application (copy the Vault Contract ID -- we will use this later).",{"type":14,"tag":22,"props":477,"children":478},{},[479],{"type":20,"value":480},"At thid time, the list of available contracts is DAppnet. The majority of deployed contracts don't contain a contract description. These features will be adjusted with future iterations of DAppnet.",{"type":14,"tag":22,"props":482,"children":483},{},[484,489,490,501],{"type":14,"tag":50,"props":485,"children":486},{},[487],{"type":20,"value":488},"Please download the Vault application Shader from our",{"type":20,"value":140},{"type":14,"tag":26,"props":491,"children":494},{"href":492,"rel":493},"https://github.com/BeamMW/beam/tree/master/bvm/Shaders/vault",[30],[495,500],{"type":14,"tag":50,"props":496,"children":497},{},[498],{"type":20,"value":499},"Beam repository.",{"type":20,"value":140},{"type":20,"value":502},"The Shader contract will not respond to CLI commands without the precompiled source code.",{"type":14,"tag":22,"props":504,"children":505},{},[506,508,519,521,526,528,533,535,540],{"type":20,"value":507},"Download ",{"type":14,"tag":26,"props":509,"children":512},{"href":510,"rel":511},"https://github.com/BeamMW/beam/blob/master/bvm/Shaders/vault/app.wasm",[30],[513],{"type":14,"tag":225,"props":514,"children":516},{"className":515},[],[517],{"type":20,"value":518},"app.wasm",{"type":20,"value":520}," and copy it to your ",{"type":14,"tag":225,"props":522,"children":524},{"className":523},[],[525],{"type":20,"value":230},{"type":20,"value":527}," folder. ",{"type":14,"tag":50,"props":529,"children":530},{},[531],{"type":20,"value":532},"Note",{"type":20,"value":534},": if you are testing several applications, create a folder for each Shader application so each application contains a separate ",{"type":14,"tag":225,"props":536,"children":538},{"className":537},[],[539],{"type":20,"value":518},{"type":20,"value":255},{"type":14,"tag":78,"props":542,"children":544},{"id":543},"running-shader-commands",[545],{"type":20,"value":546},"Running Shader commands",{"type":14,"tag":22,"props":548,"children":549},{},[550],{"type":20,"value":551},"Open as command line interface and change directory to the location of the CLI wallet executable.",{"type":14,"tag":22,"props":553,"children":554},{},[555],{"type":20,"value":556},"First, print the contract API with the following command:",{"type":14,"tag":390,"props":558,"children":560},{"code":559},"beam-wallet-dappnet.exe shader --shader_app_file vault\\app.wasm\n",[561],{"type":14,"tag":225,"props":562,"children":563},{"__ignoreMap":7},[564],{"type":20,"value":559},{"type":14,"tag":22,"props":566,"children":567},{},[568,570,576,578,583,585,590],{"type":20,"value":569},"Note, we have provided only a single parameter (",{"type":14,"tag":225,"props":571,"children":573},{"className":572},[],[574],{"type":20,"value":575},"--shader_app_file",{"type":20,"value":577},") since it's assume all other parameters are set in the ",{"type":14,"tag":225,"props":579,"children":581},{"className":580},[],[582],{"type":20,"value":253},{"type":20,"value":584}," file and a separate path to the application Shader is found in the ",{"type":14,"tag":225,"props":586,"children":588},{"className":587},[],[589],{"type":20,"value":230},{"type":20,"value":591},"  folder (with the Vault contract).",{"type":14,"tag":22,"props":593,"children":594},{},[595],{"type":20,"value":596},"The output should resemble the following (debug logs are found in this example):",{"type":14,"tag":161,"props":598,"children":599},{},[600,604],{"type":14,"tag":142,"props":601,"children":603},{"src":602,"alt":7},".gitbook/assets/image (21).png",[],{"type":14,"tag":169,"props":605,"children":606},{},[607],{"type":14,"tag":22,"props":608,"children":609},{},[610],{"type":14,"tag":225,"props":611,"children":612},{},[613],{"type":20,"value":614},"--shader_app_file method",{"type":14,"tag":22,"props":616,"children":617},{},[618],{"type":20,"value":619},"Copy the Shader output (see below) into your text editor, (following JSON format).",{"type":14,"tag":390,"props":621,"children":625},{"code":622,"language":623,"meta":7,"className":624,"style":7}," {\n     \"roles\":\n     {\n         \"manager\":\n         {\n             \"create\":\n             {},\n             \"destroy\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"view\":\n             {},\n             \"view_logs\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"view_accounts\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"view_account\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"pubKey\": \"PubKey\"\n             }\n         },\n         \"my_account\":\n         {\n             \"view\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"get_key\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"get_proof\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"aid\": \"AssetID\"\n             },\n             \"deposit\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"pkForeign\": \"PubKey\",\n                 \"bCoSigner\": \"uint32_t\",\n                 \"amount\": \"Amount\",\n                 \"aid\": \"AssetID\"\n             },\n             \"withdraw\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"pkForeign\": \"PubKey\",\n                 \"bCoSigner\": \"uint32_t\",\n                 \"amount\": \"Amount\",\n                 \"aid\": \"AssetID\",\n                 \"amountCoSigner\": \"Amount\"\n             }\n         }\n     }\n }\n","json","language-json shiki shiki-themes github-dark",[626],{"type":14,"tag":225,"props":627,"children":628},{"__ignoreMap":7},[629,640,655,664,677,686,699,708,721,730,750,759,772,780,793,801,817,825,838,846,862,870,883,891,913,931,940,949,962,970,982,990,1006,1014,1027,1035,1051,1059,1072,1080,1100,1118,1126,1139,1147,1167,1189,1211,1233,1249,1257,1270,1278,1298,1318,1338,1358,1379,1397,1405,1414,1423],{"type":14,"tag":630,"props":631,"children":633},"span",{"class":145,"line":632},1,[634],{"type":14,"tag":630,"props":635,"children":637},{"style":636},"--shiki-default:#E1E4E8",[638],{"type":20,"value":639}," {\n",{"type":14,"tag":630,"props":641,"children":643},{"class":145,"line":642},2,[644,650],{"type":14,"tag":630,"props":645,"children":647},{"style":646},"--shiki-default:#79B8FF",[648],{"type":20,"value":649},"     \"roles\"",{"type":14,"tag":630,"props":651,"children":652},{"style":636},[653],{"type":20,"value":654},":\n",{"type":14,"tag":630,"props":656,"children":658},{"class":145,"line":657},3,[659],{"type":14,"tag":630,"props":660,"children":661},{"style":636},[662],{"type":20,"value":663},"     {\n",{"type":14,"tag":630,"props":665,"children":667},{"class":145,"line":666},4,[668,673],{"type":14,"tag":630,"props":669,"children":670},{"style":646},[671],{"type":20,"value":672},"         \"manager\"",{"type":14,"tag":630,"props":674,"children":675},{"style":636},[676],{"type":20,"value":654},{"type":14,"tag":630,"props":678,"children":680},{"class":145,"line":679},5,[681],{"type":14,"tag":630,"props":682,"children":683},{"style":636},[684],{"type":20,"value":685},"         {\n",{"type":14,"tag":630,"props":687,"children":689},{"class":145,"line":688},6,[690,695],{"type":14,"tag":630,"props":691,"children":692},{"style":646},[693],{"type":20,"value":694},"             \"create\"",{"type":14,"tag":630,"props":696,"children":697},{"style":636},[698],{"type":20,"value":654},{"type":14,"tag":630,"props":700,"children":702},{"class":145,"line":701},7,[703],{"type":14,"tag":630,"props":704,"children":705},{"style":636},[706],{"type":20,"value":707},"             {},\n",{"type":14,"tag":630,"props":709,"children":711},{"class":145,"line":710},8,[712,717],{"type":14,"tag":630,"props":713,"children":714},{"style":646},[715],{"type":20,"value":716},"             \"destroy\"",{"type":14,"tag":630,"props":718,"children":719},{"style":636},[720],{"type":20,"value":654},{"type":14,"tag":630,"props":722,"children":724},{"class":145,"line":723},9,[725],{"type":14,"tag":630,"props":726,"children":727},{"style":636},[728],{"type":20,"value":729},"             {\n",{"type":14,"tag":630,"props":731,"children":733},{"class":145,"line":732},10,[734,739,744],{"type":14,"tag":630,"props":735,"children":736},{"style":646},[737],{"type":20,"value":738},"                 \"cid\"",{"type":14,"tag":630,"props":740,"children":741},{"style":636},[742],{"type":20,"value":743},": ",{"type":14,"tag":630,"props":745,"children":747},{"style":746},"--shiki-default:#9ECBFF",[748],{"type":20,"value":749},"\"ContractID\"\n",{"type":14,"tag":630,"props":751,"children":753},{"class":145,"line":752},11,[754],{"type":14,"tag":630,"props":755,"children":756},{"style":636},[757],{"type":20,"value":758},"             },\n",{"type":14,"tag":630,"props":760,"children":762},{"class":145,"line":761},12,[763,768],{"type":14,"tag":630,"props":764,"children":765},{"style":646},[766],{"type":20,"value":767},"             \"view\"",{"type":14,"tag":630,"props":769,"children":770},{"style":636},[771],{"type":20,"value":654},{"type":14,"tag":630,"props":773,"children":775},{"class":145,"line":774},13,[776],{"type":14,"tag":630,"props":777,"children":778},{"style":636},[779],{"type":20,"value":707},{"type":14,"tag":630,"props":781,"children":783},{"class":145,"line":782},14,[784,789],{"type":14,"tag":630,"props":785,"children":786},{"style":646},[787],{"type":20,"value":788},"             \"view_logs\"",{"type":14,"tag":630,"props":790,"children":791},{"style":636},[792],{"type":20,"value":654},{"type":14,"tag":630,"props":794,"children":796},{"class":145,"line":795},15,[797],{"type":14,"tag":630,"props":798,"children":799},{"style":636},[800],{"type":20,"value":729},{"type":14,"tag":630,"props":802,"children":804},{"class":145,"line":803},16,[805,809,813],{"type":14,"tag":630,"props":806,"children":807},{"style":646},[808],{"type":20,"value":738},{"type":14,"tag":630,"props":810,"children":811},{"style":636},[812],{"type":20,"value":743},{"type":14,"tag":630,"props":814,"children":815},{"style":746},[816],{"type":20,"value":749},{"type":14,"tag":630,"props":818,"children":820},{"class":145,"line":819},17,[821],{"type":14,"tag":630,"props":822,"children":823},{"style":636},[824],{"type":20,"value":758},{"type":14,"tag":630,"props":826,"children":828},{"class":145,"line":827},18,[829,834],{"type":14,"tag":630,"props":830,"children":831},{"style":646},[832],{"type":20,"value":833},"             \"view_accounts\"",{"type":14,"tag":630,"props":835,"children":836},{"style":636},[837],{"type":20,"value":654},{"type":14,"tag":630,"props":839,"children":841},{"class":145,"line":840},19,[842],{"type":14,"tag":630,"props":843,"children":844},{"style":636},[845],{"type":20,"value":729},{"type":14,"tag":630,"props":847,"children":849},{"class":145,"line":848},20,[850,854,858],{"type":14,"tag":630,"props":851,"children":852},{"style":646},[853],{"type":20,"value":738},{"type":14,"tag":630,"props":855,"children":856},{"style":636},[857],{"type":20,"value":743},{"type":14,"tag":630,"props":859,"children":860},{"style":746},[861],{"type":20,"value":749},{"type":14,"tag":630,"props":863,"children":865},{"class":145,"line":864},21,[866],{"type":14,"tag":630,"props":867,"children":868},{"style":636},[869],{"type":20,"value":758},{"type":14,"tag":630,"props":871,"children":873},{"class":145,"line":872},22,[874,879],{"type":14,"tag":630,"props":875,"children":876},{"style":646},[877],{"type":20,"value":878},"             \"view_account\"",{"type":14,"tag":630,"props":880,"children":881},{"style":636},[882],{"type":20,"value":654},{"type":14,"tag":630,"props":884,"children":886},{"class":145,"line":885},23,[887],{"type":14,"tag":630,"props":888,"children":889},{"style":636},[890],{"type":20,"value":729},{"type":14,"tag":630,"props":892,"children":894},{"class":145,"line":893},24,[895,899,903,908],{"type":14,"tag":630,"props":896,"children":897},{"style":646},[898],{"type":20,"value":738},{"type":14,"tag":630,"props":900,"children":901},{"style":636},[902],{"type":20,"value":743},{"type":14,"tag":630,"props":904,"children":905},{"style":746},[906],{"type":20,"value":907},"\"ContractID\"",{"type":14,"tag":630,"props":909,"children":910},{"style":636},[911],{"type":20,"value":912},",\n",{"type":14,"tag":630,"props":914,"children":916},{"class":145,"line":915},25,[917,922,926],{"type":14,"tag":630,"props":918,"children":919},{"style":646},[920],{"type":20,"value":921},"                 \"pubKey\"",{"type":14,"tag":630,"props":923,"children":924},{"style":636},[925],{"type":20,"value":743},{"type":14,"tag":630,"props":927,"children":928},{"style":746},[929],{"type":20,"value":930},"\"PubKey\"\n",{"type":14,"tag":630,"props":932,"children":934},{"class":145,"line":933},26,[935],{"type":14,"tag":630,"props":936,"children":937},{"style":636},[938],{"type":20,"value":939},"             }\n",{"type":14,"tag":630,"props":941,"children":943},{"class":145,"line":942},27,[944],{"type":14,"tag":630,"props":945,"children":946},{"style":636},[947],{"type":20,"value":948},"         },\n",{"type":14,"tag":630,"props":950,"children":952},{"class":145,"line":951},28,[953,958],{"type":14,"tag":630,"props":954,"children":955},{"style":646},[956],{"type":20,"value":957},"         \"my_account\"",{"type":14,"tag":630,"props":959,"children":960},{"style":636},[961],{"type":20,"value":654},{"type":14,"tag":630,"props":963,"children":965},{"class":145,"line":964},29,[966],{"type":14,"tag":630,"props":967,"children":968},{"style":636},[969],{"type":20,"value":685},{"type":14,"tag":630,"props":971,"children":973},{"class":145,"line":972},30,[974,978],{"type":14,"tag":630,"props":975,"children":976},{"style":646},[977],{"type":20,"value":767},{"type":14,"tag":630,"props":979,"children":980},{"style":636},[981],{"type":20,"value":654},{"type":14,"tag":630,"props":983,"children":985},{"class":145,"line":984},31,[986],{"type":14,"tag":630,"props":987,"children":988},{"style":636},[989],{"type":20,"value":729},{"type":14,"tag":630,"props":991,"children":993},{"class":145,"line":992},32,[994,998,1002],{"type":14,"tag":630,"props":995,"children":996},{"style":646},[997],{"type":20,"value":738},{"type":14,"tag":630,"props":999,"children":1000},{"style":636},[1001],{"type":20,"value":743},{"type":14,"tag":630,"props":1003,"children":1004},{"style":746},[1005],{"type":20,"value":749},{"type":14,"tag":630,"props":1007,"children":1009},{"class":145,"line":1008},33,[1010],{"type":14,"tag":630,"props":1011,"children":1012},{"style":636},[1013],{"type":20,"value":758},{"type":14,"tag":630,"props":1015,"children":1017},{"class":145,"line":1016},34,[1018,1023],{"type":14,"tag":630,"props":1019,"children":1020},{"style":646},[1021],{"type":20,"value":1022},"             \"get_key\"",{"type":14,"tag":630,"props":1024,"children":1025},{"style":636},[1026],{"type":20,"value":654},{"type":14,"tag":630,"props":1028,"children":1030},{"class":145,"line":1029},35,[1031],{"type":14,"tag":630,"props":1032,"children":1033},{"style":636},[1034],{"type":20,"value":729},{"type":14,"tag":630,"props":1036,"children":1038},{"class":145,"line":1037},36,[1039,1043,1047],{"type":14,"tag":630,"props":1040,"children":1041},{"style":646},[1042],{"type":20,"value":738},{"type":14,"tag":630,"props":1044,"children":1045},{"style":636},[1046],{"type":20,"value":743},{"type":14,"tag":630,"props":1048,"children":1049},{"style":746},[1050],{"type":20,"value":749},{"type":14,"tag":630,"props":1052,"children":1054},{"class":145,"line":1053},37,[1055],{"type":14,"tag":630,"props":1056,"children":1057},{"style":636},[1058],{"type":20,"value":758},{"type":14,"tag":630,"props":1060,"children":1062},{"class":145,"line":1061},38,[1063,1068],{"type":14,"tag":630,"props":1064,"children":1065},{"style":646},[1066],{"type":20,"value":1067},"             \"get_proof\"",{"type":14,"tag":630,"props":1069,"children":1070},{"style":636},[1071],{"type":20,"value":654},{"type":14,"tag":630,"props":1073,"children":1075},{"class":145,"line":1074},39,[1076],{"type":14,"tag":630,"props":1077,"children":1078},{"style":636},[1079],{"type":20,"value":729},{"type":14,"tag":630,"props":1081,"children":1083},{"class":145,"line":1082},40,[1084,1088,1092,1096],{"type":14,"tag":630,"props":1085,"children":1086},{"style":646},[1087],{"type":20,"value":738},{"type":14,"tag":630,"props":1089,"children":1090},{"style":636},[1091],{"type":20,"value":743},{"type":14,"tag":630,"props":1093,"children":1094},{"style":746},[1095],{"type":20,"value":907},{"type":14,"tag":630,"props":1097,"children":1098},{"style":636},[1099],{"type":20,"value":912},{"type":14,"tag":630,"props":1101,"children":1103},{"class":145,"line":1102},41,[1104,1109,1113],{"type":14,"tag":630,"props":1105,"children":1106},{"style":646},[1107],{"type":20,"value":1108},"                 \"aid\"",{"type":14,"tag":630,"props":1110,"children":1111},{"style":636},[1112],{"type":20,"value":743},{"type":14,"tag":630,"props":1114,"children":1115},{"style":746},[1116],{"type":20,"value":1117},"\"AssetID\"\n",{"type":14,"tag":630,"props":1119,"children":1121},{"class":145,"line":1120},42,[1122],{"type":14,"tag":630,"props":1123,"children":1124},{"style":636},[1125],{"type":20,"value":758},{"type":14,"tag":630,"props":1127,"children":1129},{"class":145,"line":1128},43,[1130,1135],{"type":14,"tag":630,"props":1131,"children":1132},{"style":646},[1133],{"type":20,"value":1134},"             \"deposit\"",{"type":14,"tag":630,"props":1136,"children":1137},{"style":636},[1138],{"type":20,"value":654},{"type":14,"tag":630,"props":1140,"children":1142},{"class":145,"line":1141},44,[1143],{"type":14,"tag":630,"props":1144,"children":1145},{"style":636},[1146],{"type":20,"value":729},{"type":14,"tag":630,"props":1148,"children":1150},{"class":145,"line":1149},45,[1151,1155,1159,1163],{"type":14,"tag":630,"props":1152,"children":1153},{"style":646},[1154],{"type":20,"value":738},{"type":14,"tag":630,"props":1156,"children":1157},{"style":636},[1158],{"type":20,"value":743},{"type":14,"tag":630,"props":1160,"children":1161},{"style":746},[1162],{"type":20,"value":907},{"type":14,"tag":630,"props":1164,"children":1165},{"style":636},[1166],{"type":20,"value":912},{"type":14,"tag":630,"props":1168,"children":1170},{"class":145,"line":1169},46,[1171,1176,1180,1185],{"type":14,"tag":630,"props":1172,"children":1173},{"style":646},[1174],{"type":20,"value":1175},"                 \"pkForeign\"",{"type":14,"tag":630,"props":1177,"children":1178},{"style":636},[1179],{"type":20,"value":743},{"type":14,"tag":630,"props":1181,"children":1182},{"style":746},[1183],{"type":20,"value":1184},"\"PubKey\"",{"type":14,"tag":630,"props":1186,"children":1187},{"style":636},[1188],{"type":20,"value":912},{"type":14,"tag":630,"props":1190,"children":1192},{"class":145,"line":1191},47,[1193,1198,1202,1207],{"type":14,"tag":630,"props":1194,"children":1195},{"style":646},[1196],{"type":20,"value":1197},"                 \"bCoSigner\"",{"type":14,"tag":630,"props":1199,"children":1200},{"style":636},[1201],{"type":20,"value":743},{"type":14,"tag":630,"props":1203,"children":1204},{"style":746},[1205],{"type":20,"value":1206},"\"uint32_t\"",{"type":14,"tag":630,"props":1208,"children":1209},{"style":636},[1210],{"type":20,"value":912},{"type":14,"tag":630,"props":1212,"children":1214},{"class":145,"line":1213},48,[1215,1220,1224,1229],{"type":14,"tag":630,"props":1216,"children":1217},{"style":646},[1218],{"type":20,"value":1219},"                 \"amount\"",{"type":14,"tag":630,"props":1221,"children":1222},{"style":636},[1223],{"type":20,"value":743},{"type":14,"tag":630,"props":1225,"children":1226},{"style":746},[1227],{"type":20,"value":1228},"\"Amount\"",{"type":14,"tag":630,"props":1230,"children":1231},{"style":636},[1232],{"type":20,"value":912},{"type":14,"tag":630,"props":1234,"children":1236},{"class":145,"line":1235},49,[1237,1241,1245],{"type":14,"tag":630,"props":1238,"children":1239},{"style":646},[1240],{"type":20,"value":1108},{"type":14,"tag":630,"props":1242,"children":1243},{"style":636},[1244],{"type":20,"value":743},{"type":14,"tag":630,"props":1246,"children":1247},{"style":746},[1248],{"type":20,"value":1117},{"type":14,"tag":630,"props":1250,"children":1252},{"class":145,"line":1251},50,[1253],{"type":14,"tag":630,"props":1254,"children":1255},{"style":636},[1256],{"type":20,"value":758},{"type":14,"tag":630,"props":1258,"children":1260},{"class":145,"line":1259},51,[1261,1266],{"type":14,"tag":630,"props":1262,"children":1263},{"style":646},[1264],{"type":20,"value":1265},"             \"withdraw\"",{"type":14,"tag":630,"props":1267,"children":1268},{"style":636},[1269],{"type":20,"value":654},{"type":14,"tag":630,"props":1271,"children":1273},{"class":145,"line":1272},52,[1274],{"type":14,"tag":630,"props":1275,"children":1276},{"style":636},[1277],{"type":20,"value":729},{"type":14,"tag":630,"props":1279,"children":1281},{"class":145,"line":1280},53,[1282,1286,1290,1294],{"type":14,"tag":630,"props":1283,"children":1284},{"style":646},[1285],{"type":20,"value":738},{"type":14,"tag":630,"props":1287,"children":1288},{"style":636},[1289],{"type":20,"value":743},{"type":14,"tag":630,"props":1291,"children":1292},{"style":746},[1293],{"type":20,"value":907},{"type":14,"tag":630,"props":1295,"children":1296},{"style":636},[1297],{"type":20,"value":912},{"type":14,"tag":630,"props":1299,"children":1301},{"class":145,"line":1300},54,[1302,1306,1310,1314],{"type":14,"tag":630,"props":1303,"children":1304},{"style":646},[1305],{"type":20,"value":1175},{"type":14,"tag":630,"props":1307,"children":1308},{"style":636},[1309],{"type":20,"value":743},{"type":14,"tag":630,"props":1311,"children":1312},{"style":746},[1313],{"type":20,"value":1184},{"type":14,"tag":630,"props":1315,"children":1316},{"style":636},[1317],{"type":20,"value":912},{"type":14,"tag":630,"props":1319,"children":1321},{"class":145,"line":1320},55,[1322,1326,1330,1334],{"type":14,"tag":630,"props":1323,"children":1324},{"style":646},[1325],{"type":20,"value":1197},{"type":14,"tag":630,"props":1327,"children":1328},{"style":636},[1329],{"type":20,"value":743},{"type":14,"tag":630,"props":1331,"children":1332},{"style":746},[1333],{"type":20,"value":1206},{"type":14,"tag":630,"props":1335,"children":1336},{"style":636},[1337],{"type":20,"value":912},{"type":14,"tag":630,"props":1339,"children":1341},{"class":145,"line":1340},56,[1342,1346,1350,1354],{"type":14,"tag":630,"props":1343,"children":1344},{"style":646},[1345],{"type":20,"value":1219},{"type":14,"tag":630,"props":1347,"children":1348},{"style":636},[1349],{"type":20,"value":743},{"type":14,"tag":630,"props":1351,"children":1352},{"style":746},[1353],{"type":20,"value":1228},{"type":14,"tag":630,"props":1355,"children":1356},{"style":636},[1357],{"type":20,"value":912},{"type":14,"tag":630,"props":1359,"children":1361},{"class":145,"line":1360},57,[1362,1366,1370,1375],{"type":14,"tag":630,"props":1363,"children":1364},{"style":646},[1365],{"type":20,"value":1108},{"type":14,"tag":630,"props":1367,"children":1368},{"style":636},[1369],{"type":20,"value":743},{"type":14,"tag":630,"props":1371,"children":1372},{"style":746},[1373],{"type":20,"value":1374},"\"AssetID\"",{"type":14,"tag":630,"props":1376,"children":1377},{"style":636},[1378],{"type":20,"value":912},{"type":14,"tag":630,"props":1380,"children":1382},{"class":145,"line":1381},58,[1383,1388,1392],{"type":14,"tag":630,"props":1384,"children":1385},{"style":646},[1386],{"type":20,"value":1387},"                 \"amountCoSigner\"",{"type":14,"tag":630,"props":1389,"children":1390},{"style":636},[1391],{"type":20,"value":743},{"type":14,"tag":630,"props":1393,"children":1394},{"style":746},[1395],{"type":20,"value":1396},"\"Amount\"\n",{"type":14,"tag":630,"props":1398,"children":1400},{"class":145,"line":1399},59,[1401],{"type":14,"tag":630,"props":1402,"children":1403},{"style":636},[1404],{"type":20,"value":939},{"type":14,"tag":630,"props":1406,"children":1408},{"class":145,"line":1407},60,[1409],{"type":14,"tag":630,"props":1410,"children":1411},{"style":636},[1412],{"type":20,"value":1413},"         }\n",{"type":14,"tag":630,"props":1415,"children":1417},{"class":145,"line":1416},61,[1418],{"type":14,"tag":630,"props":1419,"children":1420},{"style":636},[1421],{"type":20,"value":1422},"     }\n",{"type":14,"tag":630,"props":1424,"children":1426},{"class":145,"line":1425},62,[1427],{"type":14,"tag":630,"props":1428,"children":1429},{"style":636},[1430],{"type":20,"value":1431}," }\n",{"type":14,"tag":22,"props":1433,"children":1434},{},[1435,1437,1443,1445,1451],{"type":20,"value":1436},"The Vault contract API (as retrieved from the Vault Shader contract) separates the API actions into roles, (",{"type":14,"tag":225,"props":1438,"children":1440},{"className":1439},[],[1441],{"type":20,"value":1442},"manager",{"type":20,"value":1444}," , ",{"type":14,"tag":225,"props":1446,"children":1448},{"className":1447},[],[1449],{"type":20,"value":1450},"my_account",{"type":20,"value":1452},") following semantic structure.",{"type":14,"tag":22,"props":1454,"children":1455},{},[1456,1457,1463,1465,1471,1473,1478],{"type":20,"value":402},{"type":14,"tag":225,"props":1458,"children":1460},{"className":1459},[],[1461],{"type":20,"value":1462},"view_accounts",{"type":20,"value":1464}," method will list all Vault accounts present and were we can can plug the Valut Shader (found in the ",{"type":14,"tag":26,"props":1466,"children":1468},{"href":440,"rel":1467},[30],[1469],{"type":20,"value":1470},"DAppnet explorer",{"type":20,"value":1472},") contract ID into the ",{"type":14,"tag":225,"props":1474,"children":1476},{"className":1475},[],[1477],{"type":20,"value":1462},{"type":20,"value":1479}," parameter.",{"type":14,"tag":390,"props":1481,"children":1483},{"code":1482},"d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\n",[1484],{"type":14,"tag":225,"props":1485,"children":1486},{"__ignoreMap":7},[1487],{"type":20,"value":1482},{"type":14,"tag":22,"props":1489,"children":1490},{},[1491],{"type":20,"value":1492},"Enter the following command:",{"type":14,"tag":390,"props":1494,"children":1496},{"code":1495},"beam-wallet-dappnet.exe shader --shader_app_file vault\\app.wasm --shader_args=cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14,role=manager,action=view_accounts\n",[1497],{"type":14,"tag":225,"props":1498,"children":1499},{"__ignoreMap":7},[1500],{"type":20,"value":1495},{"type":14,"tag":22,"props":1502,"children":1503},{},[1504],{"type":20,"value":1505},"The output should resemble the following:",{"type":14,"tag":161,"props":1507,"children":1508},{},[1509,1513],{"type":14,"tag":142,"props":1510,"children":1512},{"src":1511,"alt":7},".gitbook/assets/image (17).png",[],{"type":14,"tag":169,"props":1514,"children":1515},{},[1516],{"type":14,"tag":22,"props":1517,"children":1518},{},[1519],{"type":20,"value":1520},"View_accounts method",{"type":14,"tag":22,"props":1522,"children":1523},{},[1524,1526,1532],{"type":20,"value":1525},"In the above example, there are currently no accounts within the contract. To create an account, utilize ",{"type":14,"tag":225,"props":1527,"children":1529},{"className":1528},[],[1530],{"type":20,"value":1531},"deposit",{"type":20,"value":1533}," method and deposit one Beam coin with the following command:",{"type":14,"tag":390,"props":1535,"children":1537},{"code":1536},"beam-wallet-dappnet.exe shader --shader_app_file vault\\app.wasm --shader_args=\"cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14,role=my_account,action=deposit,amount=100000000\"\n",[1538],{"type":14,"tag":225,"props":1539,"children":1540},{"__ignoreMap":7},[1541],{"type":20,"value":1536},{"type":14,"tag":22,"props":1543,"children":1544},{},[1545,1550,1551,1557],{"type":14,"tag":50,"props":1546,"children":1547},{},[1548],{"type":20,"value":1549},"Note:",{"type":20,"value":140},{"type":14,"tag":225,"props":1552,"children":1554},{"className":1553},[],[1555],{"type":20,"value":1556},"amount",{"type":20,"value":1558}," is set in Groth, which is $$1^10-8$$  of Beam.",{"type":14,"tag":22,"props":1560,"children":1561},{},[1562],{"type":20,"value":1563},"The above action creates and sends the transaction to the network (so it will take a moment). When completed, the output should resemble the following:",{"type":14,"tag":161,"props":1565,"children":1566},{},[1567,1571],{"type":14,"tag":142,"props":1568,"children":1570},{"src":1569,"alt":7},".gitbook/assets/image (5).png",[],{"type":14,"tag":169,"props":1572,"children":1573},{},[1574],{"type":14,"tag":22,"props":1575,"children":1576},{},[1577,1582],{"type":14,"tag":225,"props":1578,"children":1579},{},[1580],{"type":20,"value":1581},"Deposit",{"type":20,"value":1583}," Method",{"type":14,"tag":22,"props":1585,"children":1586},{},[1587],{"type":20,"value":1588},"The response generated (see below) clarfies the API response:",{"type":14,"tag":161,"props":1590,"children":1591},{},[1592,1596],{"type":14,"tag":142,"props":1593,"children":1595},{"src":1594,"alt":7},".gitbook/assets/image (18).png",[],{"type":14,"tag":169,"props":1597,"children":1598},{},[1599],{"type":14,"tag":22,"props":1600,"children":1601},{},[1602],{"type":20,"value":1603},"Deposit successful",{"type":14,"tag":22,"props":1605,"children":1606},{},[1607,1609,1615],{"type":20,"value":1608},"To confirm the transaction was successful, re-enter the ",{"type":14,"tag":225,"props":1610,"children":1612},{"className":1611},[],[1613],{"type":20,"value":1614},"accounts",{"type":20,"value":1616}," command:",{"type":14,"tag":161,"props":1618,"children":1619},{},[1620,1624],{"type":14,"tag":142,"props":1621,"children":1623},{"src":1622,"alt":7},".gitbook/assets/image (7).png",[],{"type":14,"tag":169,"props":1625,"children":1626},{},[1627],{"type":14,"tag":22,"props":1628,"children":1629},{},[1630],{"type":20,"value":1631},"New account creation",{"type":14,"tag":22,"props":1633,"children":1634},{},[1635,1637,1642],{"type":20,"value":1636},"The response generated confirms a new account is identified by your wallet public key and has a balance of one Beams. To get aquainted with the API function, try depositing and withdrawing Beam's into your account. Users can also attempt to retrieve Beam's from a seperate account (",{"type":14,"tag":50,"props":1638,"children":1639},{},[1640],{"type":20,"value":1641},"spoiler: it won't work",{"type":20,"value":1643},").",{"type":14,"tag":22,"props":1645,"children":1646},{},[1647,1649,1655],{"type":20,"value":1648},"To learn how to code your own Shader application contract and deploy it chain, please refer to our ",{"type":14,"tag":26,"props":1650,"children":1652},{"href":1651},"shader-sdk-win",[1653],{"type":20,"value":1654},"Shader SDK tutorial",{"type":20,"value":96},{"type":14,"tag":1657,"props":1658,"children":1659},"style",{},[1660],{"type":20,"value":1661},"html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":642,"depth":642,"links":1663},[1664,1665,1666,1667,1669,1670,1671],{"id":80,"depth":657,"text":83},{"id":118,"depth":657,"text":121},{"id":195,"depth":657,"text":198},{"id":271,"depth":657,"text":1668},"Copy wallet.db from DAppnet Wallet",{"id":359,"depth":657,"text":362},{"id":430,"depth":657,"text":433},{"id":543,"depth":657,"text":546},"markdown","docs:docs:dev:using-beam-shaders.md","docs","docs/dev/using-beam-shaders.md","md",1777630718713]