anchor/assets/js/14.258e35e3.js

1 line
8.5 KiB
JavaScript
Raw Normal View History

2022-04-13 16:17:24 -07:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{408:function(t,e,a){"use strict";a.r(e);var r=a(29),s=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"publishing-source"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#publishing-source"}},[t._v("#")]),t._v(" Publishing Source")]),t._v(" "),a("p",[t._v("The Anchor Program Registry at "),a("a",{attrs:{href:"https://anchor.projectserum.com",target:"_blank",rel:"noopener noreferrer"}},[t._v("anchor.projectserum.com"),a("OutboundLink")],1),t._v("\nhosts a catalog of verified programs on Solana both written with and without Anchor. It is recommended\nthat authors of smart contracts publish their source to promote best\npractices for security and transparency.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("note")]),t._v(" "),a("p",[t._v("The Anchor Program Registry is currently in alpha testing. For access to publishing\nplease ask on "),a("a",{attrs:{href:"https://discord.gg/rg5ZZPmmTm",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("h2",{attrs:{id:"getting-started"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),a("p",[t._v("The process for publishing is mostly identical to "),a("code",[t._v("crates.io")]),t._v(".")]),t._v(" "),a("ul",[a("li",[t._v("Signup for an account "),a("a",{attrs:{href:"https://anchor.projectserum.com/signup",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("li",[t._v("Confirm your email by clicking the link sent to your address.")]),t._v(" "),a("li",[t._v("Navigate to your Username -> Account Settings on the top navbar.")]),t._v(" "),a("li",[t._v('Click "New Token" in the '),a("strong",[t._v("API Access")]),t._v(" section.")]),t._v(" "),a("li",[t._v("Run "),a("code",[t._v("anchor login <token>")]),t._v(" at the command line.")])]),t._v(" "),a("p",[t._v("And you're ready to interact with the registry.")]),t._v(" "),a("h2",{attrs:{id:"configuring-a-build"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#configuring-a-build"}},[t._v("#")]),t._v(" Configuring a Build")]),t._v(" "),a("p",[t._v("Whether your program is written in Anchor or not, all source being published must\nhave an "),a("code",[t._v("Anchor.toml")]),t._v(" to define the build.")]),t._v(" "),a("p",[t._v("An example "),a("code",[t._v("Anchor.toml")]),t._v(" config looks as follows,")]),t._v(" "),a("div",{staticClass:"language-toml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-toml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token key property"}},[t._v("anchor_version")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.24.2"')]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("workspace")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token key property"}},[t._v("members")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"programs/multisig"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("provider")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token key property"}},[t._v("cluster")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mainnet"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token key p