Skip to content

Commit

Permalink
Merge pull request jl777#78 from jl777/dPoW
Browse files Browse the repository at this point in the history
DPoW
  • Loading branch information
jl777 authored Dec 4, 2016
2 parents 1d9ea45 + ba9104d commit b0ab045
Show file tree
Hide file tree
Showing 44 changed files with 1,804 additions and 878 deletions.
61 changes: 61 additions & 0 deletions src/assetchains
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#!/bin/bash
set -x
source pubkey.txt
echo $pubkey

./komodod -pubkey=$pubkey -ac_name=REVS -ac_supply=1300000 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=PANGEA -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=JUMBLR -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=BET -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=SHARK -ac_supply=1401 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 &

./komodod -pubkey=$pubkey -ac_name=USD -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=EUR -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=JPY -addnode=78.47.196.146 $1 &
Expand Down Expand Up @@ -33,3 +47,50 @@ echo $pubkey
./komodod -pubkey=$pubkey -ac_name=BGN -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=IDR -addnode=78.47.196.146 $1 &
./komodod -pubkey=$pubkey -ac_name=HRK -addnode=78.47.196.146 $1 &

curl --url "http://127.0.0.1:7776" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"REVS\",\"pubkey\":\"$pubkey\"}"

curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SUPERNET\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"DEX\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PANGEA\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"JUMBLR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BET\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CRYPTO\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HODL\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SHARK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BOTS\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MGW\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"EUR\",\"pubkey\":\"$pubkey\"}"

curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"JPY\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"GBP\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"AUD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CAD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CHF\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NZD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CNY\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RUB\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MXN\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BRL\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"INR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HKD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"TRY\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ZAR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PLN\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NOK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SEK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"DKK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CZK\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HUF\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ILS\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KRW\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MYR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PHP\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RON\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SGD\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"THB\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BGN\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"IDR\",\"pubkey\":\"$pubkey\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HRK\",\"pubkey\":\"$pubkey\"}"

34 changes: 34 additions & 0 deletions src/assetfunds
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -x
./komodo-cli paxdeposit $1 0.01 aud
./komodo-cli paxdeposit $1 0.01 bgn
./komodo-cli paxdeposit $1 0.01 cad
./komodo-cli paxdeposit $1 0.01 chf
./komodo-cli paxdeposit $1 0.01 cny
./komodo-cli paxdeposit $1 0.01 czk
./komodo-cli paxdeposit $1 0.01 dkk
./komodo-cli paxdeposit $1 0.01 eur
./komodo-cli paxdeposit $1 0.01 gbp
./komodo-cli paxdeposit $1 0.01 hkd
./komodo-cli paxdeposit $1 0.01 hrk
./komodo-cli paxdeposit $1 0.01 huf
./komodo-cli paxdeposit $1 0.01 idr
./komodo-cli paxdeposit $1 0.01 ils
./komodo-cli paxdeposit $1 0.01 inr
./komodo-cli paxdeposit $1 0.01 jpy
./komodo-cli paxdeposit $1 0.01 krw
./komodo-cli paxdeposit $1 0.01 mxn
./komodo-cli paxdeposit $1 0.01 myr
./komodo-cli paxdeposit $1 0.01 nok
./komodo-cli paxdeposit $1 0.01 nzd
./komodo-cli paxdeposit $1 0.01 php
./komodo-cli paxdeposit $1 0.01 pln
./komodo-cli paxdeposit $1 0.01 brl
./komodo-cli paxdeposit $1 0.01 ron
./komodo-cli paxdeposit $1 0.01 rub
./komodo-cli paxdeposit $1 0.01 sek
./komodo-cli paxdeposit $1 0.01 sgd
./komodo-cli paxdeposit $1 0.01 thb
./komodo-cli paxdeposit $1 0.01 try
./komodo-cli paxdeposit $1 0.01 usd
./komodo-cli paxdeposit $1 0.01 zar
2 changes: 1 addition & 1 deletion src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CConnectionFailed : public std::runtime_error
#include "cJSON.c"
#include "komodo_notary.h"

void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t notaryid,uint256 txhash,uint64_t voutmask,uint8_t numvouts,uint32_t *pvals,uint8_t numpvals,int32_t KMDheight,uint64_t opretvalue,uint8_t *opretbuf,uint16_t opretlen,uint16_t vout)
void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t notaryid,uint256 txhash,uint64_t voutmask,uint8_t numvouts,uint32_t *pvals,uint8_t numpvals,int32_t KMDheight,uint32_t KMDtimestamp,uint64_t opretvalue,uint8_t *opretbuf,uint16_t opretlen,uint16_t vout)
{

}
Expand Down
16 changes: 6 additions & 10 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@

