Skip to content

LayerZero-Labs/execution-beacon

Repository files navigation

Execution Beacon Solana

Setup

Docker

Docker is required to build using anchor. We highly recommend that you use the most up-to-date Docker version to avoid any issues with anchor builds.

Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Install Solana 2.3.0
sh -c "$(curl -sSfL https://release.anza.xyz/v2.3.0/install)"
Install Anchor 0.32.1
cargo install --git https://github.com/solana-foundation/anchor --tag v0.32.1 anchor-cli --locked

Build

Prepare the Solana Program keypair

Create the program ID keypair by running:

anchor keys sync -p execution_beacon

View the program ID's based on the generated keypairs:

anchor keys list

You will see an output such as:

execution_beacon: FfUKyGjrUREsjBhsykyAHUMy12qVHbSsuCiqSSAaJpwp

Copy the program ID value for use in the build step later.

Building the Solana Program

Ensure you have Docker running before running the build command.

anchor build -v

ℹ️ For a breakdown of expected rent-exempt costs before deployment, see https://docs.layerzero.network/v2/developers/solana/technical-reference/solana-guidance#previewing-solana-rent-costs.

Deploy

(Recommended) Deploying with a priority fee

The deploy command will run with a priority fee. Read the section on 'Deploying Solana programs with a priority fee' to learn more.

Run the deploy command

solana program deploy --program-id target/deploy/execution_beacon-keypair.json target/verifiable/execution_beacon.so -u devnet --with-compute-unit-price <COMPUTE_UNIT_PRICE_IN_MICRO_LAMPORTS>
Details

ℹ️ the -u flag specifies the RPC URL that should be used. The options are mainnet-beta, devnet, testnet, localhost, which also have their respective shorthands: -um, -ud, -ut, -ul

⚠️ If the deployment is slow, it could be that the network is congested and you might need to increase the priority fee.

Tests

Ensure you have platform tools installed:

cargo build-sbf --force-tools-install

Run tests

anchor test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published