AIXChain Blockchain Document
  • INTRODUCTION
    • Getting started with smart contract development
    • Build a Decentralized Library
  • AIXC AND ARC TOKEN
    • ARC
      • ARX Transfer
      • Query ARX balance
    • ARC-10
      • Issue ARC-10 token
      • Participate ARC-10
      • ARC-10 Transfer
      • Query ARC-10 balance
      • ARC-10 Transfer in Smart Contracts
    • ARC-20
      • Protocol Interface
      • Contract Example
      • Issuing ARC-20 tokens tutorial
    • ARC-721
      • Protocol Interface
      • Contract Example
  • ACCOUNT MODEL
  • BUILD NODE
    • How to setup a Super node to produce Blocks
      • Recommended configuration & Environment
      • Example cloud services
      • Deployment guide
    • Super Representative
      • How to become a SR
      • Super Representatives Election
      • How to change witness name
  • HTTP API
    • Introduction
    • API Signature and Broadcast Flow
    • API List
      • Full Node API Overview
      • Address Utilities
        • GenerateAddress
        • CreateAddress
        • ValidateAddress
      • Accounts
        • CreateAccount
        • GetAccount
        • UpdateAccount
        • AccountPermissionUpdate
        • GetAccountBalance
      • Account Resources
        • GetAccountResource
        • GetAccountNet
        • FreezeBalance
        • UnfreezeBalance
        • GetDelegatedResource
        • GetDelegatedResourceAccountIndex
      • Query the Network
        • GetBlockByNum
        • GetBlockById
        • GetBlockByLatestNum
        • GetBlockByLimitNext
        • GetNowBlock
        • GetTransactionById
        • GetTransactionInfoById
        • GetTransactionInfoByBlockNum
        • ListNodes
        • GetNodeInfo
        • GetChainParameters
        • GetBlockBalance
      • ARC10 Token
        • GetAssetIssueByAccount
        • GetAssetIssueById
        • GetAssetIssueList
        • GetPaginatedAssetIssueList
        • TransferAsset
        • CreateAssetIssue
        • UnfreezeAsset
        • UpdateAsset
      • Transactions
        • GetContract
        • GetTransactionSign
        • BroadcastTransaction
        • BroadcastHex
        • EasyTransfer
        • EasyTransferByPrivate
        • CreateTransaction
      • Voting & SRs
        • ListWitnesses
        • CreateWitness
        • UpdateWitness
        • GetBrokerage
        • UpdateBrokerage
        • VoteWitnessAccount
        • GetReward
        • WithdrawBalance
        • GetNextMaintenanceTime
      • Smart Contracts
        • TriggerSmartContract
        • DeployContract
        • UpdateSetting
        • UpdateEnergyLimit
        • ClearAbi
        • GetContract
        • TriggerConstantContract
      • Proposals
      • Solidity Node API
    • RPC List
  • AIXCHAIN CLI
  • Aixchain SDK
    • Quickstart
    • Address and Signature
    • Sending Transaction
    • Smart Contract
  • Faucet Aixchain
  • Wallets
Powered by GitBook
On this page
  1. HTTP API
  2. API List
  3. Voting & SRs

VoteWitnessAccount

POST: http://172.104.51.182:16667/wallet/votewitnessaccount

PreviousUpdateBrokerageNextGetReward

Last updated 29 days ago

Vote for witnesses

BODY PARAMS {

owner_address string

votes array of objects

visible boolean (Optional)

permission_id int32 (Optional)

}

Note:

  • owner address is transaction creator address, in hex string format.

  • votes is 'vote_address' stands for the address of the witness you want to vote, default hexString, 'vote_count' stands for the number of votes you want to vote.

  • visible: whether the address is in base58check format.

  • permission_id, whether the address is in base58 format.

Example:

curl --request POST --url --header 'Accept: application/json' --header 'Content-Type: application/json' --data ' { "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "votes": [ { "vote_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "vote_count": "0" } ] }

Input:

{

"owner_address": "414203485a535a4072C9FBFaADDfe2A010AD0BcdB0",

"votes":

[

{ "vote_address": "412588712Fb3C470587350640e90265ff02af9c1e2", "vote_count": 2 } ]

}

Response:

{

"visible": false, "txID": "24f412c2b45ecf038450df4df518fa57985d8312d82fd086e3d81ad0a8fe1dea", "raw_data": { "contract": [ { "parameter": { "value": { "owner_address": "414203485a535a4072c9fbfaaddfe2a010ad0bcdb0", "votes": [ { "vote_address": "412588712fb3c470587350640e90265ff02af9c1e2", "vote_count": 2 } ] }, "type_url": "type.googleapis.com/protocol.VoteWitnessContract" }, "type": "VoteWitnessContract" } ], "ref_block_bytes": "ece7", "ref_block_hash": "62ae1e9517669514", "expiration": 1640076456000, "timestamp": 1640076397714 }, "raw_data_hex": "0a02ece7220862ae1e951766951440c0e0b2e1dd2f5a6a080412660a30747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e566f74655769746e657373436f6e747261637412320a15414203485a535a4072c9fbfaaddfe2a010ad0bcdb012190a15412588712fb3c470587350640e90265ff02af9c1e21002709299afe1dd2f"

}

==> Continue you call gettransactionsign API then call broadcasttransaction API

We will the final result: The transaction created success on AIXChain network.

{"result":true,"txid":"24f412c2b45ecf038450df4df518fa57985d8312d82fd086e3d81ad0a8fe1dea"}

http://172.104.51.182:16667/wallet/votewitnessaccount