Class: Tapyrus::ChainParams

Inherits:
Object
  • Object
show all
Defined in:
lib/tapyrus/chain_params.rb

Overview

Network parameter class

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#address_versionObject (readonly)

Returns the value of attribute address_version.



9
10
11
# File 'lib/tapyrus/chain_params.rb', line 9

def address_version
  @address_version
end

#bip34_heightObject (readonly)

Returns the value of attribute bip34_height.



31
32
33
# File 'lib/tapyrus/chain_params.rb', line 31

def bip34_height
  @bip34_height
end

#bip44_coin_typeObject (readonly)

Returns the value of attribute bip44_coin_type.



34
35
36
# File 'lib/tapyrus/chain_params.rb', line 34

def bip44_coin_type
  @bip44_coin_type
end

#bip49_privkey_p2wpkh_p2sh_versionObject (readonly)

Returns the value of attribute bip49_privkey_p2wpkh_p2sh_version.



17
18
19
# File 'lib/tapyrus/chain_params.rb', line 17

def bip49_privkey_p2wpkh_p2sh_version
  @bip49_privkey_p2wpkh_p2sh_version
end

#bip49_privkey_p2wsh_p2sh_versionObject (readonly)

Returns the value of attribute bip49_privkey_p2wsh_p2sh_version.



19
20
21
# File 'lib/tapyrus/chain_params.rb', line 19

def bip49_privkey_p2wsh_p2sh_version
  @bip49_privkey_p2wsh_p2sh_version
end

#bip49_pubkey_p2wpkh_p2sh_versionObject (readonly)

Returns the value of attribute bip49_pubkey_p2wpkh_p2sh_version.



16
17
18
# File 'lib/tapyrus/chain_params.rb', line 16

def bip49_pubkey_p2wpkh_p2sh_version
  @bip49_pubkey_p2wpkh_p2sh_version
end

#bip49_pubkey_p2wsh_p2sh_versionObject (readonly)

Returns the value of attribute bip49_pubkey_p2wsh_p2sh_version.



18
19
20
# File 'lib/tapyrus/chain_params.rb', line 18

def bip49_pubkey_p2wsh_p2sh_version
  @bip49_pubkey_p2wsh_p2sh_version
end

#bip84_privkey_p2wpkh_versionObject (readonly)

Returns the value of attribute bip84_privkey_p2wpkh_version.



21
22
23
# File 'lib/tapyrus/chain_params.rb', line 21

def bip84_privkey_p2wpkh_version
  @bip84_privkey_p2wpkh_version
end

#bip84_privkey_p2wsh_versionObject (readonly)

Returns the value of attribute bip84_privkey_p2wsh_version.



23
24
25
# File 'lib/tapyrus/chain_params.rb', line 23

def bip84_privkey_p2wsh_version
  @bip84_privkey_p2wsh_version
end

#bip84_pubkey_p2wpkh_versionObject (readonly)

Returns the value of attribute bip84_pubkey_p2wpkh_version.



20
21
22
# File 'lib/tapyrus/chain_params.rb', line 20

def bip84_pubkey_p2wpkh_version
  @bip84_pubkey_p2wpkh_version
end

#bip84_pubkey_p2wsh_versionObject (readonly)

Returns the value of attribute bip84_pubkey_p2wsh_version.



22
23
24
# File 'lib/tapyrus/chain_params.rb', line 22

def bip84_pubkey_p2wsh_version
  @bip84_pubkey_p2wsh_version
end

#cp2pkh_versionObject (readonly)

Returns the value of attribute cp2pkh_version.



11
12
13
# File 'lib/tapyrus/chain_params.rb', line 11

def cp2pkh_version
  @cp2pkh_version
end

#cp2sh_versionObject (readonly)

Returns the value of attribute cp2sh_version.



12
13
14
# File 'lib/tapyrus/chain_params.rb', line 12

def cp2sh_version
  @cp2sh_version
end

#default_portObject (readonly)

