Method: Hive::Broadcast.witness_update

Defined in:
lib/hive/broadcast.rb

.witness_update(options, &block) ⇒ Object

Users who wish to become a witness must pay a fee acceptable to the current witnesses to apply for the position and allow voting to begin.

options = {
  wif: wif,
  params: {
    owner: ,
    url: '',
    block_signing_key: 'STM8ZSyzjPm48GmUuMSRufkVYkwYbZzbxeMysAVp7KFQwbTf98TcG',
    props: {
      account_creation_fee: '0.000 HIVE',
      maximum_block_size: 131072,
      hbd_interest_rate:1000
    },
    fee: '0.000 HIVE',
  }
}

Hive::Broadcast.witness_update(options)

Parameters:

  • options (Hash)

    options

Options Hash (options):

  • :wif (String)

    Active wif

  • :params (Hash)
    • :owner (String)

    • :url (String) (optional)

    • :block_signing_key (String)

    • :props (String)

    • :fee (String)

  • :pretend (Boolean)

    Just validate, do not broadcast.

See Also:



667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/hive/broadcast.rb', line 667

def self.witness_update(options, &block)
  required_fields = %i(owner block_signing_key props fee)
  params = options[:params]
  check_required_fields(params, *required_fields)
  
   = params[:props][:account_creation_fee] rescue nil
  params[:props][:account_creation_fee] = normalize_amount(options.merge amount: )
  params[:fee] = normalize_amount(options.merge amount: params[:fee])
  
  ops = [[:witness_update, params]]
  
  process(options.merge(ops: ops), &block)
end