Asterizm protocol affords receive and send cross chain transfer of any messages
See DOCS.md or visit Asterizm Docs
Current programs are written with the usage of Solana
version 1.18.20 and Anchor
version 0.30.1.
Solana
can be installed by this link.
Anchor
installation docs can be taken from here.
anchor build
anchor test
anchor deploy
or
solana program deploy ./target/deploy/<..>.so
anchor upgrade <target/deploy/program.so> --program-id <program-id>
or
# New version of the program can be uploaded by any developer
solana program write-buffer --ws wss://api.mainnet-beta.solana.com ./target/deploy/<..>.so
# Than new buffer authority can be changed to the owner of the program
solana program set-buffer-authority <PROGRAM_ADDRESS> --new-buffer-authority <New Buffer Authority>
# Only program owner can change old program with new buffer
solana program deploy --program-id <PROGRAM_ADDRESS> --buffer <BUFFER_ADDRESS>
# Developers can check if they own any abandoned buffer accounts
solana program show --buffers
# After upgrade all buffers can be closed to reclaim the SOL balance
solana program close --buffers
For more info you can look up here.
One can create new address for program to deploy separate configuration:
solana-keygen grind --starts-with Asterizm:3
Replace old one in Anchor.toml
and declare_id!(..)
macros with the new one, and deploy the new one.
One can deploy programs to any Solana
network.
To get current config one must run following:
solana config get
How to change network is described here.
In order to work with correct cpi one must update compiled idl
s with the new ones, copying them from target
dir to idls
dir.
Current repo contains 3 system programs: relayer, initializer and client, and 2 example programs, that are showing the usage of Asterizm protocol.
Relayer program can send and receive messages, create custom relayers, take fees.
- Init
- Update Settings
- Create custom relayer
- Update custom relayer
- Create chain
- Create Transfer event
- Create Received message
- Notify
Initializer program can create and send messages through relayer program and transfer received messages to clients program
- Init
- Update Settings
- Send message
- Block account
- Resend message
- Receive message
- Notify
Client program can create transfers and receive messages with custom payload
- Init
- Update Settings
- Create client settings
- Update client settings
- Client receive callback
- Client create transfer
- Transfer message external
- Client receive message
- Receive message external
Example of multi token program, that can burn and mint SPL tokens and transfer events using Asterizm protocol
- Init
- Mint
- Burn
Example of NFT program, that can burn and mint NFT and transfer events using Asterizm protocol
- Init
- Mint
- Transfer
Scripts folder contains useful scripts to configure Solana
programs. To run use:
npx ts-node scripts/<..>.ts
- Fixed "account data too small for instruction"
solana program extend <progrem_id> <more_bytes>