From f4020383aac650cbf5213160629c0963f9ad7459 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Mon, 5 May 2025 15:35:20 +0200 Subject: [PATCH 1/8] XC-355: Improve instructions for basic_solana --- examples/basic_solana/README.md | 82 +++++++++++++++++---------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/examples/basic_solana/README.md b/examples/basic_solana/README.md index 809ca3b2..7064cd77 100644 --- a/examples/basic_solana/README.md +++ b/examples/basic_solana/README.md @@ -1,5 +1,5 @@ --- -keywords: [ advanced, rust, solana, sol, integration, solana integration ] +keywords: [ advanced, chain fusion, integration, rust, sol, solana, solana integration, spl ] --- # Basic Solana @@ -7,8 +7,8 @@ keywords: [ advanced, rust, solana, sol, integration, solana integration ] ## Overview This tutorial will walk you through how to deploy a simple smart contract on the Internet Computer -(known as [canisters](https://internetcomputer.org/docs/building-apps/essentials/canisters)) **that can control digital assets** -on the Solana blockchain: +(known as [canisters](https://internetcomputer.org/docs/building-apps/essentials/canisters)) **that can control digital +assets** on the Solana blockchain: 1. SOL, the native currency on Solana; 2. any other token (known as [SPL tokens](https://solana.com/docs/tokens)). @@ -19,7 +19,8 @@ the [threshold EdDSA](https://internetcomputer.org/docs/current/developer-docs/s and [HTTPs outcalls](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/advanced-features/https-outcalls/https-outcalls-overview) features of the Internet Computer. -For a deeper understanding of the ICP < > SOL integration, see the [chain fusion overview](https://internetcomputer.org/docs/building-apps/chain-fusion/overview). +For a deeper understanding of the ICP <> SOL integration, see +the [chain fusion overview](https://internetcomputer.org/docs/building-apps/chain-fusion/solana/overview#sol-rpc-canister). ## Prerequisites @@ -37,8 +38,8 @@ cd examples/basic_solana git submodule update --init --recursive ``` -**If you are using MacOS, you'll need to install Homebrew and run `brew install llvm` to be able to compile the example. -** +**If you are using macOS, you'll need to install Homebrew and run `brew install llvm` to be able to +compile the example.** ### Acquire cycles to deploy @@ -49,25 +50,29 @@ equivalent of "gas" on other blockchains). ### Deploy the smart contract to the Internet Computer ```bash -dfx deploy --ic basic_solana --argument (opt record { solana_network = opt variant {Devnet}; ed25519_key_name = opt variant {TestKey1}; sol_rpc_canister_id = null }) +dfx deploy --ic basic_solana --argument ( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { TestKey1 }; sol_rpc_canister_id = null } ) ``` #### What this does -- `dfx deploy` tells the command line interface to `deploy` the smart contract -- `--ic` tells the command line to deploy the smart contract to the mainnet ICP blockchain -- `--argument (opt record { solana_network = opt variant {Devnet}; ed25519_key_name = opt variant {TestKey1}; sol_rpc_canister_id = null })` - initializes the smart contract with the provided arguments: - - `solana_network = opt variant {Devnet}`: the canister uses - the [Solana Devnet](https://solana.com/docs/core/clusters) - network. - - `ed25519_key_name = opt variant {TestKey1}`: the canister uses a test key for signing via threshold EdDSA that is - available on the ICP mainnet. - See [signing messages](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/encryption/signing-messages#signing-messages-1) - for more details. - - `sol_rpc_canister_id = null`: the canister makes RPC requests to the Solana network via the standard SOL-RPC canister on the ICP ( - canister ID: `tghme-zyaaa-aaaar-qarca-cai`). This can be replaced by the canister ID of another SOL-RPC canister, e.g. a - locally deployed one. +- `dfx deploy` tells the command line interface (CLI) to `deploy` the smart contract. +- `--ic` tells the CLI to deploy the smart contract to the mainnet ICP blockchain. You may also omit this flag + to deploy the basic example locally instead (in this case you will also have to change the `sol_rpc_canister_id` to + that of a locally deployed canister). **Warning:** local testing hides some of the complexities involved with + deployment on the IC. Most notably, only a single instance of the canister is used meaning that consensus issues due + to Solana's fast block time may be hidden, and RPC providers that are only IPv4 compatible may be used which is not + the case on the IC where IPv6 compatibility is required. +- `--argument (record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { TestKey1 }; sol_rpc_canister_id = null })` +initializes the smart contract with the provided arguments: + - `solana_network = opt variant { Devnet }`: the canister interacts with the [Solana Devnet](https://solana.com/docs/core/clusters) + network. + - `ed25519_key_name = opt variant { MainnetTestKey1 }`: the canister uses a test key for signing via threshold EdDSA that is available on the ICP mainnet. + See [signing messages](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/encryption/signing-messages#signing-messages-1) + for more details. + - `sol_rpc_canister_id = null`: the canister makes RPC requests to the Solana network via the standard SOL RPC + - canister on the ICP mainnet ([`tghme-zyaaa-aaaar-qarca-cai`](https://dashboard.internetcomputer.org/canister/tghme-zyaaa-aaaar-qarca-cai)). + This can be replaced by the canister ID of another SOL RPC canister, e.g. a locally deployed one if running this + tutorial locally. If successful, you should see an output that looks like this: @@ -84,16 +89,16 @@ Candid: Your canister is live and ready to use! You can interact with it using either the command line or using the Candid UI, which is the link you see in the output above. -In the output above, to see the Candid Web UI for your Solana canister, you would use the -URL `https://bd3sg-teaaa-aaaaa-qaaba-cai.raw.icp0.io/?id=`. You should see the methods specified in -the Candid file `basic_solana.did`. +In the output above, to see the Candid Web UI for your Solana canister, you would use the URL +`https://bd3sg-teaaa-aaaaa-qaaba-cai.raw.icp0.io/?id=`. You should see the methods specified in the +Candid file `basic_solana.did`. ## Step 2: Generating a Solana account -A Solana account can be derived from an EdDSA public key. To derive a user's specific account, identified on the IC -by a principal, the canister uses its own threshold EdDSA public key to derive a new public key deterministically for -each requested principal. To retrieve your Solana account, you can call the `solana_account` method on the -previously deployed canister: +A Solana account can be derived from an EdDSA public key. To derive a user's specific account, identified on the IC by a +principal, the canister uses its own threshold EdDSA public key to derive a new public key deterministically for each +requested principal. To retrieve your Solana account, you can call the `solana_account` method on the previously +deployed canister: ```shell dfx canister --ic call basic_solana solana_account @@ -110,8 +115,8 @@ given their IC principal: dfx canister --ic call basic_solana solana_account '(opt principal "hkroy-sm7vs-yyjs7-ekppe-qqnwx-hm4zf-n7ybs-titsi-k6e3k-ucuiu-uqe")' ``` -This will return a different Solana address as the one above, such -as `("8HNiduWaBanrBv8c2pgGXZWnpKBdEYuQNHnspqto4yyq")`. +This will return a different Solana address as the one above, such as +`("8HNiduWaBanrBv8c2pgGXZWnpKBdEYuQNHnspqto4yyq")`. ## Step 3: Receiving SOL @@ -120,9 +125,8 @@ Now that you have your Solana account, let us send some (Devnet) SOL to it: 1. Get some Devnet SOL if you don't have any. You can for example use [this faucet](https://faucet.solana.com/). 2. Send some Devnet SOL to the address you obtained in the previous step. You can use any Solana wallet to do so. -Once the transaction is confirmed, you'll be able to see it in your Solana account's balance, which should be visible -in a Solana explorer, -e.g. https://explorer.solana.com/address/2kqg1tEj59FNe3hSiLH88SySB9D7fUSArum6TP6iHFQY?cluster=devnet. +Once the transaction is confirmed, you'll be able to see it in your Solana account's balance, which should be visible in +a Solana explorer, e.g. https://explorer.solana.com/address/2kqg1tEj59FNe3hSiLH88SySB9D7fUSArum6TP6iHFQY?cluster=devnet. ## Step 4: Sending SOL @@ -137,15 +141,15 @@ dfx canister --ic call basic_solana send_sol '(null, "8HNiduWaBanrBv8c2pgGXZWnpK The `send_sol` endpoint sends SOL by executing the following steps: 1. Retrieving a [recent blockhash](https://solana.com/docs/core/transactions#recent-blockhash). This is necessary - because all Solana transactions must include a blockhash within the - 151 most recent stored hashes (which corresponds to about 60 to 90 seconds). + because all Solana transactions must include a blockhash within the 151 most recent stored hashes (which corresponds + to about 60 to 90 seconds). 2. Building a Solana [transaction](https://solana.com/docs/core/transactions) that includes a single instruction to transfer the specified amount from the sender's address to the given receiver's address, as well as the recent blockhash. 3. Signing the Solana transaction using the [threshold Ed25519 API](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/signatures/signing-messages-t-schnorr). 4. Sending the signed transaction to the Solana network using the `sendTransaction` method in - the [SOL-RPC canister](https://github.com/dfinity/sol-rpc-canister). + the [SOL RPC canister](https://github.com/dfinity/sol-rpc-canister). The `send_sol` endpoint returns the transaction ID of the transaction sent to the Solana network, which can for example be used to track the transaction on a Solana blockchain explorer. @@ -191,7 +195,7 @@ in the transaction are different and the durable nonce is included in the transa 3. Signing the Solana transaction using the [threshold Ed25519 API](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/signatures/signing-messages-t-schnorr). 4. Sending the signed transaction to the Solana network using the `sendTransaction` method in - the [SOL-RPC canister](https://github.com/dfinity/sol-rpc-canister). + the [SOL RPC canister](https://github.com/dfinity/sol-rpc-canister). The `send_sol_with_durable_nonce` endpoint returns the transaction ID of the transaction sent to the Solana network. You can also verify (either in a Solana explorer or using the `get_nonce` endpoint) that the nonce value stored in the @@ -245,8 +249,8 @@ dfx canister call basic_solana send_spl_token '(null, "", "< The `send_spl_token` endpoint works similarly to the `send_sol` endpoint, but creates a transaction with the sender and recipient ATAs instead of their account addresses. You can also inspect the resulting transaction on a Solana explorer, -and verify that the associated token balances were updated accordingly. You can also check the updated token balances -by running the following commands: +and verify that the associated token balances were updated accordingly. You can also check the updated token balances by +running the following commands: ```bash dfx canister call basic_solana get_spl_token_balance '(opt principal "", "")' From 411c8d6b9a540143335962066b5c3bef87b5b84d Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Mon, 16 Jun 2025 16:04:47 +0200 Subject: [PATCH 2/8] XC-335: Add support for both local and mainnet basic_solana --- examples/basic_solana/README.md | 61 +++++++++++-------- examples/basic_solana/local/canister_ids.json | 5 ++ examples/basic_solana/local/dfx.json | 36 +++++++++++ examples/basic_solana/local/provision.sh | 20 ++++++ .../basic_solana/mainnet/canister_ids.json | 5 ++ examples/basic_solana/{ => mainnet}/dfx.json | 11 +--- 6 files changed, 106 insertions(+), 32 deletions(-) create mode 100644 examples/basic_solana/local/canister_ids.json create mode 100644 examples/basic_solana/local/dfx.json create mode 100755 examples/basic_solana/local/provision.sh create mode 100644 examples/basic_solana/mainnet/canister_ids.json rename examples/basic_solana/{ => mainnet}/dfx.json (58%) diff --git a/examples/basic_solana/README.md b/examples/basic_solana/README.md index 7064cd77..66618560 100644 --- a/examples/basic_solana/README.md +++ b/examples/basic_solana/README.md @@ -49,32 +49,45 @@ equivalent of "gas" on other blockchains). ### Deploy the smart contract to the Internet Computer +#### Mainnet deployment + +To deploy the Solana wallet smart contract to the ICP Mainnet, navigate to `examples/basic_solana/mainnet` and execute +the following command: + +```bash +dfx deploy +``` + +This deploys a wallet canister to the ICP Mainnet which is configured to interact with the Solana Devnet via the SOL RPC +canister at [`tghme-zyaaa-aaaar-qarca-cai`](https://dashboard.internetcomputer.org/canister/tghme-zyaaa-aaaar-qarca-cai). +Note that you will need to pay for your requests with cycles. If you do not have cycles available for testing, consider +running this example locally as described in the next section. + +#### Local deployment + +To deploy the Solana wallet smart contract locally, navigate to `examples/basic_solana/mainnet` and execute the +following commands: + ```bash -dfx deploy --ic basic_solana --argument ( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { TestKey1 }; sol_rpc_canister_id = null } ) +dfx start --clean --background +dfx deploy +./provision.sh ``` -#### What this does - -- `dfx deploy` tells the command line interface (CLI) to `deploy` the smart contract. -- `--ic` tells the CLI to deploy the smart contract to the mainnet ICP blockchain. You may also omit this flag - to deploy the basic example locally instead (in this case you will also have to change the `sol_rpc_canister_id` to - that of a locally deployed canister). **Warning:** local testing hides some of the complexities involved with - deployment on the IC. Most notably, only a single instance of the canister is used meaning that consensus issues due - to Solana's fast block time may be hidden, and RPC providers that are only IPv4 compatible may be used which is not - the case on the IC where IPv6 compatibility is required. -- `--argument (record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { TestKey1 }; sol_rpc_canister_id = null })` -initializes the smart contract with the provided arguments: - - `solana_network = opt variant { Devnet }`: the canister interacts with the [Solana Devnet](https://solana.com/docs/core/clusters) - network. - - `ed25519_key_name = opt variant { MainnetTestKey1 }`: the canister uses a test key for signing via threshold EdDSA that is available on the ICP mainnet. - See [signing messages](https://internetcomputer.org/docs/current/developer-docs/smart-contracts/encryption/signing-messages#signing-messages-1) - for more details. - - `sol_rpc_canister_id = null`: the canister makes RPC requests to the Solana network via the standard SOL RPC - - canister on the ICP mainnet ([`tghme-zyaaa-aaaar-qarca-cai`](https://dashboard.internetcomputer.org/canister/tghme-zyaaa-aaaar-qarca-cai)). - This can be replaced by the canister ID of another SOL RPC canister, e.g. a locally deployed one if running this - tutorial locally. - -If successful, you should see an output that looks like this: +What this does: +- `dfx start --clean --background` starts a local instance of the ICP blockchain. +- `dfx deploy` deploys a wallet canister as well as a SOL RPC canister, both locally. The wallet canister interacts with + the Solana Devnet via the local SOL RPC canister. +- `./provision.sh` provisions dummy API keys for the JSON-RPC providers. This is because the locally deployed instance + of the SOL RPC canister is configured to make RPC requests to the public RPC endpoint offered by the Solana foundation + (see [here](https://solana.com/docs/references/clusters)) instead of via the RPC providers that the SOL RPC canister + deployed on Mainnet is configured to use. + +**NOTE:** If running this example locally, you will need to skip the `--ic` flag in all subsequent `dfx` commands. + +### Getting the canister ID + +If the canister deployment is successful (whether on Mainnet of locally), you should see an output that looks like this: ```bash Deploying: basic_solana @@ -262,7 +275,7 @@ dfx canister call basic_solana get_spl_token_balance '(opt principal " Date: Tue, 17 Jun 2025 16:40:36 +0200 Subject: [PATCH 3/8] XC-335: Small improvements to README and deployment files --- examples/basic_solana/README.md | 6 +++--- examples/basic_solana/local/canister_ids.json | 2 +- examples/basic_solana/mainnet/dfx.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/basic_solana/README.md b/examples/basic_solana/README.md index 66618560..46011a40 100644 --- a/examples/basic_solana/README.md +++ b/examples/basic_solana/README.md @@ -47,7 +47,7 @@ Deploying to the Internet Computer requires [cycles](https://internetcomputer.org/docs/current/developer-docs/getting-started/tokens-and-cycles) (the equivalent of "gas" on other blockchains). -### Deploy the smart contract to the Internet Computer +### Deployment #### Mainnet deployment @@ -55,7 +55,7 @@ To deploy the Solana wallet smart contract to the ICP Mainnet, navigate to `exam the following command: ```bash -dfx deploy +dfx deploy --ic ``` This deploys a wallet canister to the ICP Mainnet which is configured to interact with the Solana Devnet via the SOL RPC @@ -65,7 +65,7 @@ running this example locally as described in the next section. #### Local deployment -To deploy the Solana wallet smart contract locally, navigate to `examples/basic_solana/mainnet` and execute the +To deploy the Solana wallet smart contract locally, navigate to `examples/basic_solana/local` and execute the following commands: ```bash diff --git a/examples/basic_solana/local/canister_ids.json b/examples/basic_solana/local/canister_ids.json index 20e5dfd2..56a8a908 100644 --- a/examples/basic_solana/local/canister_ids.json +++ b/examples/basic_solana/local/canister_ids.json @@ -1,5 +1,5 @@ { "sol_rpc": { - "ic": "be2us-64aaa-aaaaa-qaabq-cai" + "local": "be2us-64aaa-aaaaa-qaabq-cai" } } \ No newline at end of file diff --git a/examples/basic_solana/mainnet/dfx.json b/examples/basic_solana/mainnet/dfx.json index 4b3f5afa..59eabc34 100644 --- a/examples/basic_solana/mainnet/dfx.json +++ b/examples/basic_solana/mainnet/dfx.json @@ -1,7 +1,7 @@ { "canisters": { "basic_solana": { - "candid": "basic_solana.did", + "candid": "../../../canister/sol_rpc_canister.did", "package": "basic_solana", "type": "custom", "build": [ @@ -13,7 +13,7 @@ "name": "candid:service" } ], - "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { MainnetTestKey1 }; sol_rpc_canister_id = null } )" + "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { MainnetTestKey1 }; sol_rpc_canister_id = opt principal \"tghme-zyaaa-aaaar-qarca-cai\" } )" } }, "version": 1 From fa47daec518ba90ec29e7f5f9402178b10f3fa3c Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 17 Jun 2025 16:46:10 +0200 Subject: [PATCH 4/8] XC-335: Provision API keys for local development in dfx.json post_install --- examples/basic_solana/README.md | 4 ---- examples/basic_solana/local/dfx.json | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/basic_solana/README.md b/examples/basic_solana/README.md index 46011a40..eb571ef2 100644 --- a/examples/basic_solana/README.md +++ b/examples/basic_solana/README.md @@ -78,10 +78,6 @@ What this does: - `dfx start --clean --background` starts a local instance of the ICP blockchain. - `dfx deploy` deploys a wallet canister as well as a SOL RPC canister, both locally. The wallet canister interacts with the Solana Devnet via the local SOL RPC canister. -- `./provision.sh` provisions dummy API keys for the JSON-RPC providers. This is because the locally deployed instance - of the SOL RPC canister is configured to make RPC requests to the public RPC endpoint offered by the Solana foundation - (see [here](https://solana.com/docs/references/clusters)) instead of via the RPC providers that the SOL RPC canister - deployed on Mainnet is configured to use. **NOTE:** If running this example locally, you will need to skip the `--ic` flag in all subsequent `dfx` commands. diff --git a/examples/basic_solana/local/dfx.json b/examples/basic_solana/local/dfx.json index 3653527a..db089231 100644 --- a/examples/basic_solana/local/dfx.json +++ b/examples/basic_solana/local/dfx.json @@ -29,7 +29,8 @@ "name": "candid:service" } ], - "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { LocalDevelopment }; sol_rpc_canister_id = opt principal \"be2us-64aaa-aaaaa-qaabq-cai\" } )" + "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { LocalDevelopment }; sol_rpc_canister_id = opt principal \"be2us-64aaa-aaaaa-qaabq-cai\" } )", + "post_install": "./provision.sh" } }, "version": 1 From 6105d7aa922a97ece37b675abbf65ac9d7e9b551 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 17 Jun 2025 17:12:01 +0200 Subject: [PATCH 5/8] XC-335: Change local canister ID for sol_rpc canister --- examples/basic_solana/local/canister_ids.json | 2 +- examples/basic_solana/local/dfx.json | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/basic_solana/local/canister_ids.json b/examples/basic_solana/local/canister_ids.json index 56a8a908..f87d4844 100644 --- a/examples/basic_solana/local/canister_ids.json +++ b/examples/basic_solana/local/canister_ids.json @@ -1,5 +1,5 @@ { "sol_rpc": { - "local": "be2us-64aaa-aaaaa-qaabq-cai" + "local": "kc2ee-duaaa-aaaaa-qaaaq-d7y" } } \ No newline at end of file diff --git a/examples/basic_solana/local/dfx.json b/examples/basic_solana/local/dfx.json index db089231..10d3e201 100644 --- a/examples/basic_solana/local/dfx.json +++ b/examples/basic_solana/local/dfx.json @@ -1,7 +1,7 @@ { "canisters": { "sol_rpc": { - "specified_id": "be2us-64aaa-aaaaa-qaabq-cai", + "specified_id": "kc2ee-duaaa-aaaaa-qaaaq-d7y", "candid": "../../../canister/sol_rpc_canister.did", "package": "sol_rpc_canister", "type": "custom", @@ -29,8 +29,7 @@ "name": "candid:service" } ], - "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { LocalDevelopment }; sol_rpc_canister_id = opt principal \"be2us-64aaa-aaaaa-qaabq-cai\" } )", - "post_install": "./provision.sh" + "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { LocalDevelopment }; sol_rpc_canister_id = opt principal \"kc2ee-duaaa-aaaaa-qaaaq-d7y\" } )" } }, "version": 1 From c5aa8fcc0be75e89b493448cc4f0c0c451bb8eeb Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Tue, 17 Jun 2025 17:23:13 +0200 Subject: [PATCH 6/8] XC-335: Move post_install to sol_rpc canister --- examples/basic_solana/local/dfx.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/basic_solana/local/dfx.json b/examples/basic_solana/local/dfx.json index 10d3e201..53527877 100644 --- a/examples/basic_solana/local/dfx.json +++ b/examples/basic_solana/local/dfx.json @@ -14,7 +14,8 @@ "name": "candid:service" } ], - "init_arg": "( record { manageApiKeys = null; overrideProvider = opt record { overrideUrl = opt record { pattern = \".*\"; replacement = \"https://api.devnet.solana.com\" } }; logFilter = opt variant { ShowAll }; numSubnetNodes = null; mode = opt variant { Demo }; } )" + "init_arg": "( record { manageApiKeys = null; overrideProvider = opt record { overrideUrl = opt record { pattern = \".*\"; replacement = \"https://api.devnet.solana.com\" } }; logFilter = opt variant { ShowAll }; numSubnetNodes = null; mode = opt variant { Demo }; } )", + "post_install": "./provision.sh" }, "basic_solana": { "candid": "../basic_solana.did", From 6fa579806c936c74ea06948e84db1943a6aae8ed Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Wed, 18 Jun 2025 08:05:37 +0200 Subject: [PATCH 7/8] XC-335: Fix candid file for mainnet basic_solana --- examples/basic_solana/mainnet/dfx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic_solana/mainnet/dfx.json b/examples/basic_solana/mainnet/dfx.json index 59eabc34..88e23b0f 100644 --- a/examples/basic_solana/mainnet/dfx.json +++ b/examples/basic_solana/mainnet/dfx.json @@ -1,7 +1,7 @@ { "canisters": { "basic_solana": { - "candid": "../../../canister/sol_rpc_canister.did", + "candid": "../basic_solana.did", "package": "basic_solana", "type": "custom", "build": [ From 4eb4edeec9a25b70515481d9c5a16c2eb4a0b403 Mon Sep 17 00:00:00 2001 From: Louis Pahlavi Date: Wed, 18 Jun 2025 10:14:27 +0200 Subject: [PATCH 8/8] XC-335: Add explicit instructions to use dfx 0.27.0 --- examples/basic_solana/README.md | 8 ++++++-- examples/basic_solana/local/canister_ids.json | 2 +- examples/basic_solana/local/dfx.json | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/basic_solana/README.md b/examples/basic_solana/README.md index eb571ef2..0239ca23 100644 --- a/examples/basic_solana/README.md +++ b/examples/basic_solana/README.md @@ -24,7 +24,11 @@ the [chain fusion overview](https://internetcomputer.org/docs/building-apps/chai ## Prerequisites -* [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx). +* [ ] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/index.mdx) v0.27.0. If the IC SDK is already installed with an old version, install 0.27.0 with [`dfxvm`](https://internetcomputer.org/docs/building-apps/developer-tools/dev-tools-overview#dfxvm). +* [ ] Confirm the IC SDK has been installed with the correct version: +```shell +dfx --version +``` ## Step 1: Building and deploying sample code @@ -278,7 +282,7 @@ In this tutorial, you were able to: * Create a Solana nonce account and use the canister to send some SOL to another Solana account using durable nonces. * Create an associated token account for an SPL token use the canister to send some tokens to another Solana account. -Additional examples regarding the ICP < > SOL integration can be +Additional examples regarding the ICP <> SOL integration can be found [here](https://github.com/dfinity/sol-rpc-canister/tree/main/examples). ## Security considerations and best practices diff --git a/examples/basic_solana/local/canister_ids.json b/examples/basic_solana/local/canister_ids.json index f87d4844..21f147bf 100644 --- a/examples/basic_solana/local/canister_ids.json +++ b/examples/basic_solana/local/canister_ids.json @@ -1,5 +1,5 @@ { "sol_rpc": { - "local": "kc2ee-duaaa-aaaaa-qaaaq-d7y" + "local": "lxzze-o7777-77777-aaaaa-cai" } } \ No newline at end of file diff --git a/examples/basic_solana/local/dfx.json b/examples/basic_solana/local/dfx.json index 53527877..39612efc 100644 --- a/examples/basic_solana/local/dfx.json +++ b/examples/basic_solana/local/dfx.json @@ -1,7 +1,7 @@ { "canisters": { "sol_rpc": { - "specified_id": "kc2ee-duaaa-aaaaa-qaaaq-d7y", + "specified_id": "lxzze-o7777-77777-aaaaa-cai", "candid": "../../../canister/sol_rpc_canister.did", "package": "sol_rpc_canister", "type": "custom", @@ -30,7 +30,7 @@ "name": "candid:service" } ], - "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { LocalDevelopment }; sol_rpc_canister_id = opt principal \"kc2ee-duaaa-aaaaa-qaaaq-d7y\" } )" + "init_arg": "( record { solana_network = opt variant { Devnet }; ed25519_key_name = opt variant { LocalDevelopment }; sol_rpc_canister_id = opt principal \"lxzze-o7777-77777-aaaaa-cai\" } )" } }, "version": 1