decred.org/dcrdex@v1.0.3/dex/networks/firo/params.go (about) 1 // This code is available on the terms of the project LICENSE.md file, 2 // also available online at https://blueoakcouncil.org 3 4 package firo 5 6 import ( 7 "decred.org/dcrdex/dex" 8 "decred.org/dcrdex/dex/networks/btc" 9 "github.com/btcsuite/btcd/chaincfg" 10 "github.com/btcsuite/btcd/chaincfg/chainhash" 11 ) 12 13 const ( 14 DefaultFee = 1 // 0.00001000 FIRO/kB 15 DefaultFeeRateLimit = 20 // 0.00020000 FIRO/kB 16 ) 17 18 // Firo v0.14.12.1 defaults: 19 // -fallbackfee= (default: 20000) wallet.h: DEFAULT_FALLBACK_FEE unused afaics 20 // -mintxfee= (default: 1000) for tx creation 21 // -maxtxfee= (default: 1000000000) 10 FIRO .. also looks unused 22 // -minrelaytxfee= (default: 1000) 0.00001 firo, 23 // -blockmintxfee= (default: 1000) 24 25 func mustHash(hash string) *chainhash.Hash { 26 h, err := chainhash.NewHashFromStr(hash) 27 if err != nil { 28 panic(err.Error()) 29 } 30 return h 31 } 32 33 var ( 34 UnitInfo = dex.UnitInfo{ 35 AtomicUnit: "Sats", 36 Conventional: dex.Denomination{ 37 Unit: "FIRO", 38 ConversionFactor: 1e8, 39 }, 40 Alternatives: []dex.Denomination{ 41 { 42 Unit: "mFIRO", 43 ConversionFactor: 1e5, 44 }, 45 { 46 Unit: "µFIRO", 47 ConversionFactor: 1e2, 48 }, 49 }, 50 FeeRateDenom: "B", 51 } 52 53 // MainNetParams are the clone parameters for mainnet. 54 MainNetParams = btc.ReadCloneParams(&btc.CloneParams{ 55 Name: "mainnet", 56 PubKeyHashAddrID: 0x52, // 82 - start with 'a' & occasionally 'Z' 57 ScriptHashAddrID: 0x07, // 07 - start with 3 or 4 58 Bech32HRPSegwit: "", // no segwit 59 CoinbaseMaturity: 100, 60 Net: 0xe3d9fef1, 61 GenesisHash: mustHash("4381deb85b1b2c9843c222944b616d997516dcbd6a964e1eaf0def0830695233"), 62 }) 63 // TestNetParams are the clone parameters for testnet. 64 TestNetParams = btc.ReadCloneParams(&btc.CloneParams{ 65 Name: "testnet3", 66 PubKeyHashAddrID: 0x41, // 65 - start with T 67 ScriptHashAddrID: 0xb2, // 178 - start with 2 68 Bech32HRPSegwit: "", // no segwit 69 CoinbaseMaturity: 100, 70 Net: 0xcffcbeea, 71 GenesisHash: mustHash("aa22adcc12becaf436027ffe62a8fb21b234c58c23865291e5dc52cf53f64fca"), 72 }) 73 // RegressionNetParams are the clone parameters for simnet. 74 RegressionNetParams = btc.ReadCloneParams(&btc.CloneParams{ 75 Name: "regtest", 76 PubKeyHashAddrID: 0x41, // 65 - start with T 77 ScriptHashAddrID: 0xb2, // 178 - start with 2 78 Bech32HRPSegwit: "", // no segwit 79 CoinbaseMaturity: 100, 80 // Net is not the standard for Firo simnet, since they never changed it 81 // from the BTC regtest value: 0xfabfb5da 82 // The only place we currently use Net is in btcd/chaincfg.Register, 83 // where it is checked to prevent duplicate registration, so our only 84 // requirement is that it is unique. This one was just generated with a prng. 85 Net: 0x7da7d6db, 86 GenesisHash: mustHash("a42b98f04cc2916e8adfb5d9db8a2227c4629bc205748ed2f33180b636ee885b"), 87 }) 88 ) 89 90 func init() { 91 for _, params := range []*chaincfg.Params{MainNetParams, TestNetParams, RegressionNetParams} { 92 err := chaincfg.Register(params) 93 if err != nil { 94 panic("failed to register firo parameters: " + err.Error()) 95 } 96 } 97 }