The project comprises of:
- An on-chain multi-sig wallet program
- A client library that helps construct requests to the multi-sig wallet program
The multi-sig wallet program provides the following instructions:
- Initialize wallet and add initial key
- Add new owner public key with corresponding weight (requires authorization)
- Remove owner (requires authorization)
- Invoke any instruction to another program (requires authorization)
Each owner public key has its own weight (0~1000). Any authorized instruction requires the total signature weight to be at least 1000.
If you decide to open in Gitpod then refer to README-gitpod.md, otherwise continue reading.
The following dependencies are required to build and run this example, depending on your OS, they may already be installed:
- Install node
- Install npm
- Install docker
- Install the latest Rust stable from https://rustup.rs/
- Install Solana v1.4.7 or later from https://docs.solana.com/cli/install-solana-cli-tools
If this is your first time using Docker or Rust, these Installation Notes might be helpful.
This example connects to a local Solana cluster by default.
Enable on-chain program logs:
$ export RUST_LOG=solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=debug,solana_bpf_loader=debug,solana_rbpf=debug
Start a local Solana cluster:
$ npm run localnet:update
$ npm run localnet:up
View the cluster logs:
$ npm run localnet:logs
Note: To stop the local Solana cluster later:
$ npm run localnet:down
$ npm run build:program
$ npm run start
Solana maintains three public clusters:
devnet
- Development cluster with airdrops enabledtestnet
- Tour De Sol test cluster without airdrops enabledmainnet-beta
- Main cluster
Use npm scripts to configure which cluster.
To point to devnet
:
$ npm run cluster:devnet
To point back to the local cluster:
$ npm run cluster:localnet
For more information about programming on Solana, visit Solana Docs