Skip to content

solana-program/memo

Repository files navigation

SPL Memo Program

[Docs.rs]

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 and is now maintained in this repo.

Full documentation is available at https://spl.solana.com/memo

Audit

The security-audits repo contains all past and present program audits.

Project setup

The first thing you'll want to do is install NPM dependencies which will allow you to access all the scripts and tools provided by this template.

pnpm install

Program

The program folder in the root of this repository contains the program implementation.

The following scripts build, test, format and lint the program respectively.

pnpm programs:build
pnpm programs:test
pnpm programs:format
pnpm programs:lint

Generating IDLs

You may use the following command to generate the IDLs.

pnpm generate: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.

Generating clients

Once the program's IDL has been generated, you can generate clients for them using the following command.

pnpm generate:clients

Alternatively, you can use the generate script to generate both the IDL and the clients at once.

pnpm generate

Managing clients

The following clients are available for your programs. You may use the following links to learn more about each client.

Starting and stopping the local validator

The following script is available to start your local validator.

pnpm validator:start

By default, if a local validator is already running, the script will be skipped. You may use the validator:restart script instead to force the validator to restart.

pnpm validator:restart

Finally, you may stop the local validator using the following command.

pnpm validator:stop