Prerequisites for EVM to Aptos Tutorials

Before starting the EVM to Aptos tutorials, ensure you have:

Development Environment

  • Aptos CLI: Install the Aptos CLI by following the official installation guide.

  • Node.js v20 or higher: You can use the nvm package to install and switch between Node.js versions. Once installed, verify the node version with:

    node -v
    

    Example output:

    $ node -v
    v22.15.0
    
  • Npm: For installing and managing dependencies.

  • Git: For cloning the repository.

Starter Kit Repository

  1. Clone the CCIP Aptos Starter Kit:

    git clone https://github.com/smartcontractkit/aptos-starter-kit.git
    
  2. Navigate to the directory:

    cd aptos-starter-kit
    
  3. Install dependencies:

    npm install
    

Wallets

  • EVM Wallet and Private Key: To send transactions from an EVM chain (like Ethereum Sepolia), you need a wallet and its private key.

    • Set up a wallet like MetaMask.
    • You will need to export the private key for the account you intend to send from. Follow the official MetaMask guide to obtain your private key and add it to the .env file as shown below.
  • Aptos Account: You'll need an Aptos account. If you don't have one, create it with:

    aptos init --network testnet
    

    This command will guide you through creating a new account for Testnet and will save the credentials in a .aptos/config.yaml file. This also configures your Aptos CLI to use Testnet.

    Verify your current configuration with:

    aptos config show-profiles
    

    This should show your default profile configured for Testnet, with the network set to Testnet.

    Example output:

    $ aptos config show-profiles
    
    {
      "Result": {
        "default": {
          "network": "Testnet",
          "has_private_key": true,
          "public_key": "ed25519-pub-0x2ecdd2d7bc0cbfe2e44c219ef9a9fddc986b384f4a01fb5d821cf0dab5d2fbae",
          "account": "d0e227835c33932721d54ae401cfaae753c295024fe454aa029b5e2782d2fad4",
          "rest_url": "https://fullnode.testnet.aptoslabs.com"
        }
      }
    }
    

    Note down the account value from the output and prepend 0x to it. You will need to use this value as one of the environment variables in your .env file, as shown below.

Environment Configuration (.env file)

The starter kit uses a .env file to manage sensitive information like private keys and RPC URLs. Create a new file named .env in the root of the aptos-starter-kit directory by copying the example file:

cp .env.example .env

Next, open the .env file and fill in the following values:

  • PRIVATE_KEY: The private key of your source wallet (EOA) on Ethereum Sepolia from which you're sending CCIP-BnM tokens. You can export your private key from your MetaMask Wallet, as shown in the Wallets section above.
  • ETHEREUM_SEPOLIA_RPC_URL: The RPC endpoint for the Ethereum Sepolia testnet. This is required to interact with the Ethereum Sepolia network. You can obtain an RPC URL by signing up for a personal endpoint from Alchemy, Infura, or another node provider service.

Example .env file:

PRIVATE_KEY=<YOUR_EVM_PRIVATE_KEY>
ETHEREUM_SEPOLIA_RPC_URL=<RPC_URL_FOR_ETHEREUM_SEPOLIA>

Native Tokens for Transaction Fees

ETH tokens are used for Ethereum Sepolia transaction fees. For these tutorials, we will also use ETH to pay for CCIP fees.

Obtaining Testnet Tokens

When using LINK tokens to pay for CCIP fees, you will need LINK tokens on Ethereum Sepolia. You can use the Chainlink Faucet to get test LINK tokens.

BnM Tokens on EVM Chains

To obtain CCIP-BnM tokens on Ethereum Sepolia, you can use the Mint tokens in the documentation section to get test BnM tokens.

Get the latest Chainlink content straight to your inbox.