contract command. Uploading contracts, deploying contracts, and invoking them. Each of these are different types of transactions, which must be signed and submitted to the network (and in the case of contract related transactions simulated first).
Technically these three are different operations, of which a transaction can contain up to 100 operations. However, in the case of contract related operations a transaction is limited to just one.
So for all other transactions the CLI provides the tx subcommands. These are:
newsignsendsimulate
tx new
For the following examples we will use the following accounts:
Create Account
Creates and funds a new Stellar account. Abovealice was funded by friendbot. However, bob and charlie were not. So we can use the create-account command to fund them.
bob will receive 10 XLM and charlie will get 1 XLM.
--starting-balance: Initial balance in stroops to fund the account with (1 XLM = 10,000,000 stroops)
Payment
bob feels bad that charlie only got 1 XLM, so they will send 4 more XLM to charlie.
--asset: The asset to send - either “native” for XLM or “CODE:ISSUER” format for other assets
Bump Sequence
Bump an account’s sequence number forward:Account Merge
Merge one account into another, transferring all XLM.bob decides to continue spreading the wealth and merges their account into charlie’s.
--source: The account to remove from the ledger, thus this is its final tranaction
Set Trustline Flags
Modify authorization flags on a trustline:--source: The issuing account setting the flags (must be the asset issuer)--asset: The asset in CODE:ISSUER format--trustor: The account whose trustline flags to modify--set-authorize: Enable full authorization--set-authorize-to-maintain-liabilities: Enable limited authorization--set-trustline-clawback-enabled: Enable clawback for this trustline--clear-*: Corresponding clear flags to remove each setting
Set Options
Configure account settings:--source: Account to modify settings for--inflation-dest: Set inflation destination account--home-domain: Set home domain for federation/compliance--master-weight: Weight of the account’s master key (0-255)--low-threshold: Weight threshold for low security operations--med-threshold: Weight threshold for medium security operations--high-threshold: Weight threshold for high security operations--signer: Add a new signer public key--signer-weight: Weight for the new signer (0 removes the signer)--set-required: Enable requiring authorization for new trustlines--set-revocable: Enable revoking of trustlines--set-clawback-enabled: Enable clawback for asset issuing account--set-immutable: Make account settings immutable--clear-*: Corresponding clear flags to remove each setting
Change Trust
Create or modify a trustline:--source: Account creating/modifying the trustline--line: Asset to create trustline for in CODE:ISSUER format--limit: Maximum amount that can be held (0 removes trustline)
Manage Data
Manage account data entries:--data-name: Name of the data entry (up to 64 bytes)--data-value: Hex encoded value to store (up to 64 bytes, omit to delete)