static bool fDaemon;
extern char ASSETCHAINS_SYMBOL[16];
void komodo_gateway_iteration(char *symbol);
void komodo_iteration(char *symbol);
int32_t komodo_is_issuer();
void komodo_passport_iteration();

void WaitForShutdown(boost::thread_group* threadGroup)
{
Expand All @@ -44,10 +42,7 @@ void WaitForShutdown(boost::thread_group* threadGroup)
while (!fShutdown)
{
MilliSleep(10000);
if ( komodo_is_issuer() != 0 )
komodo_gateway_iteration(ASSETCHAINS_SYMBOL);
else komodo_iteration((char *)"EUR");

komodo_passport_iteration();
fShutdown = ShutdownRequested();
}
if (threadGroup)
Expand All @@ -64,6 +59,7 @@ void WaitForShutdown(boost::thread_group* threadGroup)
extern int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,ASSETCHAIN_INIT;
extern std::string NOTARY_PUBKEY;
int32_t komodo_is_issuer();
void komodo_passport_iteration();

bool AppInit(int argc, char* argv[])
{
Expand Down Expand Up @@ -106,10 +102,11 @@ bool AppInit(int argc, char* argv[])
fprintf(stderr,"call komodo_args NOTARY_PUBKEY.(%s)\n",NOTARY_PUBKEY.c_str());
while ( ASSETCHAIN_INIT == 0 )
{
if ( komodo_is_issuer() != 0 )
komodo_gateway_iteration(ASSETCHAINS_SYMBOL);
//if ( komodo_is_issuer() != 0 )
// komodo_passport_iteration();
sleep(1);
}
printf("initialized %s\n",ASSETCHAINS_SYMBOL);
if (!boost::filesystem::is_directory(GetDataDir(false)))
{
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
Expand Down Expand Up @@ -144,7 +141,6 @@ bool AppInit(int argc, char* argv[])
fDaemon = GetBoolArg("-daemon", false);
if (fDaemon)
{
extern char ASSETCHAINS_SYMBOL[16];
fprintf(stdout, "Komodo %s server starting\n",ASSETCHAINS_SYMBOL);

// Daemonize
Expand Down
2 changes: 2 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class CMainParams : public CChainParams {
assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("komodoplatform.com", "seeds.komodoplatform.com")); // @kolo
vSeeds.push_back(CDNSSeedData("komodo.mewhub.com", "seeds.komodo.mewhub.com")); // @kolo
// TODO: set up bootstrapping for mainnet
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,60);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,85);
Expand Down
12 changes: 12 additions & 0 deletions src/fiat-cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
#set -x
echo aud; fiat/aud $1 $2 $3 $4
echo bgn; fiat/bgn $1 $2 $3 $4
echo cad; fiat/cad $1 $2 $3 $4
Expand Down Expand Up @@ -31,3 +32,14 @@ echo thb; fiat/thb $1 $2 $3 $4
echo try; fiat/try $1 $2 $3 $4
echo usd; fiat/usd $1 $2 $3 $4
echo zar; fiat/zar $1 $2 $3 $4
echo revs; fiat/revs $1 $2 $3 $4
echo supernet; fiat/supernet $1 $2 $3 $4
echo dex; fiat/dex $1 $2 $3 $4
echo pangea; fiat/pangea $1 $2 $3 $4
echo jumblr; fiat/jumblr $1 $2 $3 $4
echo bet; fiat/bet $1 $2 $3 $4
echo crypto; fiat/crypto $1 $2 $3 $4
echo hodl; fiat/hodl $1 $2 $3 $4
echo shark; fiat/shark $1 $2 $3 $4
echo bots; fiat/bots $1 $2 $3 $4
echo mgw; fiat/mgw $1 $2 $3 $4
3 changes: 0 additions & 3 deletions src/fiat/_usd

This file was deleted.

2 changes: 2 additions & 0 deletions src/fiat/bet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=BET $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/bots
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=BOTS $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/crypto
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=CRYPTO $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/dex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=DEX $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/hodl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=HODL $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/jumblr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=JUMBLR $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/mgw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=MGW $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/pangea
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=PANGEA $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=REVS $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/shark
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=SHARK $1 $2 $3 $4
2 changes: 2 additions & 0 deletions src/fiat/supernet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./komodo-cli -ac_name=SUPERNET $1 $2 $3 $4
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// first suggest a reindex
if (!fReset) {
bool fRet = uiInterface.ThreadSafeMessageBox(
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"),
strLoadError + ".\n\n" + _("error in HDD data, might just need to update to latest, if that doesnt work, then you need to resync"),
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);
if (fRet) {
fReindex = true;
Expand Down
Loading

0 comments on commit b0ab045

Please sign in to comment.