### Install Dependencies, Build, and Serve Documentation Source: https://github.com/casper-network/docs-redux/blob/dev/README.md Install necessary packages, build the static site, and start a local server to view the documentation. ```bash npm install npm run build npm run serve ``` -------------------------------- ### Example Contract Installation on Local Network Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/cli/installing-contracts.md This example demonstrates how to install a contract named 'counter-installer.wasm' to a local NCTL network. It specifies the node address, chain name, secret key path, gas tolerance, pricing mode, and the path to the Wasm file. ```bash casper-client put-transaction session \ --node-address http://localhost:11101 \ --chain-name casper-net-1 \ --secret-key ~/casper/casper-nctl/assets/net-1/users/user-1/secret_key.pem \ --gas-price-tolerance 10 \ --pricing-mode fixed \ --transaction-path ~/test_contracts/counter_installer.wasm \ --session-entry-point call \ --category 'install-upgrade' ``` -------------------------------- ### Running the CEP-78 Install Example Source: https://github.com/casper-network/docs-redux/blob/dev/docs/resources/tokens/cep78/js-tutorial.md Executes a script to install a CEP-78 contract instance on the network. Requires environment variables like NODE_URL and NETWORK_NAME to be set. ```bash npm run example:install ``` -------------------------------- ### Install Project Dependencies and Start Dev Server Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/dapps/template-frontend.md Install project dependencies and start the development server using npm. This command is used after creating a new Vite project. ```bash npm install vite dev ``` -------------------------------- ### Set up and Start Local Network Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/dapps/setup-nctl.md Set up all necessary assets for a local network (binaries, chainspec, config, faucet, keys) and start the network. The default setup includes 10 nodes and sidecars. ```bash nctl-assets-setup && nctl-start ``` -------------------------------- ### Contract State Installation Example Source: https://github.com/casper-network/docs-redux/blob/dev/versioned_docs/version-2.0.0/developers/cli/installing-contracts.md Illustrates the structure of state entries when installing a contract, including balance, URef, package, and named key entities. This is typically part of a larger deployment or state update process. ```json { "key": "balance-hold-0121dc8fc358c4e30ae29786bd4842a5f99da83efa0b9ca8461cd2196ffbfd07f172b7ab7491010000", "kind": { "Write": { "CLValue": { "cl_type": "U512", "bytes": "050010a5d4e8", "parsed": "1000000000000" } } } } ``` ```json { "key": "uref-65f3f583bf1ac01b6c90d9c9478bd239c09e46f48fb693918726eaab03631407-000", "kind": { "Write": { "CLValue": { "cl_type": "I32", "bytes": "00000000", "parsed": 0 } } } } ``` ```json { "key": "uref-29feb2af8a9d7b6d2ef6be875a0aa326b646a00b7cdd2dd4a65365e84e9f2e9a-000", "kind": { "Write": { "CLValue": { "cl_type": "Unit", "bytes": "", "parsed": null } } } } ``` ```json { "key": "package-50d487af45f8cec533c6813801a7630ff97e5ee3964daf7915d5451b4812ac94", "kind": { "Write": { "Package": { "versions": [], "disabled_versions": [], "groups": [], "lock_status": "Unlocked" } } } } ``` ```json { "key": "named-key-entity-account-6a56c4eee172043975aea72221eaf09f3c3a24f09a379935e44c9979f1ae9463-05c3e063406ddde43671e0d47c45e31a10e9204137171f96ce818bdc725a4e1b", "kind": { "Write": { "NamedKey": { "named_key": { "cl_type": "Key", "bytes": "1050d487af45f8cec533c6813801a7630ff97e5ee3964daf7915d5451b4812ac94", "parsed": "package-50d487af45f8cec533c6813801a7630ff97e5ee3964daf7915d5451b4812ac94" }, "name": { "cl_type": "String", "bytes": "14000000636f756e7465725f7061636b6167655f6e616d65", "parsed": "counter_package_name" } } } } } ``` ```json { "key": "named-key-entity-account-6a56c4eee172043975aea72221eaf09f3c3a24f09a379935e44c9979f1ae9463-6409273bf327d5a6a39a29dbd07c5cd2f48ee4f227fd443d025adc51e1bd5103", "kind": { "Write": { "NamedKey": { "named_key": { "cl_type": "Key", "bytes": "0229feb2af8a9d7b6d2ef6be875a0aa326b646a00b7cdd2dd4a65365e84e9f2e9a07", "parsed": "uref-29feb2af8a9d7b6d2ef6be875a0aa326b646a00b7cdd2dd4a65365e84e9f2e9a-007" }, "name": { "cl_type": "String", "bytes": "13000000636f756e7465725f6163636573735f75726566", "parsed": "counter_access_uref" } } } } } ``` ```json { "key": "package-50d487af45f8cec533c6813801a7630ff97e5ee3964daf7915d5451b4812ac94", "kind": "Identity" } ``` ```json { "key": "entity-system-1f15cf43df68e8b382415a8ef687521f61f1ecce6960b72eaa13f43bfc448139", "kind": "Identity" } ``` ```json { "key": "package-f1c97c9b6228be3f316753e4e1289d910071fb880dddccce18881abfb9f53526", "kind": "Identity" } ``` ```json { "key": "entry-point-v1-entity-system-1f15cf43df68e8b382415a8ef687521f61f1ecce6960b72eaa13f43bfc448139-21bddc7e4379ba445c7118cb51962954e0d1e5aa5cacc0c4ff6095b57eb9fb33", "kind": "Identity" } ``` ```json { "key": "uref-2cb7e46fcde2c4d395a6850bb3b7edbb0b4db6018643e535fa0dfdeeb006d6ef-000", "kind": { "Write": { "CLValue": { "cl_type": "Unit", "bytes": "", "parsed": null } } } } ``` ```json { "key": "balance-2cb7e46fcde2c4d395a6850bb3b7edbb0b4db6018643e535fa0dfdeeb006d6ef", "kind": { "Write": { "CLValue": { "cl_type": "U512", "bytes": "00", "parsed": "0" } } } } ``` ```json { "key": "byte-code-v1-wasm-0577a7c92fd20e1af76aa9e257631cb240e8187191bba2025e88663d0288e936" } ``` -------------------------------- ### Install Contract using Casper-Client (Rust) Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/dapps/sdk/client-library-usage.md This Rust example demonstrates installing a contract using the casper-client library. It requires specifying the node address, secret key path, chain name, session arguments, and payment amount. The `put_deploy` function sends the deploy to the network. ```rust extern crate casper_client; async fn put_deploy(){ let maybe_rpc: &str = ""; let verbosity: u64 = 1; let node_address: &str = "http://135.181.216.142:7777"; let deploy_params: casper_client::DeployStrParams = casper_client::DeployStrParams{ secret_key:"./sk_testnet.pem", timestamp:"", ttl:"50s", gas_price:"1000000000", chain_name:"casper", // or "casper-test" dependencies: Vec::new(), session_account: "01daad67ebbcb725e02a1955a6617512b311435a21ca6d523085aa015d2d1b473a" }; // Without session args: // let session_args: Vec<&str> = Vec::new(); // With session args: let mut session_args: Vec<&str> = Vec::new(); session_args.push("argument:String='hello world'"); let session_params: casper_client::SessionStrParams = casper_client::SessionStrParams::with_path("./contract.wasm", session_args, ""); let payment_params: casper_client::PaymentStrParams = casper_client::PaymentStrParams::with_amount("10000000000"); let result = casper_client::put_deploy(maybe_rpc_id, node_address, verbosity_level, deploy_params, session_params, payment_params).await.unwrap(); println!("Deploy response: {:?}", result); } #[tokio::main] async fn main(){ send_transfer().await; } ``` -------------------------------- ### Install Rustup Source: https://github.com/casper-network/docs-redux/blob/dev/condor/local-setup.md Install Rustup, the toolchain installer for Rust, which is a prerequisite for building the Casper Client locally. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Installing Dependencies with npm Source: https://github.com/casper-network/docs-redux/blob/dev/docs/resources/tokens/cep78/js-tutorial.md Installs the necessary project dependencies for running CEP-78 examples. Ensure you have Node.js and npm installed. ```bash npm i ``` -------------------------------- ### Check CMake Version Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/prerequisites.md Verify that CMake is installed and check its version. This command is useful after installation or upgrade to confirm the setup. ```bash cmake --version ``` -------------------------------- ### Build and Test Authorization Keys Example Source: https://github.com/casper-network/docs-redux/blob/dev/docs/resources/advanced/list-auth-keys-tutorial.md Commands to clone the repository, navigate to the example directory, and build the project's tests. Ensure your Rust environment is prepared. ```bash git clone https://github.com/casper-ecosystem/tutorials-example-wasm cd tutorials-example-wasm/authorization-keys-example make prepare make test ``` -------------------------------- ### Start Localhost Server Source: https://github.com/casper-network/docs-redux/blob/dev/README/SETUP.md Starts the development server to run the documentation website locally. Access it via http://localhost:3000/. ```bash yarn run start ``` -------------------------------- ### Install Casper Node Launcher Source: https://github.com/casper-network/docs-redux/blob/dev/docs/operators/setup/basic-node-configuration.md Installs the `casper-node-launcher` Debian package to manage Casper node processes and upgrades. This is a one-time setup step. ```bash sudo apt update sudo apt install casper-node-launcher ``` -------------------------------- ### Rust: Deploying Entry Point with Installer Authorization Source: https://github.com/casper-network/docs-redux/blob/dev/docs/resources/advanced/list-auth-keys-tutorial.md This snippet demonstrates how to construct and execute a deploy item for a contract's entry point. It specifies the contract hash, entry point name, payment, and authorization keys. Use this when the caller needs to be authorized by the installer's keys. ```rust let contract_hash = builder .get_expected_account(*DEFAULT_ACCOUNT_ADDR) .named_keys() .get(CONTRACT_HASH) .expect("must have this entry in named keys") .into_hash() .map(ContractHash::new) .unwrap(); let entry_point_deploy_item = DeployItemBuilder::new() .with_empty_payment_bytes(runtime_args! {ARG_AMOUNT => *DEFAULT_PAYMENT}) .with_authorization_keys(&[account_addr_1]) .with_address(account_addr_1) .with_stored_session_hash(contract_hash, ENTRYPOINT, runtime_args! {}) .build(); let entry_point_request = ExecuteRequestBuilder::from_deploy_item(entry_point_deploy_item).build(); builder.exec(entry_point_request).expect_success().commit(); ``` -------------------------------- ### Sample Output of Casper Sidecar Installation Source: https://github.com/casper-network/docs-redux/blob/dev/docs/operators/setup/casper-sidecar.md Illustrates the expected output when installing the Casper Sidecar Debian package, including package details and service setup. ```bash Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'casper-sidecar' instead of './casper-sidecar_0.1.0-0_amd64.deb' The following NEW packages will be installed: casper-sidecar 0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded. Need to get 0 B/4162 kB of archives. After this operation, 20.2 MB of additional disk space will be used. Get:1 /home/ubuntu/casper-sidecar_0.1.0-0_amd64.deb casper-sidecar amd64 0.1.0-0 [4162 kB] Selecting previously unselected package casper-sidecar. (Reading database ... 102241 files and directories currently installed.) Preparing to unpack .../casper-sidecar_0.1.0-0_amd64.deb ... Unpacking casper-sidecar (0.1.0-0) ... Setting up casper-sidecar (0.1.0-0) ... Adding system user `csidecar' (UID 114) ... Adding new group `csidecar' (GID 120) ... Adding new user `csidecar' (UID 114) with group `csidecar' ... Not creating home directory `/home/csidecar'. Created symlink /etc/systemd/system/multi-user.target.wants/casper-sidecar.service → /lib/systemd/system/casper-sidecar.service. ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/casper-network/docs-redux/blob/dev/README/SETUP.md Installs all necessary project dependencies for the documentation website. This command should be run once in the cloned repository folder. ```bash yarn install ``` -------------------------------- ### Example Casper Client Get Block Response Source: https://github.com/casper-network/docs-redux/blob/dev/src/pages/condor/setting-up-condor-local.md This is an example JSON output from the `casper-client get-block` command, showing the details of a block from a local Casper network. ```json { "jsonrpc": "2.0", "id": -2049464589362040719, "result": { "api_version": "2.0.0", "block_with_signatures": { "block": { "Version2": { "hash": "9e7c32760b6fefcd4e1a579a9dce0835e1d564e5a5aedaf06911d76f64af9e0c", "header": { "parent_hash": "ecd94fd34417032d4e7b77b0dce3c48164398d1946d95a57b50c73eaee59cf90", "state_root_hash": "ad53786aed35ef7e5a608552329ff0ab33055c4e4bf6764124a3603fce49990a", "body_hash": "18937e8cf4338b5f5fdc2581f8d7d6a47de736d2799e3f3bc9b0ff9f1e7cf106", "random_bit": false, "accumulated_seed": "1ce9cae18eccdea58c1a6b22474c6f98e4a4bf17d53a306390f528a18d264f59", "era_end": null, "timestamp": "2025-04-23T03:41:03.130Z", "era_id": 94, "height": 1028, "protocol_version": "2.0.0", "proposer": "0190664e16a17594ed2d0e3c279c4cf5894e8db0da15e3b91c938562a1caae32ab", "current_gas_price": 1, "last_switch_block_hash": "db222beace01c5c624cbd84a62c92feb0a23f3e0c3372dd5cba9e7ce51db63cf" }, "body": { "transactions": {}, "rewarded_signatures": [ [ 248 ], [ 0 ], [ 0 ] ] } } }, "proofs": [ { "public_key": "01509254f22690fbe7fb6134be574c4fbdb060dfa699964653b99753485e518ea6", "signature": "01fbe5ca7584cd517b51cc2ee1c79c055eaccb523470b5f460f23c365d476dabf40d62d753b0f1c1003568dd555b64848cda2029d3f31bf9ee548ea6aefca72506" }, { "public_key": "0190664e16a17594ed2d0e3c279c4cf5894e8db0da15e3b91c938562a1caae32ab", "signature": "014ebd115e50169c79dd469f6118df18869232839bc07c3cff079837657ba9d31d913d367da886442f1532fbef66e86985d693346037b4863ef0ec90c1476e3403" }, { "public_key": "01c867ff3cf1d4e4e68fc00922fdcb740304def196e223091dee62012f444b9eba", "signature": "01d183f46c1a0af713c2f0629ea0436cb37c04ef300f8c25f84384607a91817e869956ccf47a4902f9d51c173cb8c3f6949391c792e343bc93968274b4c692e50c" }, { "public_key": "01f58b94526d280881f79744effebc555426190950d5dfdd2f8aaf10ceaec010c6", "signature": "01308ad12b69bc92497ad3b9d169d685a436ee4194a0e291a14e022bc0e70e5ee881a2f0be5301752ad9888a790bd9c4a7cbff1481df472166f3dce29df9ec9d00" }, { "public_key": "01fed662dc7f1f7af43ad785ba07a8cc05b7a96f9ee69613cfde43bc56bec1140b", "signature": "01bac3f6529816492daaa019a4ecf5bd3ef68757a266e4b4a0382a56268fdbc86a65ec037feb87cda554e244f25c3c9e525961a1a660b39ebd6f1aee2e64ce0006" } ] } } } } ``` -------------------------------- ### NCTL Transaction Installation Response Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/dapps/nctl-test.md This is an example of the JSON response received after successfully installing a smart contract on the NCTL network. It includes the transaction hash, which is crucial for verifying the deployment. ```json { "jsonrpc": "2.0", "id": 1294011212530641270, "result": { "api_version": "2.0.0", "transaction_hash": { "Version1": "efad4a969064b5f8189ea4d6dd2fba2926d01d583a35178c07d7b827de16789e" } } } ``` -------------------------------- ### Run the .NET SDK Example Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/dapps/sdk/csharp-sdk.md Execute the C# console application to retrieve the account balance from the Casper testnet. ```bash dotnet run ``` -------------------------------- ### Example: Calling the Auction Contract's Delegate Entry Point Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/cli/calling-contracts.md This example demonstrates calling the Auction contract's `delegate` entry point with specific validator, amount, and delegator arguments. Ensure you have the correct contract hash and account public keys. ```bash casper-client put-deploy \ --node-address http://65.21.235.219:7777 \ --chain-name casper-test \ --secret-key [KEY_PATH]/secret_key.pem \ --payment-amount 2500000000 \ --session-hash hash-93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2 \ --session-entry-point "delegate" \ --session-arg "validator:public_key='0145fb72c75e1b459839555d70356a5e6172e706efa204d86c86050e2f7878960f'" \ --session-arg "amount:u512='500000000000'" \ --session-arg "delegator:public_key='0154d828baafa6858b92919c4d78f26747430dcbecb9aa03e8b44077dc6266cabf'" ``` -------------------------------- ### Casper JSON-RPC Schema - State Get Dictionary Item Example Source: https://github.com/casper-network/docs-redux/blob/dev/condor/jsonrpc-comp/rpc-2.0/schema.json.md An example of a JSON-RPC request for `state_get_dictionary_item`. This demonstrates the structure for querying a specific item within a dictionary using its URef and item key. ```json { "id": 1, "method": "state_get_dictionary_item", "params": { "state_root_hash": "0808080808080808080808080808080808080808080808080808080808080808", "dictionary_identifier": { "URef": { "seed_uref": "uref-09480c3248ef76b603d386f3f4f8a5f87f597d4eaffd475433f861af187ab5db-007", "dictionary_item_key": "a_unique_entry_identifier" } } }, "jsonrpc": "2.0" } ``` -------------------------------- ### Start Development Server Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/dapps/template-frontend.md Runs the Vite development server to test the application locally. ```bash vite dev ``` -------------------------------- ### State Get Dictionary Item RPC Response Example Source: https://github.com/casper-network/docs-redux/blob/dev/condor/jsonrpc-comp/rpc-1.5/schema.json.md Example of a successful response from the state_get_dictionary_item RPC call. This response includes the API version, the dictionary key, the stored value, and a Merkle proof. ```json { "api_version": "1.5.6", "dictionary_key": "dictionary-67518854aa916c97d4e53df8570c8217ccc259da2721b692102d76acd0ee8d1f", "stored_value": { "CLValue": { "cl_type": "U64", "bytes": "0100000000000000", "parsed": 1 } }, "merkle_proof": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3" } ``` -------------------------------- ### Install Contract using ExecuteRequestBuilder Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/writing-onchain-code/testing-contracts.md Demonstrates how to build and execute a request to install a smart contract using standard dependencies and the counter contract. ```rust // Install the contract. let contract_v1_installation_request = ExecuteRequestBuilder::standard( *DEFAULT_ACCOUNT_ADDR, COUNTER_V1_WASM, runtime_args! {}, ) .build(); builder .exec(contract_v1_installation_request) .expect_success() .commit(); ``` -------------------------------- ### Info Get Deploy Example Source: https://github.com/casper-network/docs-redux/blob/dev/condor/jsonrpc-comp/rpc-2.0/schema.json.md Retrieves a deploy from the network using its hash. This method is deprecated in favor of `info_get_transaction`. ```json { "id": 2, "method": "info_get_deploy", "params": { "deploy_hash": "f5582cb81a5abda63ebaa4edb3b05210ecbd63ffb8dd17bfbeb3b867f4014468", "finalized_approvals": false } } ``` -------------------------------- ### Example: Query Source Account State CLI Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/cli/transfers/verify-transfer.md An example of querying the source account state with specific parameters for a testnet node. ```bash casper-client query-global-state -v \ --id 4 \ --node-address https://node.testnet.casper.network \ --state-root-hash fdb1474d441ec0fcbf2e088f1630dbf98d3bcf7f7a7fe298303797f35b8cb4e1 \ --key 0154d828baafa6858b92919c4d78f26747430dcbecb9aa03e8b44077dc6266cabf ``` -------------------------------- ### Casper JSON-RPC Schema - State Get Dictionary Item Response Example Source: https://github.com/casper-network/docs-redux/blob/dev/condor/jsonrpc-comp/rpc-2.0/schema.json.md An example JSON-RPC response for `state_get_dictionary_item`. It includes the API version, the dictionary key, the stored value, and a Merkle proof for data integrity verification. ```json { "id": 1, "result": { "api_version": "2.0.0", "dictionary_key": "a_unique_entry_identifier", "stored_value": { "CLValue": { "bytes": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3", "parsed": { "bytes": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3", "CLType": "Map", "parsed_value": { "main_purse": "uref-09480c3248ef76b603d386f3f4f8a5f87f597d4eaffd475433f861af187ab5db-007", "associated_keys": [ { "account_hash": "account-hash-e94daaff79c2ab8d9c31d9c3058d7d0a0dd31204a5638dc1451fa67b2e3fb88c", "weight": 1 } ], "action_thresholds": { "deployment": 1, "upgrade_management": 1, "key_management": 1 }, "message_topics": [ { "topic_name": "topic", "topic_name_hash": "0000000000000000000000000000000000000000000000000000000000000000" } ] } } }, "merkle_proof": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3" }, "jsonrpc": "2.0" } ``` -------------------------------- ### Set Up Casper Repository Source: https://github.com/casper-network/docs-redux/blob/dev/docs/operators/setup/install-node.md Configures the APT repository for Casper packages, including creating the keyrings directory and adding the Casper public key. ```bash sudo mkdir -m 0755 -p /etc/apt/keyrings/ sudo curl https://repo.casper.network/casper-repo-pubkey.gpg --output /etc/apt/keyrings/casper-repo-pubkey.gpg echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/casper-repo-pubkey.gpg] https://repo.casper.network/releases focal main" | sudo tee -a /etc/apt/sources.list.d/casper.list sudo apt update ``` -------------------------------- ### Sample Request for Get Entity Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/cli/querying-global-state.md An example of how to use the `get-entity` command with specific values for node address and entity identifier. ```bash casper-client get-entity \ --node-address http://localhost:11101 \ --entity-identifier entity-contract-a1d0bf9d96f3efc9ea67f627df3a7cba390bfc582956032db91060ca5d413e68 ``` -------------------------------- ### State Get Account Info RPC Example Source: https://github.com/casper-network/docs-redux/blob/dev/condor/jsonrpc-comp/rpc-2.0/schema.json.md Demonstrates how to query for an account's information using its identifier. The block identifier is optional. ```json { "name": "state_get_account_info", "summary": "returns an Account from the network", "params": [ { "name": "account_identifier", "schema": { "description": "The public key of the Account.", "$ref": "#/components/schemas/AccountIdentifier" }, "required": true }, { "name": "block_identifier", "schema": { "description": "The block identifier.", "anyOf": [ { "$ref": "#/components/schemas/BlockIdentifier" }, { "type": "null" } ] }, "required": false } ], "result": { "name": "state_get_account_info_result", "schema": { "description": "Result for \"state_get_account_info\" RPC response.", "type": "object", "required": [ "account", "api_version", "merkle_proof" ], "properties": { "api_version": { "description": "The RPC API version.", "type": "string" }, "account": { "description": "The account.", "$ref": "#/components/schemas/Account" }, "merkle_proof": { "description": "The Merkle proof.", "type": "string" } }, "additionalProperties": false } }, "examples": [ { "name": "state_get_account_info_example", "params": [ { "name": "account_identifier", "value": "013b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29" }, { "name": "block_identifier", "value": { ``` -------------------------------- ### Install casper-client Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/prerequisites.md Installs the `casper-client` binary, used for transmitting transactions to a Casper network. ```bash cargo install casper-client ``` -------------------------------- ### View Keygen Help Options Source: https://github.com/casper-network/docs-redux/blob/dev/docs/operators/setup/basic-node-configuration.md Access the help documentation for the `casper-client keygen` command to explore various options and configurations for key generation. This is useful for advanced setups or troubleshooting. ```bash sudo -u casper casper-client keygen --help ``` -------------------------------- ### Set up SSH Authorized Keys Directory Source: https://github.com/casper-network/docs-redux/blob/dev/docs/operators/setup/non-root-user.md After creating the user, switch to that user's account and create the .ssh directory with appropriate permissions and the authorized_keys file. ```bash sudo su - mkdir .ssh chmod 700 .ssh touch .ssh/authorized_keys ``` -------------------------------- ### Get Transaction Result Example Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/json-rpc/json-rpc-informational.md Retrieves the result of a specific transaction using its deploy hash. This is useful for tracking the status and outcome of deployed contracts or transfers. ```json { "method": "info_get_transaction_result", "params": { "deploy_hash": "af684263911154d26fa05be9963171802801a0b6aff8f199b7391eacb8edc9e1" }, "id": "some-id", "jsonrpc": "2.0" } ``` -------------------------------- ### Query Source Account Balance Example Source: https://github.com/casper-network/docs-redux/blob/dev/docs/developers/cli/transfers/verify-transfer.md An example of querying the balance of a source account on the testnet. This command includes verbose output. ```bash casper-client query-balance -v --id 6 \ --node-address https://node.testnet.casper.network \ --state-root-hash fdb1474d441ec0fcbf2e088f1630dbf98d3bcf7f7a7fe298303797f35b8cb4e1 \ --purse-identifier account-hash-e70dbca48c2d31bc2d754e51860ceaa8a1a49dc627b20320b0ecee1b6d9ce655 ``` -------------------------------- ### Get Era Info by Switch Block Example Source: https://github.com/casper-network/docs-redux/blob/dev/condor/jsonrpc-comp/rpc-1.5/schema.json.md Retrieves EraInfo for a specific block using chain_get_era_info_by_switch_block. The block_identifier is optional; if omitted, the latest block is used. ```json { "block_identifier": { "Hash": "13c2d7a68ecdd4b74bf4393c88915c836c863fc4bf11d7f2bd930a1bbccacdcb" } } ``` ```json { "api_version": "1.5.6", "era_summary": { "block_hash": "13c2d7a68ecdd4b74bf4393c88915c836c863fc4bf11d7f2bd930a1bbccacdcb", "era_id": 42, "stored_value": { "EraInfo": { "seigniorage_allocations": [ { "Delegator": { "delegator_public_key": "01e1b46a25baa8a5c28beb3c9cfb79b572effa04076f00befa57eb70b016153f18", "validator_public_key": "012a1732addc639ea43a89e25d3ad912e40232156dcaa4b9edfc709f43d2fb0876" } } ] } } } } ``` -------------------------------- ### Rust: Deploying Entry Point with Multiple Authorization Keys Source: https://github.com/casper-network/docs-redux/blob/dev/docs/resources/advanced/list-auth-keys-tutorial.md This snippet demonstrates invoking a contract's entry point with multiple authorization keys. It constructs a deploy item specifying the contract hash, entry point, payment, and a list of authorization keys. Use this when the caller's deploy needs to be signed by multiple authorized accounts. ```rust let entry_point_deploy_item = DeployItemBuilder::new() .with_empty_payment_bytes(runtime_args! {ARG_AMOUNT => *DEFAULT_PAYMENT}) .with_authorization_keys(&[account_addr_1, *DEFAULT_ACCOUNT_ADDR]) .with_address(account_addr_1) .with_stored_session_hash(contract_hash, ENTRYPOINT, runtime_args! {}) .build(); let entry_point_request = ExecuteRequestBuilder::from_deploy_item(entry_point_deploy_item).build(); builder.exec(entry_point_request).expect_success().commit(); ```