Returns the value of attribute default_port.



24
25
26
# File 'lib/tapyrus/chain_params.rb', line 24

def default_port
  @default_port
end

#dns_seedsObject (readonly)

Returns the value of attribute dns_seeds.



33
34
35
# File 'lib/tapyrus/chain_params.rb', line 33

def dns_seeds
  @dns_seeds
end

#dust_relay_feeObject

Returns the value of attribute dust_relay_fee.



36
37
38
# File 'lib/tapyrus/chain_params.rb', line 36

def dust_relay_fee
  @dust_relay_fee
end

#extended_privkey_versionObject (readonly)

Returns the value of attribute extended_privkey_version.



14
15
16
# File 'lib/tapyrus/chain_params.rb', line 14

def extended_privkey_version
  @extended_privkey_version
end

#extended_pubkey_versionObject (readonly)

Returns the value of attribute extended_pubkey_version.



15
16
17
# File 'lib/tapyrus/chain_params.rb', line 15

def extended_pubkey_version
  @extended_pubkey_version
end

#magic_headObject (readonly)

Returns the value of attribute magic_head.



7
8
9
# File 'lib/tapyrus/chain_params.rb', line 7

def magic_head
  @magic_head
end

#max_moneyObject (readonly)

Returns the value of attribute max_money.



30
31
32
# File 'lib/tapyrus/chain_params.rb', line 30

def max_money
  @max_money
end

#message_magicObject (readonly)

Returns the value of attribute message_magic.



8
9
10
# File 'lib/tapyrus/chain_params.rb', line 8

def message_magic
  @message_magic
end

#networkObject (readonly)

Returns the value of attribute network.



6
7
8
# File 'lib/tapyrus/chain_params.rb', line 6

def network
  @network
end

#p2sh_versionObject (readonly)

Returns the value of attribute p2sh_version.



10
11
12
# File 'lib/tapyrus/chain_params.rb', line 10

def p2sh_version
  @p2sh_version
end

#privkey_versionObject (readonly)

Returns the value of attribute privkey_version.



13
14
15
# File 'lib/tapyrus/chain_params.rb', line 13

def privkey_version
  @privkey_version
end

#proof_of_work_limitObject (readonly)

Returns the value of attribute proof_of_work_limit.



32
33
34
# File 'lib/tapyrus/chain_params.rb', line 32

def proof_of_work_limit
  @proof_of_work_limit
end

#protocol_versionObject (readonly)

Returns the value of attribute protocol_version.



26
27
28
# File 'lib/tapyrus/chain_params.rb', line 26

def protocol_version
  @protocol_version
end

#retarget_intervalObject (readonly)

Returns the value of attribute retarget_interval.



27
28
29
# File 'lib/tapyrus/chain_params.rb', line 27

def retarget_interval
  @retarget_interval
end

#retarget_timeObject (readonly)

Returns the value of attribute retarget_time.



28
29
30
# File 'lib/tapyrus/chain_params.rb', line 28

def retarget_time
  @retarget_time
end

#rpc_portObject (readonly)

Returns the value of attribute rpc_port.



25
26
27
# File 'lib/tapyrus/chain_params.rb', line 25

def rpc_port
  @rpc_port
end

#target_spacingObject (readonly)

Returns the value of attribute target_spacing.



29
30
31
# File 'lib/tapyrus/chain_params.rb', line 29

def target_spacing
  @target_spacing
end

Class Method Details

.devObject

development genesis



44
45
46
# File 'lib/tapyrus/chain_params.rb', line 44

def self.dev
  init("dev")
end

.prodObject

production genesis



39
40
41
# File 'lib/tapyrus/chain_params.rb', line 39

def self.prod
  init("prod")
end

Instance Method Details

#dev?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/tapyrus/chain_params.rb', line 52

def dev?
  network == "dev"
end

#prod?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/tapyrus/chain_params.rb', line 48

def prod?
  network == "prod"
end