From ba5d2478a96f8a78c81dfeea3eee2463538a79b9 Mon Sep 17 00:00:00 2001 From: Jon C Date: Wed, 20 Nov 2024 14:57:29 +0100 Subject: [PATCH] README: Update with memo-specific info #### Problem The memo program now lives here, but the documentation is mostly still the generated content. #### Summary of changes Update the README with: * more specific program info * program and docs badges * doc link * audit link --- README.md | 62 ++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 48c5a4db..d3c9dffc 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,28 @@ -# Memo +# SPL Memo Program + +[![Docs.rs](https://docs.rs/spl-memo/badge.svg?logo=rust)] + - -This template should help get you started developing Solana programs. Let's walk through this generated program repository and see what's included. +A simple program that validates a string of UTF-8 encoded characters and logs it +in the transaction log. The program also verifies that any accounts provided are +signers of the transaction, and if so, logs their addresses. It can be used to +record a string on-chain, stored in the instruction data of a successful +transaction, and optionally verify the originator. + +This code was moved from the +[solana-program-library](https://github.com/solana-labs/solana-program-library/tree/master/memo) +and is now maintained in this repo. + +Full documentation is available at https://spl.solana.com/memo + +## Audit + +The [security-audits repo](https://github.com/solana-labs/security-audits) contains +all past and present program audits. ## Project setup @@ -15,13 +32,12 @@ The first thing you'll want to do is install NPM dependencies which will allow y pnpm install ``` -## Managing programs +## Program -You'll notice a `program` folder in the root of this repository. This is where your generated Solana program is located. +The `program` folder in the root of this repository contains the program +implementation. -Whilst only one program gets generated, note that you can have as many programs as you like in this repository. -Whenever you add a new program folder to this repository, remember to add it to the `members` array of your root `Cargo.toml` file. -That way, your programs will be recognized by the following scripts that allow you to build, test, format and lint your programs respectively. +The following scripts build, test, format and lint the program respectively. ```sh pnpm programs:build @@ -32,24 +48,24 @@ pnpm programs:lint ## Generating IDLs -You may use the following command to generate the IDLs for your programs. +You may use the following command to generate the IDLs. ```sh pnpm generate:idls ``` -Depending on your program's framework, this will either use Shank or Anchor to generate the IDLs. -Note that, to ensure IDLs are generated using the correct framework version, the specific version used by the program will be downloaded and used locally. +Note that, to ensure IDLs are generated using the correct framework version, the +specific version used by the program will be downloaded and used locally. ## Generating clients -Once your programs' IDLs have been generated, you can generate clients for them using the following command. +Once the program's IDL has been generated, you can generate clients for them using the following command. ```sh pnpm generate:clients ``` -Alternatively, you can use the `generate` script to generate both the IDLs and the clients at once. +Alternatively, you can use the `generate` script to generate both the IDL and the clients at once. ```sh pnpm generate @@ -81,23 +97,3 @@ Finally, you may stop the local validator using the following command. ```sh pnpm validator:stop ``` - -## Using external programs in your validator - -If your program requires any external programs to be running, you'll want to in your local validator. - -You can do this by adding their program addresses to the `program-dependencies` array in the `Cargo.toml` of your program. - -```toml -program-dependencies = [ - "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", - "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV", -] -``` - -Next time you build your program and run your validator, these external programs will automatically be fetched from mainnet and used in your local validator. - -```sh -pnpm programs:build -pnpm validator:restart -```