[{"data":1,"prerenderedAt":1239},["Reactive",2],{"content-query-QS5Nnyl6nB":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"body":10,"_type":1234,"_id":1235,"_source":1236,"_file":1237,"_extension":1238},"/docs/dev/using-beam-shaders-with-cli-wallet","dev",false,"","Using Beam Shaders with CLI wallet","This document describes how to use Beam Shaders with CLI wallet running on a local network",{"type":11,"children":12,"toc":1226},"root",[13,21,36,43,128,134,139,163,191,197,202,211,219,227,235,850,878,975,994,1000,1018,1063,1076,1084,1092,1100,1106,1132,1140,1145,1153,1159,1220],{"type":14,"tag":15,"props":16,"children":18},"element","h1",{"id":17},"using-beam-shaders-with-cli-wallet",[19],{"type":20,"value":8},"text",{"type":14,"tag":22,"props":23,"children":24},"p",{},[25,27,34],{"type":20,"value":26},"This page is somewhat obsolete, and is replaced with ",{"type":14,"tag":28,"props":29,"children":31},"a",{"href":30},"using-beam-shaders",[32],{"type":20,"value":33},"Using Beam Shaders",{"type":20,"value":35}," tutorial",{"type":14,"tag":37,"props":38,"children":40},"h3",{"id":39},"prerequisites",[41],{"type":20,"value":42},"Prerequisites",{"type":14,"tag":44,"props":45,"children":46},"ol",{},[47,97,110,123],{"type":14,"tag":48,"props":49,"children":50},"li",{},[51,53,59,61,65,71,73,80,82,88,89,95],{"type":20,"value":52},"Make sure you have ",{"type":14,"tag":28,"props":54,"children":56},{"href":55},"broken-reference",[57],{"type":20,"value":58},"node running",{"type":20,"value":60}," and connected to local network.",{"type":14,"tag":62,"props":63,"children":64},"br",{},[],{"type":14,"tag":66,"props":67,"children":68},"strong",{},[69],{"type":20,"value":70},"Notice:",{"type":20,"value":72}," Shaders are applied after the third fork with height 1500. Therefore, for faster testing, we recommend to define lower heights using the ",{"type":14,"tag":74,"props":75,"children":77},"code",{"className":76},[],[78],{"type":20,"value":79},"--Fork1",{"type":20,"value":81},", ",{"type":14,"tag":74,"props":83,"children":85},{"className":84},[],[86],{"type":20,"value":87},"--Fork2",{"type":20,"value":81},{"type":14,"tag":74,"props":90,"children":92},{"className":91},[],[93],{"type":20,"value":94},"--Fork3",{"type":20,"value":96}," attributes.",{"type":14,"tag":48,"props":98,"children":99},{},[100,102,108],{"type":20,"value":101},"Create at least one Beam node[link] with ",{"type":14,"tag":74,"props":103,"children":105},{"className":104},[],[106],{"type":20,"value":107},"--peer=\u003Cip:port of the first node>",{"type":20,"value":109}," for the transaction replication.",{"type":14,"tag":48,"props":111,"children":112},{},[113,115,121],{"type":20,"value":114},"Make sure you have Beam ",{"type":14,"tag":28,"props":116,"children":118},{"href":117},"beam-wallets/command-line-wallet",[119],{"type":20,"value":120},"CLI wallet connected to your Beam node",{"type":20,"value":122}," or to one of the Beam bootstrap nodes.",{"type":14,"tag":48,"props":124,"children":125},{},[126],{"type":20,"value":127},"You must have funds in your wallet to pay the fee.",{"type":14,"tag":37,"props":129,"children":131},{"id":130},"shaders",[132],{"type":20,"value":133},"Shaders",{"type":14,"tag":22,"props":135,"children":136},{},[137],{"type":20,"value":138},"There are two types of Shaders in Beam:",{"type":14,"tag":140,"props":141,"children":142},"ul",{},[143,153],{"type":14,"tag":48,"props":144,"children":145},{},[146,151],{"type":14,"tag":66,"props":147,"children":148},{},[149],{"type":20,"value":150},"Contract Shader",{"type":20,"value":152}," - implements Smart Contract functionality, is stored on the blockchain and are running on Beam nodes.",{"type":14,"tag":48,"props":154,"children":155},{},[156,161],{"type":14,"tag":66,"props":157,"children":158},{},[159],{"type":20,"value":160},"App Shaders",{"type":20,"value":162}," - implements Smart Contract API and is running in Beam wallet.",{"type":14,"tag":22,"props":164,"children":165},{},[166,172,174,185,186],{"type":14,"tag":167,"props":168,"children":169},"em",{},[170],{"type":20,"value":171},"All examples refer to a sample application 'mydapp' which has two",{"type":20,"value":173}," ",{"type":14,"tag":28,"props":175,"children":179},{"href":176,"rel":177},"https://github.com/BeamMW/beam/tree/master/bvm/Shaders/vault",[178],"nofollow",[180],{"type":14,"tag":167,"props":181,"children":182},{},[183],{"type":20,"value":184},"Vault",{"type":20,"value":173},{"type":14,"tag":167,"props":187,"children":188},{},[189],{"type":20,"value":190},"Shaders: App Shader(app.wasm) and Contract Shader(contract.wasm).",{"type":14,"tag":37,"props":192,"children":194},{"id":193},"shader-api",[195],{"type":20,"value":196},"Shader API",{"type":14,"tag":22,"props":198,"children":199},{},[200],{"type":20,"value":201},"First of all, you need to know the available actions of a contract. To see all commands supported by the App Shader enter the following command:",{"type":14,"tag":203,"props":204,"children":206},"pre",{"code":205},"./beam-wallet-masternet shader --shader_app_file=mydapp/app.wasm -n \u003Cnode>\n",[207],{"type":14,"tag":74,"props":208,"children":209},{"__ignoreMap":7},[210],{"type":20,"value":205},{"type":14,"tag":22,"props":212,"children":213},{},[214,217],{"type":14,"tag":62,"props":215,"children":216},{},[],{"type":20,"value":218},"\nThe output is a json format line:",{"type":14,"tag":203,"props":220,"children":222},{"code":221},"Shader output: {\"roles\": {\"manager\": {\"create\": {},\"destroy\": {\"cid\": \"ContractID\"},\"view\": {},\"view_logs\": {\"cid\": \"ContractID\"},\"view_accounts\": {\"cid\": \"ContractID\"},\"view_account\": {\"cid\": \"ContractID\",\"pubKey\": \"PubKey\"}},\"my_account\": {\"view\": {\"cid\": \"ContractID\"},\"get_key\": {\"cid\": \"ContractID\"},\"get_proof\": {\"cid\": \"ContractID\",\"aid\": \"AssetID\"},\"deposit\": {\"cid\": \"ContractID\",\"pkForeign\": \"PubKey\",\"bCoSigner\": \"uint32_t\",\"amount\": \"Amount\",\"aid\": \"AssetID\"},\"withdraw\": {\"cid\": \"ContractID\",\"pkForeign\": \"PubKey\",\"bCoSigner\": \"uint32_t\",\"amount\": \"Amount\",\"aid\": \"AssetID\"}}}}\n",[223],{"type":14,"tag":74,"props":224,"children":225},{"__ignoreMap":7},[226],{"type":20,"value":221},{"type":14,"tag":22,"props":228,"children":229},{},[230,233],{"type":14,"tag":62,"props":231,"children":232},{},[],{"type":20,"value":234},"\nFor convenience, let's put it this way:",{"type":14,"tag":203,"props":236,"children":240},{"code":237,"language":238,"meta":7,"className":239,"style":7},"{\n  \"roles\": {\n    \"manager\": {\n      \"create\": {},\n      \"destroy\": { \"cid\": \"ContractID\" },\n      \"view\": {},\n      \"view_logs\": { \"cid\": \"ContractID\" },\n      \"view_accounts\": { \"cid\": \"ContractID\" },\n      \"view_account\": { \"cid\": \"ContractID\", \"pubKey\": \"PubKey\" }\n    },\n    \"my_account\": {\n      \"view\": { \"cid\": \"ContractID\" },\n      \"get_key\": { \"cid\": \"ContractID\" },\n      \"get_proof\": { \"cid\": \"ContractID\", \"aid\": \"AssetID\" },\n      \"deposit\": {\n        \"cid\": \"ContractID\",\n        \"pkForeign\": \"PubKey\",\n        \"bCoSigner\": \"uint32_t\",\n        \"amount\": \"Amount\",\n        \"aid\": \"AssetID\"\n      },\n      \"withdraw\": {\n        \"cid\": \"ContractID\",\n        \"pkForeign\": \"PubKey\",\n        \"bCoSigner\": \"uint32_t\",\n        \"amount\": \"Amount\",\n        \"aid\": \"AssetID\"\n      }\n    }\n  }\n}\n","json","language-json shiki shiki-themes github-dark",[241],{"type":14,"tag":74,"props":242,"children":243},{"__ignoreMap":7},[244,256,271,284,298,333,346,375,404,452,461,474,502,531,578,591,613,634,656,678,696,705,718,738,758,778,798,814,823,832,841],{"type":14,"tag":245,"props":246,"children":249},"span",{"class":247,"line":248},"line",1,[250],{"type":14,"tag":245,"props":251,"children":253},{"style":252},"--shiki-default:#E1E4E8",[254],{"type":20,"value":255},"{\n",{"type":14,"tag":245,"props":257,"children":259},{"class":247,"line":258},2,[260,266],{"type":14,"tag":245,"props":261,"children":263},{"style":262},"--shiki-default:#79B8FF",[264],{"type":20,"value":265},"  \"roles\"",{"type":14,"tag":245,"props":267,"children":268},{"style":252},[269],{"type":20,"value":270},": {\n",{"type":14,"tag":245,"props":272,"children":274},{"class":247,"line":273},3,[275,280],{"type":14,"tag":245,"props":276,"children":277},{"style":262},[278],{"type":20,"value":279},"    \"manager\"",{"type":14,"tag":245,"props":281,"children":282},{"style":252},[283],{"type":20,"value":270},{"type":14,"tag":245,"props":285,"children":287},{"class":247,"line":286},4,[288,293],{"type":14,"tag":245,"props":289,"children":290},{"style":262},[291],{"type":20,"value":292},"      \"create\"",{"type":14,"tag":245,"props":294,"children":295},{"style":252},[296],{"type":20,"value":297},": {},\n",{"type":14,"tag":245,"props":299,"children":301},{"class":247,"line":300},5,[302,307,312,317,322,328],{"type":14,"tag":245,"props":303,"children":304},{"style":262},[305],{"type":20,"value":306},"      \"destroy\"",{"type":14,"tag":245,"props":308,"children":309},{"style":252},[310],{"type":20,"value":311},": { ",{"type":14,"tag":245,"props":313,"children":314},{"style":262},[315],{"type":20,"value":316},"\"cid\"",{"type":14,"tag":245,"props":318,"children":319},{"style":252},[320],{"type":20,"value":321},": ",{"type":14,"tag":245,"props":323,"children":325},{"style":324},"--shiki-default:#9ECBFF",[326],{"type":20,"value":327},"\"ContractID\"",{"type":14,"tag":245,"props":329,"children":330},{"style":252},[331],{"type":20,"value":332}," },\n",{"type":14,"tag":245,"props":334,"children":336},{"class":247,"line":335},6,[337,342],{"type":14,"tag":245,"props":338,"children":339},{"style":262},[340],{"type":20,"value":341},"      \"view\"",{"type":14,"tag":245,"props":343,"children":344},{"style":252},[345],{"type":20,"value":297},{"type":14,"tag":245,"props":347,"children":349},{"class":247,"line":348},7,[350,355,359,363,367,371],{"type":14,"tag":245,"props":351,"children":352},{"style":262},[353],{"type":20,"value":354},"      \"view_logs\"",{"type":14,"tag":245,"props":356,"children":357},{"style":252},[358],{"type":20,"value":311},{"type":14,"tag":245,"props":360,"children":361},{"style":262},[362],{"type":20,"value":316},{"type":14,"tag":245,"props":364,"children":365},{"style":252},[366],{"type":20,"value":321},{"type":14,"tag":245,"props":368,"children":369},{"style":324},[370],{"type":20,"value":327},{"type":14,"tag":245,"props":372,"children":373},{"style":252},[374],{"type":20,"value":332},{"type":14,"tag":245,"props":376,"children":378},{"class":247,"line":377},8,[379,384,388,392,396,400],{"type":14,"tag":245,"props":380,"children":381},{"style":262},[382],{"type":20,"value":383},"      \"view_accounts\"",{"type":14,"tag":245,"props":385,"children":386},{"style":252},[387],{"type":20,"value":311},{"type":14,"tag":245,"props":389,"children":390},{"style":262},[391],{"type":20,"value":316},{"type":14,"tag":245,"props":393,"children":394},{"style":252},[395],{"type":20,"value":321},{"type":14,"tag":245,"props":397,"children":398},{"style":324},[399],{"type":20,"value":327},{"type":14,"tag":245,"props":401,"children":402},{"style":252},[403],{"type":20,"value":332},{"type":14,"tag":245,"props":405,"children":407},{"class":247,"line":406},9,[408,413,417,421,425,429,433,438,442,447],{"type":14,"tag":245,"props":409,"children":410},{"style":262},[411],{"type":20,"value":412},"      \"view_account\"",{"type":14,"tag":245,"props":414,"children":415},{"style":252},[416],{"type":20,"value":311},{"type":14,"tag":245,"props":418,"children":419},{"style":262},[420],{"type":20,"value":316},{"type":14,"tag":245,"props":422,"children":423},{"style":252},[424],{"type":20,"value":321},{"type":14,"tag":245,"props":426,"children":427},{"style":324},[428],{"type":20,"value":327},{"type":14,"tag":245,"props":430,"children":431},{"style":252},[432],{"type":20,"value":81},{"type":14,"tag":245,"props":434,"children":435},{"style":262},[436],{"type":20,"value":437},"\"pubKey\"",{"type":14,"tag":245,"props":439,"children":440},{"style":252},[441],{"type":20,"value":321},{"type":14,"tag":245,"props":443,"children":444},{"style":324},[445],{"type":20,"value":446},"\"PubKey\"",{"type":14,"tag":245,"props":448,"children":449},{"style":252},[450],{"type":20,"value":451}," }\n",{"type":14,"tag":245,"props":453,"children":455},{"class":247,"line":454},10,[456],{"type":14,"tag":245,"props":457,"children":458},{"style":252},[459],{"type":20,"value":460},"    },\n",{"type":14,"tag":245,"props":462,"children":464},{"class":247,"line":463},11,[465,470],{"type":14,"tag":245,"props":466,"children":467},{"style":262},[468],{"type":20,"value":469},"    \"my_account\"",{"type":14,"tag":245,"props":471,"children":472},{"style":252},[473],{"type":20,"value":270},{"type":14,"tag":245,"props":475,"children":477},{"class":247,"line":476},12,[478,482,486,490,494,498],{"type":14,"tag":245,"props":479,"children":480},{"style":262},[481],{"type":20,"value":341},{"type":14,"tag":245,"props":483,"children":484},{"style":252},[485],{"type":20,"value":311},{"type":14,"tag":245,"props":487,"children":488},{"style":262},[489],{"type":20,"value":316},{"type":14,"tag":245,"props":491,"children":492},{"style":252},[493],{"type":20,"value":321},{"type":14,"tag":245,"props":495,"children":496},{"style":324},[497],{"type":20,"value":327},{"type":14,"tag":245,"props":499,"children":500},{"style":252},[501],{"type":20,"value":332},{"type":14,"tag":245,"props":503,"children":505},{"class":247,"line":504},13,[506,511,515,519,523,527],{"type":14,"tag":245,"props":507,"children":508},{"style":262},[509],{"type":20,"value":510},"      \"get_key\"",{"type":14,"tag":245,"props":512,"children":513},{"style":252},[514],{"type":20,"value":311},{"type":14,"tag":245,"props":516,"children":517},{"style":262},[518],{"type":20,"value":316},{"type":14,"tag":245,"props":520,"children":521},{"style":252},[522],{"type":20,"value":321},{"type":14,"tag":245,"props":524,"children":525},{"style":324},[526],{"type":20,"value":327},{"type":14,"tag":245,"props":528,"children":529},{"style":252},[530],{"type":20,"value":332},{"type":14,"tag":245,"props":532,"children":534},{"class":247,"line":533},14,[535,540,544,548,552,556,560,565,569,574],{"type":14,"tag":245,"props":536,"children":537},{"style":262},[538],{"type":20,"value":539},"      \"get_proof\"",{"type":14,"tag":245,"props":541,"children":542},{"style":252},[543],{"type":20,"value":311},{"type":14,"tag":245,"props":545,"children":546},{"style":262},[547],{"type":20,"value":316},{"type":14,"tag":245,"props":549,"children":550},{"style":252},[551],{"type":20,"value":321},{"type":14,"tag":245,"props":553,"children":554},{"style":324},[555],{"type":20,"value":327},{"type":14,"tag":245,"props":557,"children":558},{"style":252},[559],{"type":20,"value":81},{"type":14,"tag":245,"props":561,"children":562},{"style":262},[563],{"type":20,"value":564},"\"aid\"",{"type":14,"tag":245,"props":566,"children":567},{"style":252},[568],{"type":20,"value":321},{"type":14,"tag":245,"props":570,"children":571},{"style":324},[572],{"type":20,"value":573},"\"AssetID\"",{"type":14,"tag":245,"props":575,"children":576},{"style":252},[577],{"type":20,"value":332},{"type":14,"tag":245,"props":579,"children":581},{"class":247,"line":580},15,[582,587],{"type":14,"tag":245,"props":583,"children":584},{"style":262},[585],{"type":20,"value":586},"      \"deposit\"",{"type":14,"tag":245,"props":588,"children":589},{"style":252},[590],{"type":20,"value":270},{"type":14,"tag":245,"props":592,"children":594},{"class":247,"line":593},16,[595,600,604,608],{"type":14,"tag":245,"props":596,"children":597},{"style":262},[598],{"type":20,"value":599},"        \"cid\"",{"type":14,"tag":245,"props":601,"children":602},{"style":252},[603],{"type":20,"value":321},{"type":14,"tag":245,"props":605,"children":606},{"style":324},[607],{"type":20,"value":327},{"type":14,"tag":245,"props":609,"children":610},{"style":252},[611],{"type":20,"value":612},",\n",{"type":14,"tag":245,"props":614,"children":616},{"class":247,"line":615},17,[617,622,626,630],{"type":14,"tag":245,"props":618,"children":619},{"style":262},[620],{"type":20,"value":621},"        \"pkForeign\"",{"type":14,"tag":245,"props":623,"children":624},{"style":252},[625],{"type":20,"value":321},{"type":14,"tag":245,"props":627,"children":628},{"style":324},[629],{"type":20,"value":446},{"type":14,"tag":245,"props":631,"children":632},{"style":252},[633],{"type":20,"value":612},{"type":14,"tag":245,"props":635,"children":637},{"class":247,"line":636},18,[638,643,647,652],{"type":14,"tag":245,"props":639,"children":640},{"style":262},[641],{"type":20,"value":642},"        \"bCoSigner\"",{"type":14,"tag":245,"props":644,"children":645},{"style":252},[646],{"type":20,"value":321},{"type":14,"tag":245,"props":648,"children":649},{"style":324},[650],{"type":20,"value":651},"\"uint32_t\"",{"type":14,"tag":245,"props":653,"children":654},{"style":252},[655],{"type":20,"value":612},{"type":14,"tag":245,"props":657,"children":659},{"class":247,"line":658},19,[660,665,669,674],{"type":14,"tag":245,"props":661,"children":662},{"style":262},[663],{"type":20,"value":664},"        \"amount\"",{"type":14,"tag":245,"props":666,"children":667},{"style":252},[668],{"type":20,"value":321},{"type":14,"tag":245,"props":670,"children":671},{"style":324},[672],{"type":20,"value":673},"\"Amount\"",{"type":14,"tag":245,"props":675,"children":676},{"style":252},[677],{"type":20,"value":612},{"type":14,"tag":245,"props":679,"children":681},{"class":247,"line":680},20,[682,687,691],{"type":14,"tag":245,"props":683,"children":684},{"style":262},[685],{"type":20,"value":686},"        \"aid\"",{"type":14,"tag":245,"props":688,"children":689},{"style":252},[690],{"type":20,"value":321},{"type":14,"tag":245,"props":692,"children":693},{"style":324},[694],{"type":20,"value":695},"\"AssetID\"\n",{"type":14,"tag":245,"props":697,"children":699},{"class":247,"line":698},21,[700],{"type":14,"tag":245,"props":701,"children":702},{"style":252},[703],{"type":20,"value":704},"      },\n",{"type":14,"tag":245,"props":706,"children":708},{"class":247,"line":707},22,[709,714],{"type":14,"tag":245,"props":710,"children":711},{"style":262},[712],{"type":20,"value":713},"      \"withdraw\"",{"type":14,"tag":245,"props":715,"children":716},{"style":252},[717],{"type":20,"value":270},{"type":14,"tag":245,"props":719,"children":721},{"class":247,"line":720},23,[722,726,730,734],{"type":14,"tag":245,"props":723,"children":724},{"style":262},[725],{"type":20,"value":599},{"type":14,"tag":245,"props":727,"children":728},{"style":252},[729],{"type":20,"value":321},{"type":14,"tag":245,"props":731,"children":732},{"style":324},[733],{"type":20,"value":327},{"type":14,"tag":245,"props":735,"children":736},{"style":252},[737],{"type":20,"value":612},{"type":14,"tag":245,"props":739,"children":741},{"class":247,"line":740},24,[742,746,750,754],{"type":14,"tag":245,"props":743,"children":744},{"style":262},[745],{"type":20,"value":621},{"type":14,"tag":245,"props":747,"children":748},{"style":252},[749],{"type":20,"value":321},{"type":14,"tag":245,"props":751,"children":752},{"style":324},[753],{"type":20,"value":446},{"type":14,"tag":245,"props":755,"children":756},{"style":252},[757],{"type":20,"value":612},{"type":14,"tag":245,"props":759,"children":761},{"class":247,"line":760},25,[762,766,770,774],{"type":14,"tag":245,"props":763,"children":764},{"style":262},[765],{"type":20,"value":642},{"type":14,"tag":245,"props":767,"children":768},{"style":252},[769],{"type":20,"value":321},{"type":14,"tag":245,"props":771,"children":772},{"style":324},[773],{"type":20,"value":651},{"type":14,"tag":245,"props":775,"children":776},{"style":252},[777],{"type":20,"value":612},{"type":14,"tag":245,"props":779,"children":781},{"class":247,"line":780},26,[782,786,790,794],{"type":14,"tag":245,"props":783,"children":784},{"style":262},[785],{"type":20,"value":664},{"type":14,"tag":245,"props":787,"children":788},{"style":252},[789],{"type":20,"value":321},{"type":14,"tag":245,"props":791,"children":792},{"style":324},[793],{"type":20,"value":673},{"type":14,"tag":245,"props":795,"children":796},{"style":252},[797],{"type":20,"value":612},{"type":14,"tag":245,"props":799,"children":801},{"class":247,"line":800},27,[802,806,810],{"type":14,"tag":245,"props":803,"children":804},{"style":262},[805],{"type":20,"value":686},{"type":14,"tag":245,"props":807,"children":808},{"style":252},[809],{"type":20,"value":321},{"type":14,"tag":245,"props":811,"children":812},{"style":324},[813],{"type":20,"value":695},{"type":14,"tag":245,"props":815,"children":817},{"class":247,"line":816},28,[818],{"type":14,"tag":245,"props":819,"children":820},{"style":252},[821],{"type":20,"value":822},"      }\n",{"type":14,"tag":245,"props":824,"children":826},{"class":247,"line":825},29,[827],{"type":14,"tag":245,"props":828,"children":829},{"style":252},[830],{"type":20,"value":831},"    }\n",{"type":14,"tag":245,"props":833,"children":835},{"class":247,"line":834},30,[836],{"type":14,"tag":245,"props":837,"children":838},{"style":252},[839],{"type":20,"value":840},"  }\n",{"type":14,"tag":245,"props":842,"children":844},{"class":247,"line":843},31,[845],{"type":14,"tag":245,"props":846,"children":847},{"style":252},[848],{"type":20,"value":849},"}\n",{"type":14,"tag":22,"props":851,"children":852},{},[853,855,861,863,869,871,876],{"type":20,"value":854},"As you can see above, there are two roles in this example: ",{"type":14,"tag":74,"props":856,"children":858},{"className":857},[],[859],{"type":20,"value":860},"manager",{"type":20,"value":862}," and ",{"type":14,"tag":74,"props":864,"children":866},{"className":865},[],[867],{"type":20,"value":868},"my_account",{"type":20,"value":870},". Each role has its own actions with or without required attributes. In this example, role ",{"type":14,"tag":74,"props":872,"children":874},{"className":873},[],[875],{"type":20,"value":860},{"type":20,"value":877}," has the following actions:",{"type":14,"tag":140,"props":879,"children":880},{},[881,890,909,918,934,950],{"type":14,"tag":48,"props":882,"children":883},{},[884],{"type":14,"tag":74,"props":885,"children":887},{"className":886},[],[888],{"type":20,"value":889},"create",{"type":14,"tag":48,"props":891,"children":892},{},[893,899,901,907],{"type":14,"tag":74,"props":894,"children":896},{"className":895},[],[897],{"type":20,"value":898},"destroy",{"type":20,"value":900},", requires the ",{"type":14,"tag":74,"props":902,"children":904},{"className":903},[],[905],{"type":20,"value":906},"cid",{"type":20,"value":908}," attribute",{"type":14,"tag":48,"props":910,"children":911},{},[912],{"type":14,"tag":74,"props":913,"children":915},{"className":914},[],[916],{"type":20,"value":917},"view",{"type":14,"tag":48,"props":919,"children":920},{},[921,927,928,933],{"type":14,"tag":74,"props":922,"children":924},{"className":923},[],[925],{"type":20,"value":926},"view_logs",{"type":20,"value":900},{"type":14,"tag":74,"props":929,"children":931},{"className":930},[],[932],{"type":20,"value":906},{"type":20,"value":908},{"type":14,"tag":48,"props":935,"children":936},{},[937,943,944,949],{"type":14,"tag":74,"props":938,"children":940},{"className":939},[],[941],{"type":20,"value":942},"view_accounts",{"type":20,"value":900},{"type":14,"tag":74,"props":945,"children":947},{"className":946},[],[948],{"type":20,"value":906},{"type":20,"value":908},{"type":14,"tag":48,"props":951,"children":952},{},[953,959,961,966,967,973],{"type":14,"tag":74,"props":954,"children":956},{"className":955},[],[957],{"type":20,"value":958},"view_account",{"type":20,"value":960},", requires ",{"type":14,"tag":74,"props":962,"children":964},{"className":963},[],[965],{"type":20,"value":906},{"type":20,"value":862},{"type":14,"tag":74,"props":968,"children":970},{"className":969},[],[971],{"type":20,"value":972},"pubKey",{"type":20,"value":974}," attributes",{"type":14,"tag":22,"props":976,"children":977},{},[978],{"type":14,"tag":167,"props":979,"children":980},{},[981,985,987,992],{"type":14,"tag":66,"props":982,"children":983},{},[984],{"type":20,"value":906},{"type":20,"value":986},"(i.e. ",{"type":14,"tag":66,"props":988,"children":989},{},[990],{"type":20,"value":991},"contract id",{"type":20,"value":993},"), is the frequently required attribute. We get it after our contract has been deployed. The same contract which has been deployed with different attributes, will have different values.",{"type":14,"tag":37,"props":995,"children":997},{"id":996},"commands",[998],{"type":20,"value":999},"Commands",{"type":14,"tag":22,"props":1001,"children":1002},{},[1003,1005,1011,1013,1016],{"type":20,"value":1004},"All command start with ",{"type":14,"tag":74,"props":1006,"children":1008},{"className":1007},[],[1009],{"type":20,"value":1010},"./beam-wallet-masternet shader",{"type":20,"value":1012},".",{"type":14,"tag":62,"props":1014,"children":1015},{},[],{"type":20,"value":1017},"\nThere are required flags that need to be passed to work with the contract:",{"type":14,"tag":140,"props":1019,"children":1020},{},[1021,1032,1043,1054],{"type":14,"tag":48,"props":1022,"children":1023},{},[1024,1030],{"type":14,"tag":74,"props":1025,"children":1027},{"className":1026},[],[1028],{"type":20,"value":1029},"--shader_app_file=\u003Capp.wasm>",{"type":20,"value":1031}," - for application shader",{"type":14,"tag":48,"props":1033,"children":1034},{},[1035,1041],{"type":14,"tag":74,"props":1036,"children":1038},{"className":1037},[],[1039],{"type":20,"value":1040},"--shader_contract_file=\u003Ccontract.wasm>",{"type":20,"value":1042}," - for contract shader",{"type":14,"tag":48,"props":1044,"children":1045},{},[1046,1052],{"type":14,"tag":74,"props":1047,"children":1049},{"className":1048},[],[1050],{"type":20,"value":1051},"--shader_args=\"role=\u003Crole>,action=\u003Caction>\"",{"type":20,"value":1053}," - shader arguments",{"type":14,"tag":48,"props":1055,"children":1056},{},[1057],{"type":14,"tag":74,"props":1058,"children":1060},{"className":1059},[],[1061],{"type":20,"value":1062},"-n \u003Cnode>",{"type":14,"tag":22,"props":1064,"children":1065},{},[1066,1070,1071],{"type":14,"tag":66,"props":1067,"children":1068},{},[1069],{"type":20,"value":70},{"type":20,"value":173},{"type":14,"tag":167,"props":1072,"children":1073},{},[1074],{"type":20,"value":1075},"All arguments are passed separated by commas. For example:",{"type":14,"tag":203,"props":1077,"children":1079},{"code":1078},"--shader_args=\"role=manager,action=view\"\n",[1080],{"type":14,"tag":74,"props":1081,"children":1082},{"__ignoreMap":7},[1083],{"type":20,"value":1078},{"type":14,"tag":22,"props":1085,"children":1086},{},[1087],{"type":14,"tag":167,"props":1088,"children":1089},{},[1090],{"type":20,"value":1091},"If the action has additional attributes, they also are separated by commas:",{"type":14,"tag":203,"props":1093,"children":1095},{"code":1094},"--shader_args=\"role=manager,action=view_logs,cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\"\n",[1096],{"type":14,"tag":74,"props":1097,"children":1098},{"__ignoreMap":7},[1099],{"type":20,"value":1094},{"type":14,"tag":37,"props":1101,"children":1103},{"id":1102},"deploy-contract",[1104],{"type":20,"value":1105},"Deploy contract",{"type":14,"tag":22,"props":1107,"children":1108},{},[1109,1111,1116,1118,1123,1125,1130],{"type":20,"value":1110},"To work with the contract, it needs to be deployed. In our Vault example contract, the deployment corresponds to the ",{"type":14,"tag":74,"props":1112,"children":1114},{"className":1113},[],[1115],{"type":20,"value":860},{"type":20,"value":1117}," role and ",{"type":14,"tag":74,"props":1119,"children":1121},{"className":1120},[],[1122],{"type":20,"value":889},{"type":20,"value":1124}," action. Based on our knowledge, we got the following command to ",{"type":14,"tag":66,"props":1126,"children":1127},{},[1128],{"type":20,"value":1129},"deploy contract",{"type":20,"value":1131},":",{"type":14,"tag":203,"props":1133,"children":1135},{"code":1134},"./beam-wallet-masternet shader --shader_app_file=mydapp/app.wasm --shader_args=\"role=manager,action=create\" --shader_contract_file=mydapp/contract.wasm -n \u003Cnode>\n",[1136],{"type":14,"tag":74,"props":1137,"children":1138},{"__ignoreMap":7},[1139],{"type":20,"value":1134},{"type":14,"tag":22,"props":1141,"children":1142},{},[1143],{"type":20,"value":1144},"Output example:",{"type":14,"tag":203,"props":1146,"children":1148},{"code":1147},"Creating new contract invocation tx on behalf of the shader\nContract ID: d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\n        Comment: create Vault contract  Total fee: 1100000 GROTH\nI 2022-06-06.11:43:08.288 [ac09d5dc897647bf876b7d17d8219a77][1] Get proof for kernel: 6625e9f7756a98eb\nI 2022-06-06.11:43:08.289 Synchronizing with node: 100% (1/1)\nI 2022-06-06.11:43:08.289 Current state is 8-65a2ecdf447ad942\nI 2022-06-06.11:43:18.354 Sync up to 9-7d15da24d2717100\nI 2022-06-06.11:43:18.354 Synchronizing with node: 0% (0/2)\nI 2022-06-06.11:43:18.355 CoinID: Key=mine-1:1:1, Value=8000000000 Maturity=6 Spent, Height=9\nI 2022-06-06.11:43:18.356 CoinID: Key=chng-1:0:3958598515398969808, Value=7998900000 Maturity=9 Confirmed, Height=9\nI 2022-06-06.11:43:18.356 Synchronizing with node: 50% (1/2)\nI 2022-06-06.11:43:18.356 Synchronizing with node: 100% (2/2)\nI 2022-06-06.11:43:18.356 Current state is 9-7d15da24d2717100\nI 2022-06-06.11:43:18.356 [ac09d5dc897647bf876b7d17d8219a77][1] Get proof for kernel: 6625e9f7756a98eb\nI 2022-06-06.11:43:18.357 [ac09d5dc897647bf876b7d17d8219a77] Transaction completed\n",[1149],{"type":14,"tag":74,"props":1150,"children":1151},{"__ignoreMap":7},[1152],{"type":20,"value":1147},{"type":14,"tag":37,"props":1154,"children":1156},{"id":1155},"command-examples",[1157],{"type":20,"value":1158},"Command examples",{"type":14,"tag":140,"props":1160,"children":1161},{},[1162,1188],{"type":14,"tag":48,"props":1163,"children":1164},{},[1165,1167,1175,1178,1180],{"type":20,"value":1166},"View deployed contracts:",{"type":14,"tag":203,"props":1168,"children":1170},{"code":1169},"./beam-wallet-masternet shader --shader_app_file=mydapp/app.wasm --shader_args=\"role=manager,action=view\" --shader_contract_file=mydapp/contract.wasm -n \u003Cnode>\n",[1171],{"type":14,"tag":74,"props":1172,"children":1173},{"__ignoreMap":7},[1174],{"type":20,"value":1169},{"type":14,"tag":62,"props":1176,"children":1177},{},[],{"type":20,"value":1179},"The output could be like this:",{"type":14,"tag":203,"props":1181,"children":1183},{"code":1182},"Shader output: {\"contracts\": [{\"cid\": \"d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\",\"Height\": 9}]}\n",[1184],{"type":14,"tag":74,"props":1185,"children":1186},{"__ignoreMap":7},[1187],{"type":20,"value":1182},{"type":14,"tag":48,"props":1189,"children":1190},{},[1191,1193,1198,1200,1208,1211,1212],{"type":20,"value":1192},"Destroy contract (with ",{"type":14,"tag":74,"props":1194,"children":1196},{"className":1195},[],[1197],{"type":20,"value":906},{"type":20,"value":1199}," from the example above)",{"type":14,"tag":203,"props":1201,"children":1203},{"code":1202},"./beam-wallet-masternet shader --shader_app_file=mydapp/app.wasm --shader_contract_file=mydapp/contract.wasm --shader_args=\"role=manager,action=destroy,cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\" -n localhost:10000\n",[1204],{"type":14,"tag":74,"props":1205,"children":1206},{"__ignoreMap":7},[1207],{"type":20,"value":1202},{"type":14,"tag":62,"props":1209,"children":1210},{},[],{"type":20,"value":1144},{"type":14,"tag":203,"props":1213,"children":1215},{"code":1214},"Creating new contract invocation tx on behalf of the shader\nContract ID: d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\n      Comment: destroy Vault contract   Total fee: 1100000 GROTH\nI 2022-06-06.12:34:15.962 Sync up to 311-788f821396683a25\nI 2022-06-06.12:34:15.962 Synchronizing with node: 0% (0/2)\nI 2022-06-06.12:34:15.967 Synchronizing with node: 0% (0/2)\nI 2022-06-06.12:34:15.967 CoinID: Key=mine-1:1:307, Value=8000000000 Maturity=312 Confirmed, Height=307\nI 2022-06-06.12:34:15.968 CoinID: Key=mine-1:1:308, Value=8000000000 Maturity=313 Confirmed, Height=308\nI 2022-06-06.12:34:15.968 CoinID: Key=mine-1:1:309, Value=8000000000 Maturity=314 Confirmed, Height=309\nI 2022-06-06.12:34:15.968 CoinID: Key=mine-1:1:310, Value=8000000000 Maturity=315 Confirmed, Height=310\nI 2022-06-06.12:34:15.969 CoinID: Key=mine-1:1:311, Value=8000000000 Maturity=316 Confirmed, Height=311\nI 2022-06-06.12:34:15.969 Synchronizing with node: 50% (1/2)\nI 2022-06-06.12:34:15.969 Synchronizing with node: 100% (2/2)\nI 2022-06-06.12:34:15.969 Current state is 311-788f821396683a25\nI 2022-06-06.12:34:15.969 [7b8eb0b0bd2340529996c7598d3ebaff][1] Get proof for kernel: eb45c335bca2e17c\nI 2022-06-06.12:34:15.970 Synchronizing with node: 100% (1/1)\nI 2022-06-06.12:34:15.970 Current state is 311-788f821396683a25\nI 2022-06-06.12:34:26.111 Rolled back to 306-910bc6ca48d05757\nI 2022-06-06.12:34:26.112 Sync up to 312-d156e1bf16939393\nI 2022-06-06.12:34:26.113 Synchronizing with node: 0% (0/2)\nI 2022-06-06.12:34:26.113 CoinID: Key=mine-1:1:307, Value=8000000000 Maturity=312 Confirmed, Height=307\nI 2022-06-06.12:34:26.113 CoinID: Key=mine-1:1:308, Value=8000000000 Maturity=313 Confirmed, Height=308\nI 2022-06-06.12:34:26.114 CoinID: Key=chng-1:0:3958598515398969808, Value=7998900000 Maturity=9 Spent, Height=312\nI 2022-06-06.12:34:26.114 CoinID: Key=chng-1:0:12345322638362229725, Value=7997800000 Maturity=312 Confirmed, Height=312\nI 2022-06-06.12:34:26.115 Synchronizing with node: 50% (1/2)\nI 2022-06-06.12:34:26.115 Synchronizing with node: 100% (2/2)\nI 2022-06-06.12:34:26.115 Current state is 312-d156e1bf16939393\nI 2022-06-06.12:34:26.115 [7b8eb0b0bd2340529996c7598d3ebaff][1] Get proof for kernel: eb45c335bca2e17c\nI 2022-06-06.12:34:26.116 [7b8eb0b0bd2340529996c7598d3ebaff] Transaction completed\n",[1216],{"type":14,"tag":74,"props":1217,"children":1218},{"__ignoreMap":7},[1219],{"type":20,"value":1214},{"type":14,"tag":1221,"props":1222,"children":1223},"style",{},[1224],{"type":20,"value":1225},"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":258,"depth":258,"links":1227},[1228,1229,1230,1231,1232,1233],{"id":39,"depth":273,"text":42},{"id":130,"depth":273,"text":133},{"id":193,"depth":273,"text":196},{"id":996,"depth":273,"text":999},{"id":1102,"depth":273,"text":1105},{"id":1155,"depth":273,"text":1158},"markdown","docs:docs:dev:using-beam-shaders-with-cli-wallet.md","docs","docs/dev/using-beam-shaders-with-cli-wallet.md","md",1777630729251]