# Get started with Casper
---
## Task 1: Create and deploy a simple, smart contract with cargo casper and cargo test
Start all nodes on Virtual Environment
![](https://i.imgur.com/R7jthA2.png)
Deploying the Contract
![](https://i.imgur.com/LK2NpwR.png)
Check deploy status
![](https://i.imgur.com/D30ljJZ.png)
## Task 2: Complete one of the existing tutorials for writing smart contracts
**Multi-Signature Tutorial was choose.**
Run the Client by ***atomic***
```
(env) root@virtual-machine-57383-vps-eu:~/keys-manager/client# npm run start:atomic
> keys-manager@1.0.0 start:atomic
> node -r dotenv/config ./src/scenario-atomic.js
0.1 Fund main account.
Signed by: account-hash-7c6b454bcf90ffda2a67a19800e3d33883f11be56ef5a603721dda28116a935a
Deploy hash: 1db9e448d669c874f2df96c34a9f24deabe933ca3ee3812bb645f5cb2c096d05
Deploy result:
{
deploy: {
hash: '1db9e448d669c874f2df96c34a9f24deabe933ca3ee3812bb645f5cb2c096d05',
header: {
account: '01c8c5ebc6e496897e2875375076a577b68a667f14b047c89a678a7fa59e6b6b9b',
timestamp: '2021-09-22T16:22:26.854Z',
ttl: '30m',
gas_price: 1,
body_hash: '2f97ed341b0bccaa9271ebb31a9253c7440eac18459b7b0e0a1af96c0fc59768',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { Transfer: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
[x]0.2 Install Keys Manager contract
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: 8bb3cc2b24ba0329bcef5260a4700b737dc54710986bb67e41b702d1a56dc351
Deploy result:
{
deploy: {
hash: '8bb3cc2b24ba0329bcef5260a4700b737dc54710986bb67e41b702d1a56dc351',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:23:31.199Z',
ttl: '30m',
gas_price: 1,
body_hash: '8b75c87f0c5c33503df86050553e6a490fdee8d5154d9eececdc7c22618217c8',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { ModuleBytes: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
1. Set faucet's weight to 3
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: d02eac403c021459366f5da01c993d09b6bbf66eb6cb53fe709baa60535f8003
Deploy result:
{
deploy: {
hash: 'd02eac403c021459366f5da01c993d09b6bbf66eb6cb53fe709baa60535f8003',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:24:37.630Z',
ttl: '30m',
gas_price: 1,
body_hash: '68202b10fef1445329aceeed4b093777f3adbeaca67e7e0549af274e062367a0',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
2. Set Keys Management Threshold to 3
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: 4ab9d8cd45afb9d3f98b195e69b55f553354ddb689882cdad9833e1d9b42cc7f
Deploy result:
{
deploy: {
hash: '4ab9d8cd45afb9d3f98b195e69b55f553354ddb689882cdad9833e1d9b42cc7f',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:25:42.559Z',
ttl: '30m',
gas_price: 1,
body_hash: '3f3394304ff22fe422511e62eed631bc501385f67fdd1fe71891f7d375550324',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
}
],
actionThresholds: { deployment: 1, keyManagement: 3 }
}
3. Set Deploy Threshold to 2.
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: 59a7fc5f9763866aef7059ab5a10b469ab0cde580869889409ef9ea1421e99f5
Deploy result:
{
deploy: {
hash: '59a7fc5f9763866aef7059ab5a10b469ab0cde580869889409ef9ea1421e99f5',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:26:48.562Z',
ttl: '30m',
gas_price: 1,
body_hash: '609e820d1eb41cd0fe90e6c5c4cf179afd2c9d9ba19bb0f21ca310a85450f228',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
}
],
actionThresholds: { deployment: 2, keyManagement: 3 }
}
4. Add first new key with weight 1.
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: ff3f54dfed0c373bffe17a33740ff4193739177421c6a3ed2fada8ee5cfe66e5
Deploy result:
{
deploy: {
hash: 'ff3f54dfed0c373bffe17a33740ff4193739177421c6a3ed2fada8ee5cfe66e5',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:27:53.571Z',
ttl: '30m',
gas_price: 1,
body_hash: 'a6a5e5963e574604fa4afc2d6d50d9f5fd78ad506c9ae7280e8ee17807c2d703',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-a2dee374b053ba43eaf76b0cfa484dc7df25d922f64113b514d94f3e039907c8',
weight: 1
},
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
}
],
actionThresholds: { deployment: 2, keyManagement: 3 }
}
5. Add second new key with weight 1.
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: 7d78e350bb693cf12020eb9d56adf1b445c8125e51ca81812f4d858831139496
Deploy result:
{
deploy: {
hash: '7d78e350bb693cf12020eb9d56adf1b445c8125e51ca81812f4d858831139496',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:28:58.410Z',
ttl: '30m',
gas_price: 1,
body_hash: '684e20b90f1f8594611547788b22e8e3ff96a71b601922d6a5b68767f9d94625',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-a2dee374b053ba43eaf76b0cfa484dc7df25d922f64113b514d94f3e039907c8',
weight: 1
},
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
},
{
accountHash: 'account-hash-daf6d526fbe78aebe2f3be5013b100827e03d1d4b2b29a53944bae0a02510cf4',
weight: 1
}
],
actionThresholds: { deployment: 2, keyManagement: 3 }
}
6. Make a transfer from faucet using the new accounts.
Signed by: account-hash-a2dee374b053ba43eaf76b0cfa484dc7df25d922f64113b514d94f3e039907c8
Signed by: account-hash-daf6d526fbe78aebe2f3be5013b100827e03d1d4b2b29a53944bae0a02510cf4
Deploy hash: 6acdc52f36db8c5edca5aee4c30298eac6acc733fc72f60622009b00609f33af
Deploy result:
{
deploy: {
hash: '6acdc52f36db8c5edca5aee4c30298eac6acc733fc72f60622009b00609f33af',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:30:03.451Z',
ttl: '30m',
gas_price: 1,
body_hash: 'a3896d73a8e872ba47ff3041708782d7859063012b2dc8c1033e2656a8929331',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { Transfer: [Object] },
approvals: [ [Object], [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-a2dee374b053ba43eaf76b0cfa484dc7df25d922f64113b514d94f3e039907c8',
weight: 1
},
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
},
{
accountHash: 'account-hash-daf6d526fbe78aebe2f3be5013b100827e03d1d4b2b29a53944bae0a02510cf4',
weight: 1
}
],
actionThresholds: { deployment: 2, keyManagement: 3 }
}
7. Remove the first account
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: 52868da236c135866fbf1b22b0bdf1d10e0021a13e3ae92c27e9b43a6d160a03
Deploy result:
{
deploy: {
hash: '52868da236c135866fbf1b22b0bdf1d10e0021a13e3ae92c27e9b43a6d160a03',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:31:09.377Z',
ttl: '30m',
gas_price: 1,
body_hash: '2ec51bfec7ec48f0147fc1c69cfb8312c867c8d0d268069ac30d535702e88816',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
},
{
accountHash: 'account-hash-daf6d526fbe78aebe2f3be5013b100827e03d1d4b2b29a53944bae0a02510cf4',
weight: 1
}
],
actionThresholds: { deployment: 2, keyManagement: 3 }
}
8. Remove the second account
Signed by: account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f
Deploy hash: ffec85d0a6fe9fa4264cc064036a68c6166e393a35bc0c296bf78eb00ceb9520
Deploy result:
{
deploy: {
hash: 'ffec85d0a6fe9fa4264cc064036a68c6166e393a35bc0c296bf78eb00ceb9520',
header: {
account: '0202215217aa453bc70871641642bbd08cbe193c028072a3b79988705624a205857c',
timestamp: '2021-09-22T16:32:14.209Z',
ttl: '30m',
gas_price: 1,
body_hash: 'e019c5ddc46c1f63ddb1ccbb75cfd8816ee69f2071f09157683b5016132dd209',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-13a9238f637efa15be658c196c186894f13e21ecad36d03ddae86e7b5a586bb6'
},
{
name: 'keys_manager_hash',
key: 'uref-6f8371e71d0becd6170a45d5be34e5065f09a4a2136882c8db14cde8b9a5d544-007'
}
],
mainPurse: 'uref-4f900e3d31f75533f0f5e28cb973e05130620feb70ff13337f54298f9da8b1fd-007',
associatedKeys: [
{
accountHash: 'account-hash-b41e0d598f028f0374cf31195df879e29a9a3faffe90d29fa1b032b708600f6f',
weight: 3
}
],
actionThresholds: { deployment: 2, keyManagement: 3 }
}
```
## Task 3: Demonstrate key management concepts
**Scenario 1: signing transactions with a single key was choose**
Create a code script adapt with scenario 1 as below:
```
const keyManager = require("./key-manager");
const TRANSFER_AMOUNT = process.env.TRANSFER_AMOUNT || 2500000000;
(async function () {
// 1. Set mainAccount's weight to 1.
// 2. Set Keys Management Threshold to 1.
// 3. Set Deploy Threshold to 1.
let deploy;
// 0. Initial state of the account.
// There should be only one associated key (fuacet) with weight 1.
// Deployment Threshold should be set to 1.
// Key Management Threshold should be set to 1.
let masterKey = keyManager.randomMasterKey();
let mainAccount = masterKey.deriveIndex(1);
console.log("\n0.1 Fund main account.\n");
await keyManager.fundAccount(mainAccount);
await keyManager.printAccount(mainAccount);
console.log("\n[x]0.2 Install Keys Manager contract");
deploy = keyManager.keys.buildContractInstallDeploy(mainAccount);
await keyManager.sendDeploy(deploy, [mainAccount]);
await keyManager.printAccount(mainAccount);
// 1. Set mainAccount's weight to 1
console.log("\n1. Set faucet's weight to 1\n");
deploy = keyManager.keys.setKeyWeightDeploy(mainAccount, mainAccount, 1);
await keyManager.sendDeploy(deploy, [mainAccount]);
await keyManager.printAccount(mainAccount);
// 2. Set Keys Management Threshold to 1.
console.log("\n2. Set Keys Management Threshold to 1\n");
deploy = keyManager.keys.setKeyManagementThresholdDeploy(mainAccount, 1);
await keyManager.sendDeploy(deploy, [mainAccount]);
await keyManager.printAccount(mainAccount);
// 3. Set Deploy Threshold to 1.
console.log("\n3. Set Deploy Threshold to 1.\n");
deploy = keyManager.keys.setDeploymentThresholdDeploy(mainAccount, 1);
await keyManager.sendDeploy(deploy, [mainAccount]);
await keyManager.printAccount(mainAccount);
})();
```
Modify *package.json* for add the link to scenario 1 as below
```
{
"name": "keys-manager",
"version": "1.0.0",
"description": "Examples using casper-client-sdk",
"scripts": {
"start:atomic": "node -r dotenv/config ./src/scenario-atomic.js",
"start:all": "node -r dotenv/config ./src/scenario-all.js",
"start:scenario_1": "node -r dotenv/config ./src/scenario_1.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"dependencies": {
"casper-js-sdk": "^2.0.0",
"dotenv": "^10.0.0"
}
}
```
Run the code script:
```
root@virtual-machine-57383-vps-eu:~/keys-manager/client# npm run start:scenario_1
> keys-manager@1.0.0 start:scenario_1
> node -r dotenv/config ./src/scenario_1.js
0.1 Fund main account.
Signed by: account-hash-7c6b454bcf90ffda2a67a19800e3d33883f11be56ef5a603721dda28116a935a
Deploy hash: 8e5f8a6f27d9c3ca89c7931e389301efa51c69fce3d7fe51e7ef09b9510bb814
Deploy result:
{
deploy: {
hash: '8e5f8a6f27d9c3ca89c7931e389301efa51c69fce3d7fe51e7ef09b9510bb814',
header: {
account: '01c8c5ebc6e496897e2875375076a577b68a667f14b047c89a678a7fa59e6b6b9b',
timestamp: '2021-09-22T16:28:49.334Z',
ttl: '30m',
gas_price: 1,
body_hash: '968986486c1fd83ec31488207ed58d08b5c7ea264e8f4d3b631bcc4ed275de63',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { Transfer: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
namedKeys: [],
mainPurse: 'uref-c9734b40ca55810b8cb4ec67005344ac38a7307ef9ea4b1ca9a04d72170949ac-007',
associatedKeys: [
{
accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
[x]0.2 Install Keys Manager contract
Signed by: account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a
Deploy hash: 1b6848bdfa8009189d54b90ac3406ec80b36ac397fa37abfccc6e34d1c74efbd
Deploy result:
{
deploy: {
hash: '1b6848bdfa8009189d54b90ac3406ec80b36ac397fa37abfccc6e34d1c74efbd',
header: {
account: '020244c893aa258b1552b0acdd43c50d8ca263dd958b48fd078e9b8c90e2be3f9334',
timestamp: '2021-09-22T16:29:55.661Z',
ttl: '30m',
gas_price: 1,
body_hash: '8b75c87f0c5c33503df86050553e6a490fdee8d5154d9eececdc7c22618217c8',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { ModuleBytes: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-a6d388a09cddc337f766d49c30a26ec1b8e5f347d5418f3ae648cffdced3a3ac'
},
{
name: 'keys_manager_hash',
key: 'uref-dede21950c9baf81137d5ea92818f94f8242b65c4fa513eb1860444091d3532e-007'
}
],
mainPurse: 'uref-c9734b40ca55810b8cb4ec67005344ac38a7307ef9ea4b1ca9a04d72170949ac-007',
associatedKeys: [
{
accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
1. Set faucet's weight to 1
Signed by: account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a
Deploy hash: b74dcb4d490b56524269041d0dbce99f81ee3b92f68f92276d76cb639afebdbf
Deploy result:
{
deploy: {
hash: 'b74dcb4d490b56524269041d0dbce99f81ee3b92f68f92276d76cb639afebdbf',
header: {
account: '020244c893aa258b1552b0acdd43c50d8ca263dd958b48fd078e9b8c90e2be3f9334',
timestamp: '2021-09-22T16:31:05.957Z',
ttl: '30m',
gas_price: 1,
body_hash: 'b6d163099b7b1580c0aed57d5857c2521cdcc0e98d0c3370cd1830e5855878af',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-a6d388a09cddc337f766d49c30a26ec1b8e5f347d5418f3ae648cffdced3a3ac'
},
{
name: 'keys_manager_hash',
key: 'uref-dede21950c9baf81137d5ea92818f94f8242b65c4fa513eb1860444091d3532e-007'
}
],
mainPurse: 'uref-c9734b40ca55810b8cb4ec67005344ac38a7307ef9ea4b1ca9a04d72170949ac-007',
associatedKeys: [
{
accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
2. Set Keys Management Threshold to 1
Signed by: account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a
Deploy hash: 6765af4cb72bba35188f12cd92d38c85500d04790edb979f67d69050578b515f
Deploy result:
{
deploy: {
hash: '6765af4cb72bba35188f12cd92d38c85500d04790edb979f67d69050578b515f',
header: {
account: '020244c893aa258b1552b0acdd43c50d8ca263dd958b48fd078e9b8c90e2be3f9334',
timestamp: '2021-09-22T16:32:11.972Z',
ttl: '30m',
gas_price: 1,
body_hash: 'fcbeef2291716fba37f9f05b6883b80e5985a3e7ccdd8e779cca24912b24871b',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-a6d388a09cddc337f766d49c30a26ec1b8e5f347d5418f3ae648cffdced3a3ac'
},
{
name: 'keys_manager_hash',
key: 'uref-dede21950c9baf81137d5ea92818f94f8242b65c4fa513eb1860444091d3532e-007'
}
],
mainPurse: 'uref-c9734b40ca55810b8cb4ec67005344ac38a7307ef9ea4b1ca9a04d72170949ac-007',
associatedKeys: [
{
accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
3. Set Deploy Threshold to 1.
Signed by: account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a
Deploy hash: 07330de87b3bd46f6b7fc4027410ecb1c45709f8dd595df653332452ddc3e119
Deploy result:
{
deploy: {
hash: '07330de87b3bd46f6b7fc4027410ecb1c45709f8dd595df653332452ddc3e119',
header: {
account: '020244c893aa258b1552b0acdd43c50d8ca263dd958b48fd078e9b8c90e2be3f9334',
timestamp: '2021-09-22T16:33:16.955Z',
ttl: '30m',
gas_price: 1,
body_hash: '4807b024a8e1e7c7d1da5a9101a21f38303d4689905d88d4585eec852fd7216b',
dependencies: [],
chain_name: 'casper-net-1'
},
payment: { ModuleBytes: [Object] },
session: { StoredContractByName: [Object] },
approvals: [ [Object] ]
}
}
[x] Current state of the account:
{
_accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
namedKeys: [
{
name: 'keys_manager',
key: 'hash-a6d388a09cddc337f766d49c30a26ec1b8e5f347d5418f3ae648cffdced3a3ac'
},
{
name: 'keys_manager_hash',
key: 'uref-dede21950c9baf81137d5ea92818f94f8242b65c4fa513eb1860444091d3532e-007'
}
],
mainPurse: 'uref-c9734b40ca55810b8cb4ec67005344ac38a7307ef9ea4b1ca9a04d72170949ac-007',
associatedKeys: [
{
accountHash: 'account-hash-210551ae5bc84ac2ba62e727816c1609671003bffb44baabd704a76261a8e80a',
weight: 1
}
],
actionThresholds: { deployment: 1, keyManagement: 1 }
}
```
## Task 4: Learn to transfer tokens to an account on the Casper Testnet
![](https://i.imgur.com/he8Z0gn.png)
And
![](https://i.imgur.com/pcIUjMn.png)
## Task 5: Learn to Delegate and Undelegate on the Casper Testnet
**Learn to Delegate**
![](https://i.imgur.com/Dg4XmRl.png)
**Learn to Undelegate**
![](https://i.imgur.com/EmHGTMg.png)