--- /dev/null
+# This is a TOML config file.
+# For more information, see https://github.com/toml-lang/toml
+fast_sync = true
+db_backend = "leveldb"
+api_addr = "0.0.0.0:8888"
+chain_id = "solonet"
+[p2p]
+laddr = "tcp://0.0.0.0:56658"
+seeds = ""
return nil
}
dpos.Authorize(config.CommonConfig.Consensus.Dpos.Coinbase)
- /*
- for index, xpub := range consensus.ActiveNetParams.SignBlockXPubs {
- pubHash := crypto.Ripemd160(xpub.PublicKey())
- address, _ := common.NewPeginAddressWitnessScriptHash(pubHash, &consensus.ActiveNetParams)
- control, _ := vmutil.P2WPKHProgram([]byte(pubHash))
- //key := hex.EncodeToString(control)
- //authoritys[key] = xpub.String()
- authoritys[address.EncodeAddress()] = xpub.String()
- if accountManager.IsLocalControlProgram(control) {
- position = uint64(index)
- dpos.Authorize(address.EncodeAddress())
- }
- }
- */
- //c.SetAuthoritys(authoritys)
- //c.SetPosition(position)
c.SetConsensusEngine(dpos)
ConsensusEngine = dpos
return &Miner{
consensus.ActiveNetParams.FedpegXPubs = federationRedeemXPubs
}
- if config.Side.SignBlockXPubs != "" {
- var signBlockXPubs []chainkd.XPub
- xPubs := strings.Split(config.Side.SignBlockXPubs, ",")
- for _, xpubStr := range xPubs {
- var xpub chainkd.XPub
- xpub.UnmarshalText([]byte(xpubStr))
- signBlockXPubs = append(signBlockXPubs, xpub)
- }
- consensus.ActiveNetParams.SignBlockXPubs = signBlockXPubs
- }
-
consensus.ActiveNetParams.Signer = config.Signer
consensus.ActiveNetParams.PeginMinDepth = config.Side.PeginMinDepth
consensus.ActiveNetParams.ParentGenesisBlockHash = config.Side.ParentGenesisBlockHash
if err := json.NewDecoder(file).Decode(config); err != nil {
cmn.Exit(cmn.Fmt("invalid consensus file: %v", err))
}
+
for _, v := range config.Consensus.Dpos.SelfVoteSigners {
address, err := common.DecodeAddress(v, &consensus.ActiveNetParams)
if err != nil {
--- /dev/null
+{
+ "consensus":{
+ "dpos": {
+ "period": 1,
+ "epoch": 300,
+ "maxSignersCount": 1,
+ "minVoterBalance": 0,
+ "genesisTimestamp": 1524549600,
+ "coinbase": "vsm1qkm743xmgnvh84pmjchq2s4tnfpgu9ae2f9slep",
+ "xprv": "a8e281b615809046698fb0b0f2804a36d824d48fa443350f10f1b80649d39e5f1e85cf9855548915e36137345910606cbc8e7dd8497c831dce899ee6ac112445",
+ "signers": [
+ "vsm1qkm743xmgnvh84pmjchq2s4tnfpgu9ae2f9slep"
+ ]
+ }
+ }
+}
\ No newline at end of file
if [ ! -f "key_pair" ];then
./vapor init --chain_id solonet -r "side_chain"
-nohup ./vapor node -r "side_chain" > /dev/null &
+nohup ./vapor node -r "side_chain" --consensus_config_file consensus.json > /dev/null &
sleep 30
curl -s -X POST -d '{}' http://127.0.0.1:8888/create-key-pair >> key_pair
ps -ef | grep vapor | grep -v grep | awk '{print $2}' |xargs kill -9
sleep 50
./vapor init --chain_id solonet -r "side_chain"
-nohup ./vapor node -r "side_chain" --auth.disable --side.fedpeg_xpubs $xpub --side.sign_block_xpubs $xpub --signer $xprv --validate_pegin true --side.parent_genesis_block_hash "a97a7a59e0e313f9300a2d7296336303889930bfdf5a80d8a9b05db343c03380" > /dev/null &
+nohup ./vapor node -r "side_chain" --auth.disable --side.fedpeg_xpubs $xpub --consensus_config_file consensus.json --validate_pegin true --side.parent_genesis_block_hash "a97a7a59e0e313f9300a2d7296336303889930bfdf5a80d8a9b05db343c03380" > /dev/null &
sleep 30
virtualenv --no-site-packages venv
source venv/bin/activate
touch install
fi
-nohup python manager.py runserver -p 8000 -h 0.0.0.0 > /dev/null &
+nohup python manager.py runserver -p 8080 -h 0.0.0.0 > /dev/null &
sleep 30
-cd web
-nohup python -m SimpleHTTPServer 8080 > /dev/null &
+#cd web
+#nohup python -m SimpleHTTPServer 8080 > /dev/null &