Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
destream-blockchain
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
destream-blockchain
Commits
c27aa6b4
Commit
c27aa6b4
authored
Oct 29, 2018
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor mainnet settings
parent
de60a0c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
32 deletions
+32
-32
DeStream.Networks.cs
Sources/NBitcoin/DeStream.Networks.cs
+30
-30
DeStreamMain.cs
Sources/NBitcoin/Networks/DeStreamMain.cs
+2
-2
No files found.
Sources/NBitcoin/DeStream.Networks.cs
View file @
c27aa6b4
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net
;
using
NBitcoin.BouncyCastle.Math
;
using
NBitcoin.DataEncoders
;
using
NBitcoin.DataEncoders
;
using
NBitcoin.Networks
;
using
NBitcoin.Protocol
;
namespace
NBitcoin
{
public
partial
class
Network
{
/// <summary> The name of the root folder containing the different Stratis blockchains (StratisMain, StratisTest, StratisRegTest). </summary>
public
const
string
DeStreamRootFolderName
=
"destream"
;
/// <summary>
/// The name of the root folder containing the different Stratis blockchains (StratisMain, StratisTest,
/// StratisRegTest).
/// </summary>
protected
const
string
DeStreamRootFolderName
=
"destream"
;
/// <summary> The default name used for the Stratis configuration file. </summary>
p
ublic
const
string
DeStreamDefaultConfigFilename
=
"destream.conf"
;
p
rotected
const
string
DeStreamDefaultConfigFilename
=
"destream.conf"
;
p
ublic
const
int
Stratis
MaxTimeOffsetSeconds
=
25
*
60
;
p
rotected
const
int
DeStream
MaxTimeOffsetSeconds
=
25
*
60
;
p
ublic
const
int
Stratis
DefaultMaxTipAgeInSeconds
=
2
*
60
*
60
;
p
rotected
const
int
DeStream
DefaultMaxTipAgeInSeconds
=
2
*
60
*
60
;
public
const
string
WalletAddressDeStreamMain
=
"TPPL2wmtxGzP8U6hQsGkRA9yCMsazB33ft"
;
public
static
Network
DeStreamMain
=>
NetworksContainer
.
GetNetwork
(
"DeStreamMain"
)
??
NetworksContainer
.
Register
(
new
DeStreamMain
());
public
static
Network
DeStreamMain
=>
NetworksContainer
.
GetNetwork
(
"DeStreamMain"
)
??
NetworksContainer
.
Register
(
new
DeStreamMain
());
public
static
Network
DeStreamTest
=>
NetworksContainer
.
GetNetwork
(
"DeStreamTest"
)
??
NetworksContainer
.
Register
(
new
DeStreamTest
());
public
static
Network
DeStreamTest
=>
NetworksContainer
.
GetNetwork
(
"DeStreamTest"
)
??
NetworksContainer
.
Register
(
new
DeStreamTest
());
public
static
Network
DeStreamRegTest
=>
NetworksContainer
.
GetNetwork
(
"DeStreamRegTest"
)
??
NetworksContainer
.
Register
(
new
DeStreamRegTest
());
public
static
Network
DeStreamRegTest
=>
NetworksContainer
.
GetNetwork
(
"DeStreamRegTest"
)
??
NetworksContainer
.
Register
(
new
DeStreamRegTest
());
internal
static
Block
CreateStratisGenesisBlock
(
ConsensusFactory
consensusFactory
,
uint
nTime
,
uint
nNonce
,
uint
nBits
,
int
nVersion
,
Money
genesisReward
)
internal
static
Block
CreateStratisGenesisBlock
(
ConsensusFactory
consensusFactory
,
uint
nTime
,
uint
nNonce
,
uint
nBits
,
int
nVersion
,
Money
genesisReward
)
{
string
pszTimestamp
=
"http://www.theonion.com/article/olympics-head-priestess-slits-throat-official-rio--53466"
;
return
CreateStratisGenesisBlock
(
consensusFactory
,
pszTimestamp
,
nTime
,
nNonce
,
nBits
,
nVersion
,
genesisReward
);
string
pszTimestamp
=
"http://www.theonion.com/article/olympics-head-priestess-slits-throat-official-rio--53466"
;
return
CreateStratisGenesisBlock
(
consensusFactory
,
pszTimestamp
,
nTime
,
nNonce
,
nBits
,
nVersion
,
genesisReward
);
}
internal
static
Block
CreateStratisGenesisBlock
(
ConsensusFactory
consensusFactory
,
string
pszTimestamp
,
uint
nTime
,
uint
nNonce
,
uint
nBits
,
int
nVersion
,
Money
genesisReward
)
private
static
Block
CreateStratisGenesisBlock
(
ConsensusFactory
consensusFactory
,
string
pszTimestamp
,
uint
nTime
,
uint
nNonce
,
uint
nBits
,
int
nVersion
,
Money
genesisReward
)
{
Transaction
txNew
=
consensusFactory
.
CreateTransaction
();
txNew
.
Version
=
1
;
txNew
.
Time
=
nTime
;
txNew
.
AddInput
(
new
TxIn
()
txNew
.
AddInput
(
new
TxIn
{
ScriptSig
=
new
Script
(
Op
.
GetPushOp
(
0
),
new
Op
()
ScriptSig
=
new
Script
(
Op
.
GetPushOp
(
0
),
new
Op
{
Code
=
(
OpcodeType
)
0x1
,
PushData
=
new
[]
{
(
byte
)
42
}
Code
=
(
OpcodeType
)
0x1
,
PushData
=
new
[]
{
(
byte
)
42
}
},
Op
.
GetPushOp
(
Encoders
.
ASCII
.
DecodeData
(
pszTimestamp
)))
});
txNew
.
AddOutput
(
new
TxOut
()
txNew
.
AddOutput
(
new
TxOut
{
Value
=
genesisReward
,
Value
=
genesisReward
});
Block
genesis
=
consensusFactory
.
CreateBlock
();
genesis
.
Header
.
BlockTime
=
Utils
.
UnixTimeToDateTime
(
nTime
);
...
...
@@ -66,6 +67,5 @@ namespace NBitcoin
genesis
.
UpdateMerkleRoot
();
return
genesis
;
}
}
}
}
\ No newline at end of file
Sources/NBitcoin/Networks/DeStreamMain.cs
View file @
c27aa6b4
...
...
@@ -81,8 +81,8 @@ namespace NBitcoin.Networks
this
.
MinTxFee
=
10000
;
this
.
FallbackFee
=
60000
;
this
.
MinRelayTxFee
=
10000
;
this
.
MaxTimeOffsetSeconds
=
Stratis
MaxTimeOffsetSeconds
;
this
.
MaxTipAge
=
Stratis
DefaultMaxTipAgeInSeconds
;
this
.
MaxTimeOffsetSeconds
=
DeStream
MaxTimeOffsetSeconds
;
this
.
MaxTipAge
=
DeStream
DefaultMaxTipAgeInSeconds
;
this
.
CoinTicker
=
"DST"
;
this
.
Consensus
.
SubsidyHalvingInterval
=
210000
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment