diff --git a/documentation/sdk/create-aleo-app/01_create_aleo_app.md b/documentation/sdk/create-aleo-app/01_create_aleo_app.md index 4f9eb3bb2..f990b2b83 100644 --- a/documentation/sdk/create-aleo-app/01_create_aleo_app.md +++ b/documentation/sdk/create-aleo-app/01_create_aleo_app.md @@ -143,7 +143,7 @@ Take your transaction ID from the Discord URL earlier: at12u62xwfew2rq32xee8nwhtlxghfjz7mm3528yj240nuezue625fqy4lhlp ``` -Go to “Get Transaction” at [aleo.tools/rest](https://aleo.tools/rest) and insert your transaction ID to look at the JSON object. You can similarly use https://vm.aleo.org/api/testnet3/transaction/[insert-your-transaction-id] to get the same output in your browser. +Go to “Get Transaction” at [aleo.tools/rest](https://aleo.tools/rest) and insert your transaction ID to look at the JSON object. You can similarly use https://api.explorer.aleo.org/v1/testnet3/transaction/[insert-your-transaction-id] to get the same output in your browser. ![get-transaction](./images/get-transaction.png) diff --git a/documentation/sdk/typescript/00_sdk_overview.md b/documentation/sdk/typescript/00_sdk_overview.md index 5dd614c00..bb5412a71 100644 --- a/documentation/sdk/typescript/00_sdk_overview.md +++ b/documentation/sdk/typescript/00_sdk_overview.md @@ -266,12 +266,12 @@ const keyProvider = new AleoKeyProvider(); keyProvider.useCache = true; // Create a record provider that will be used to find records and transaction data for Aleo programs -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const recordProvider = new NetworkRecordProvider(account, networkClient); // Initialize a program manager to talk to the Aleo network with the configured key and record providers const programName = "hello_hello.aleo"; -const programManager = new ProgramManager("https://vm.aleo.org/api", keyProvider, recordProvider); +const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider); // Provide a key search parameter to find the correct key for the program if they are stored in a memory cache const keySearchParams = { "cacheKey": "hello_hello:hello" }; @@ -332,11 +332,11 @@ const keyProvider = new AleoKeyProvider(); keyProvider.useCache = true; // Create a record provider that will be used to find records and transaction data for Aleo programs -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const recordProvider = new NetworkRecordProvider(account, networkClient); // Initialize a program manager to talk to the Aleo network with the configured key and record providers -const programManager = new ProgramManager("https://vm.aleo.org/api", keyProvider, recordProvider); +const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider); // Define an Aleo program to deploy const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n"; @@ -402,9 +402,9 @@ await aleo.initializeWasm(); await aleo.initThreadPool(8); /// The program manager is initialized with a key provider and a record provider -const defaultHost = "https://vm.aleo.org/api"; +const defaultHost = "https://api.explorer.aleo.org/v1"; const keyProvider = new aleo.AleoKeyProvider(); -const recordProvider = new aleo.NetworkRecordProvider(new Account(), "https://vm.aleo.org/api"); +const recordProvider = new aleo.NetworkRecordProvider(new Account(), "https://api.explorer.aleo.org/v1"); const programManager = new aleo.ProgramManager( defaultHost, keyProvider, @@ -785,13 +785,13 @@ import { Account, ProgramManager, AleoKeyProvider, NetworkRecordProvider, AleoNe // Create a new NetworkClient, KeyProvider, and RecordProvider const account = Account.from_string({privateKey: "user1PrivateKey"}); -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const keyProvider = new AleoKeyProvider(); const recordProvider = new NetworkRecordProvider(account, networkClient); // Initialize a program manager with the key provider to automatically fetch keys for executions const USER_1_ADDRESS = "user1Address"; -const programManager = new ProgramManager("https://vm.aleo.org/api", keyProvider, recordProvider); +const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider); programManager.setAccount(account); // Send a private transfer to yourself @@ -826,7 +826,7 @@ assert(public_balance === 0); As shown above, a public balance of any address can be checked with `getMappingValue` function of the `NetworkClient`. ```typescript -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const USER_1_ADDRESS = "user1Address"; const public_balance = networkClient.getMappingValue("credits.aleo", USER_1_ADDRESS); ``` @@ -919,13 +919,13 @@ import { Account, ProgramManager, AleoKeyProvider, NetworkRecordProvider, AleoNe // Create a new NetworkClient, KeyProvider, and RecordProvider const account = Account.from_string({privateKey: "user1PrivateKey"}); -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const keyProvider = new AleoKeyProvider(); const recordProvider = new NetworkRecordProvider(account, networkClient); // Initialize a program manager with the key provider to automatically fetch keys for executions const USER_2_ADDRESS = "user2Address"; -const programManager = new ProgramManager("https://vm.aleo.org/api", keyProvider, recordProvider); +const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider); programManager.setAccount(account); /// Send private transfer to user 2 @@ -940,12 +940,12 @@ import { Account, ProgramManager, AleoKeyProvider, NetworkRecordProvider, AleoNe // Create a new NetworkClient, KeyProvider, and RecordProvider const account = Account.from_string({privateKey: "user2PrivateKey"}); -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const keyProvider = new AleoKeyProvider(); const recordProvider_User2 = new NetworkRecordProvider(account, networkClient); // Initialize a program manager with the key provider to automatically fetch keys for executions -const programManager = new ProgramManager("https://vm.aleo.org/api", keyProvider, recordProvider); +const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider); programManager.setAccount(account); // Fetch the transaction from the network that user 1 sent @@ -1109,7 +1109,7 @@ read the value of a specific key within a mapping. ```typescript import { AleoNetworkClient } from '@aleo/sdk'; -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const creditsMappings = networkClient.getMappings("credits.aleo"); assert(creditsMappings === ["account"]); @@ -1156,13 +1156,13 @@ import { Account, ProgramManager, AleoKeyProvider, NetworkRecordProvider, AleoNe // Create a new NetworkClient, KeyProvider, and RecordProvider const account = Account.from_string({privateKey: "user1PrivateKey"}); -const networkClient = new AleoNetworkClient("https://vm.aleo.org/api"); +const networkClient = new AleoNetworkClient("https://api.explorer.aleo.org/v1"); const keyProvider = new AleoKeyProvider(); const recordProvider = new NetworkRecordProvider(account, networkClient); // Initialize a program manager with the key provider to automatically fetch keys for executions const RECIPIENT_ADDRESS = "user1Address"; -const programManager = new ProgramManager("https://vm.aleo.org/api", keyProvider, recordProvider); +const programManager = new ProgramManager("https://api.explorer.aleo.org/v1", keyProvider, recordProvider); programManager.setAccount(account); // Update or initialize a public balance diff --git a/documentation/sdk/typescript/02_aleo_network_client.md b/documentation/sdk/typescript/02_aleo_network_client.md index 05de9c37f..2e57e9731 100644 --- a/documentation/sdk/typescript/02_aleo_network_client.md +++ b/documentation/sdk/typescript/02_aleo_network_client.md @@ -44,7 +44,7 @@ The methods provided in this class provide information on the Aleo Blockchain

diff --git a/documentation/testnet/getting_started/02_deploy_and_execute.md b/documentation/testnet/getting_started/02_deploy_and_execute.md index 98d4b2250..d453a868e 100644 --- a/documentation/testnet/getting_started/02_deploy_and_execute.md +++ b/documentation/testnet/getting_started/02_deploy_and_execute.md @@ -214,7 +214,7 @@ To deploy and execute programs on Testnet3 1. Replace [step 3](#3-scan-the-node-for-spendable-records) with the Aleo faucet to obtain spendable credits. You can request credits from [the faucet](https://faucet.aleo.org/) -2. Replace the use of `http://localhost:3030` with `https://vm.aleo.org/api` +2. Replace the use of `http://localhost:3030` with `https://api.explorer.aleo.org/v1` diff --git a/documentation/testnet/getting_started/03_deploy_and_execute_demo.md b/documentation/testnet/getting_started/03_deploy_and_execute_demo.md index ed30bde64..166304722 100644 --- a/documentation/testnet/getting_started/03_deploy_and_execute_demo.md +++ b/documentation/testnet/getting_started/03_deploy_and_execute_demo.md @@ -139,7 +139,7 @@ RECORD="" * Deploy your Leo application (if all your variables were assigned correctly, you should be able to copy/paste the following ``` -snarkos developer deploy "${APPNAME}.aleo" --private-key "${PRIVATEKEY}" --query "https://vm.aleo.org/api" --path "./${APPNAME}/build/" --broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast" --fee 1000000 --record "${RECORD}" +snarkos developer deploy "${APPNAME}.aleo" --private-key "${PRIVATEKEY}" --query "https://api.explorer.aleo.org/v1" --path "./${APPNAME}/build/" --broadcast "https://api.explorer.aleo.org/v1/testnet3/transaction/broadcast" --fee 1000000 --record "${RECORD}" ``` You should have seen a confirmation that your Aleo application was deployed in the form of a transaction ID that looks like the following `at1rkkpqu5k4rt86zzccczw6cxeyvrl7hxydvvv7dhl7zr7p9w40c8s70kwm8`. Make sure to copy this string as you'll need it for the last step. @@ -149,8 +149,8 @@ You should have seen a confirmation that your Aleo application was deployed in t Finally, it is time to execute the application you just deployed! -* You'll need to update the `--record` flag with the latest transaction linked to your wallet balance. In this case, you can obtain that by going to the following URL: https://vm.aleo.org/api/testnet3/transaction/$DEPLOY_TX_ID but replace $DEPLOY_TX_ID with the transaction ID provided to you once your application was deployed (or from the most recent transaction linked to your wallet address). An example URL looks like so: https://vm.aleo.org/api/testnet3/transaction/at1rkkpqu5k4rt86zzccczw6cxeyvrl7hxydvvv7dhl7zr7p9w40c8s70kwm8 -* In the JSON object provided at https://vm.aleo.org/api/testnet3/transaction/$DEPLOY_TX_ID, navigate to: `object.fee.transition.outputs[0].value` and copy the record ciphertext value. +* You'll need to update the `--record` flag with the latest transaction linked to your wallet balance. In this case, you can obtain that by going to the following URL: https://api.explorer.aleo.org/v1/testnet3/transaction/$DEPLOY_TX_ID but replace $DEPLOY_TX_ID with the transaction ID provided to you once your application was deployed (or from the most recent transaction linked to your wallet address). An example URL looks like so: https://api.explorer.aleo.org/v1/testnet3/transaction/at1rkkpqu5k4rt86zzccczw6cxeyvrl7hxydvvv7dhl7zr7p9w40c8s70kwm8 +* In the JSON object provided at https://api.explorer.aleo.org/v1/testnet3/transaction/$DEPLOY_TX_ID, navigate to: `object.fee.transition.outputs[0].value` and copy the record ciphertext value. * Head to [aleo.tools](https://aleo.tools/) and navigate to the **Record** tab and paste the record ciphertext you just copied as well as your wallet's view key * Similar to the steps we followed for a deploy transaction, update your `RECORD` variable with the record plaintext you just decrypted by doing the following: @@ -165,7 +165,7 @@ RECORD="" Then just paste the following command in your terminal ``` -snarkos developer execute "${APPNAME}.aleo" "main" "1u32" "2u32" --private-key "${PRIVATEKEY}" --query "https://vm.aleo.org/api" --broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast" --fee 1000000 --record "${RECORD}" +snarkos developer execute "${APPNAME}.aleo" "main" "1u32" "2u32" --private-key "${PRIVATEKEY}" --query "https://api.explorer.aleo.org/v1" --broadcast "https://api.explorer.aleo.org/v1/testnet3/transaction/broadcast" --fee 1000000 --record "${RECORD}" ``` Awesome! You have successfully deployed and executed a Leo application to Testnet III, how exciting 🎉