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
Show 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
NBitcoin.DataEncoders
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net
;
using
NBitcoin.BouncyCastle.Math
;
using
NBitcoin.DataEncoders
;
using
NBitcoin.Networks
;
using
NBitcoin.Networks
;
using
NBitcoin.Protocol
;
namespace
NBitcoin
namespace
NBitcoin
{
{
public
partial
class
Network
public
partial
class
Network
{
{
/// <summary>
/// The name of the root folder containing the different Stratis blockchains (StratisMain, StratisTest,
/// <summary> The name of the root folder containing the different Stratis blockchains (StratisMain, StratisTest, StratisRegTest). </summary>
/// StratisRegTest).
public
const
string
DeStreamRootFolderName
=
"destream"
;
/// </summary>
protected
const
string
DeStreamRootFolderName
=
"destream"
;
/// <summary> The default name used for the Stratis configuration file. </summary>
/// <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"
;
public
const
int
StratisMaxTimeOffsetSeconds
=
25
*
60
;
protected
const
int
DeStreamMaxTimeOffsetSeconds
=
25
*
60
;
public
const
int
StratisDefaultMaxTipAgeInSeconds
=
2
*
60
*
60
;
protected
const
int
DeStreamDefaultMaxTipAgeInSeconds
=
2
*
60
*
60
;
public
const
string
WalletAddressDeStreamMain
=
"TPPL2wmtxGzP8U6hQsGkRA9yCMsazB33ft"
;
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"
;
string
pszTimestamp
=
return
CreateStratisGenesisBlock
(
consensusFactory
,
pszTimestamp
,
nTime
,
nNonce
,
nBits
,
nVersion
,
genesisReward
);
"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
();
Transaction
txNew
=
consensusFactory
.
CreateTransaction
();
txNew
.
Version
=
1
;
txNew
.
Version
=
1
;
txNew
.
Time
=
nTime
;
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
,
Code
=
(
OpcodeType
)
0x1
,
PushData
=
new
[]
{
(
byte
)
42
}
PushData
=
new
[]
{
(
byte
)
42
}
},
Op
.
GetPushOp
(
Encoders
.
ASCII
.
DecodeData
(
pszTimestamp
)))
},
Op
.
GetPushOp
(
Encoders
.
ASCII
.
DecodeData
(
pszTimestamp
)))
});
});
txNew
.
AddOutput
(
new
TxOut
()
txNew
.
AddOutput
(
new
TxOut
{
{
Value
=
genesisReward
,
Value
=
genesisReward
});
});
Block
genesis
=
consensusFactory
.
CreateBlock
();
Block
genesis
=
consensusFactory
.
CreateBlock
();
genesis
.
Header
.
BlockTime
=
Utils
.
UnixTimeToDateTime
(
nTime
);
genesis
.
Header
.
BlockTime
=
Utils
.
UnixTimeToDateTime
(
nTime
);
...
@@ -66,6 +67,5 @@ namespace NBitcoin
...
@@ -66,6 +67,5 @@ namespace NBitcoin
genesis
.
UpdateMerkleRoot
();
genesis
.
UpdateMerkleRoot
();
return
genesis
;
return
genesis
;
}
}
}
}
}
}
\ No newline at end of file
Sources/NBitcoin/Networks/DeStreamMain.cs
View file @
c27aa6b4
...
@@ -81,8 +81,8 @@ namespace NBitcoin.Networks
...
@@ -81,8 +81,8 @@ namespace NBitcoin.Networks
this
.
MinTxFee
=
10000
;
this
.
MinTxFee
=
10000
;
this
.
FallbackFee
=
60000
;
this
.
FallbackFee
=
60000
;
this
.
MinRelayTxFee
=
10000
;
this
.
MinRelayTxFee
=
10000
;
this
.
MaxTimeOffsetSeconds
=
Stratis
MaxTimeOffsetSeconds
;
this
.
MaxTimeOffsetSeconds
=
DeStream
MaxTimeOffsetSeconds
;
this
.
MaxTipAge
=
Stratis
DefaultMaxTipAgeInSeconds
;
this
.
MaxTipAge
=
DeStream
DefaultMaxTipAgeInSeconds
;
this
.
CoinTicker
=
"DST"
;
this
.
CoinTicker
=
"DST"
;
this
.
Consensus
.
SubsidyHalvingInterval
=
210000
;
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