var img = document.createElement('img'); img.src = "https://terradocs.matomo.cloud//piwik.php?idsite=1&rec=1&url=https://docs.terra.money" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

terrad tx interchain-accounts host generate-packet-data

This command accepts a message string and serializes it into packet data which is outputted to stdout. It can be used in conjunction with send-tx which submits pre-built packet data containing messages to be executed on the host chain.

Usage

Terrad
Copy

_1
terrad tx interchain-accounts host generate-packet-data [message] [flags]

Examples

Terrad
Copy

_33
terrad tx interchain-accounts host generate-packet-data '{
_33
"@type":"/cosmos.bank.v1beta1.MsgSend",
_33
"from_address":"cosmos15ccshhmp0gsx29qpqq6g4zmltnnvgmyu9ueuadh9y2nc5zj0szls5gtddz",
_33
"to_address":"cosmos10h9stc5v6ntgeygf5xf945njqq5h32r53uquvw",
_33
"amount": [
_33
{
_33
"denom": "stake",
_33
"amount": "1000"
_33
}
_33
]
_33
}' --memo memo
_33
_33
_33
terrad tx interchain-accounts host generate-packet-data '[{
_33
"@type":"/cosmos.bank.v1beta1.MsgSend",
_33
"from_address":"cosmos15ccshhmp0gsx29qpqq6g4zmltnnvgmyu9ueuadh9y2nc5zj0szls5gtddz",
_33
"to_address":"cosmos10h9stc5v6ntgeygf5xf945njqq5h32r53uquvw",
_33
"amount": [
_33
{
_33
"denom": "stake",
_33
"amount": "1000"
_33
}
_33
]
_33
},
_33
{
_33
"@type": "/cosmos.staking.v1beta1.MsgDelegate",
_33
"delegator_address": "cosmos15ccshhmp0gsx29qpqq6g4zmltnnvgmyu9ueuadh9y2nc5zj0szls5gtddz",
_33
"validator_address": "cosmosvaloper1qnk2n4nlkpw9xfqntladh74w6ujtulwnmxnh3k",
_33
"amount": {
_33
"denom": "stake",
_33
"amount": "1000"
_33
}
_33
}]'

Options

Terrad
Copy

_3
Flags:
_3
-h, --help help for generate-packet-data
_3
--memo string an optional memo to be included in the interchain account packet data

Options inherited from parent commands

Terrad
Copy

_6
Global Flags:
_6
--chain-id string The network chain ID
_6
--home string directory for config and data (default "/Users/.terra")
_6
--log_format string The logging format (json|plain) (default "plain")
_6
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
_6
--trace print out full stack trace on errors