anchor/assets/js/10.99d917b5.js

1 line
14 KiB
JavaScript
Raw Normal View History

2022-04-13 16:17:24 -07:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{403:function(t,a,e){"use strict";e.r(a);var s=e(29),r=Object(s.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"commands"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#commands"}},[t._v("#")]),t._v(" Commands")]),t._v(" "),e("p",[t._v("A CLI is provided to support building and managing an Anchor workspace.\nFor a comprehensive list of commands and options, run "),e("code",[t._v("anchor -h")]),t._v(" on any\nof the following subcommands.")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("anchor-cli\n\nUSAGE:\n anchor <SUBCOMMAND>\n\nFLAGS:\n -h, --help Prints help information\n -V, --version Prints version information\n\nSUBCOMMANDS:\n build Builds the workspace\n cluster Cluster commands\n deploy Deploys each program in the workspace\n expand Expands the macros of a program or the workspace\n help Prints this message or the help of the given subcommand(s)\n idl Commands for interacting with interface definitions\n init Initializes a workspace\n migrate Runs the deploy migration script\n new Creates a new program\n test Runs integration tests against a localnetwork\n upgrade Upgrades a single program. The configured wallet must be the upgrade authority\n verify Verifies the on-chain bytecode matches the locally compiled artifact. Run this\n command inside a program subdirectory, i.e., in the dir containing the program's\n Cargo.toml\n")])])]),e("h2",{attrs:{id:"build"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#build"}},[t._v("#")]),t._v(" Build")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("anchor build\n")])])]),e("p",[t._v("Builds programs in the workspace targeting Solana's BPF runtime and emitting IDLs in the "),e("code",[t._v("target/idl")]),t._v(" directory.")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("anchor build --verifiable\n")])])]),e("p",[t._v("Runs the build inside a docker image so that the output binary is deterministic (assuming a Cargo.lock file is used). This command must be run from within a single crate subdirectory within the workspace. For example, "),e("code",[t._v("programs/<my-program>/")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"cluster"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cluster"}},[t._v("#")]),t._v(" Cluster")]),t._v(" "),e("h3",{attrs:{id:"cluster-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cluster-list"}},[t._v("#")]),t._v(" Cluster list")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("anchor cluster list\n")])])]),e("p",[t._v("This lists cluster endpoints:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("Cluster Endpoints:\n\n* Mainnet - https://solana-api.projectserum.com\n* Mainnet - https://api.mainnet-beta.solana.com\n* Devnet - https://api.devnet.solana.com\n* Testnet - https://api.testnet.solana.com\n")])])]),e("h2",{attrs:{id:"deploy"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#deploy"}},[t._v("#")]),t._v(" Deploy")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("anchor deploy\n")])])]),e("p",[t._v("Deploys all programs in the workspace to the configured cluster.")]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("Note")]),t._v(" "),e("p",[t._v("This is different from the "),e("code",[t._v("solana program deploy")]),t._v(" command, because everytime it's run\nit will generate a "),e("em",[t._v("new")]),t._v(" program address."