Skip to main content

Transactional JSON-RPC Method


account_put_deploy

This is the only means by which users can send their compiled Wasm (as part of a Deploy) to a node on a Casper network. The request takes in the Deploy as a parameter, prior to sending it to a node on a network for execution.

ParameterTypeDescription
deployObjectA Deploy consists of an item containing a smart contract along with the requester's signature(s).

Note: You can find a list of trusted peers in the network's configuration file, config.toml. Here is an example config.toml. You may send deploys to one of the trusted nodes or use them to query other online nodes.

account_put_deploy_result

The result contains the deploy_hash, which is the primary identifier of a Deploy within a Casper network.

ParameterTypeDescription
api_versionStringThe RPC API version.
deploy_hashStringA hex-encoded hash of the Deploy as sent.
Example account_put_deploy

{
"name": "account_put_deploy_example",
"params": [
{
"name": "deploy",
"value": {
"approvals": [
{
"signature": "012dbf03817a51794a8e19e0724884075e6d1fbec326b766ecfa6658b41f81290da85e23b24e88b1c8d9761185c961daee1adab0649912a6477bcd2e69bd91bd08",
"signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c"
}
],
"hash": "5c9b3b099c1378aa8e4a5f07f59ff1fcdc69a83179427c7e67ae0377d94d93fa",
"header": {
"account": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c",
"body_hash": "d53cf72d17278fd47d399013ca389c50d589352f1a12593c0b8e01872a641b50",
"chain_name": "casper-example",
"dependencies": [
"0101010101010101010101010101010101010101010101010101010101010101"
],
"gas_price": 1,
"timestamp": "2020-11-17T00:39:24.072Z",
"ttl": "1h"
},
"payment": {
"StoredContractByName": {
"args": [
[
"amount",
{
"bytes": "e8030000",
"cl_type": "I32",
"parsed": 1000
}
]
],
"entry_point": "example-entry-point",
"name": "casper-example"
}
},
"session": {
"Transfer": {
"args": [
[
"amount",
{
"bytes": "e8030000",
"cl_type": "I32",
"parsed": 1000
}
]
]
}
}
}
}
],
"result": {
"name": "account_put_deploy_example_result",
"value": {
"api_version": "1.4.4",
"deploy_hash": "5c9b3b099c1378aa8e4a5f07f59ff1fcdc69a83179427c7e67ae0377d94d93fa"
}
}
}