jl777 8 years ago
parent
commit
274168c496
  1. 20
      README.md
  2. 8
      iguana/iguana_notary.c
  3. 2
      iguana/tests/notaryinit

20
README.md

@ -156,3 +156,23 @@ once jsoncmp is built, then ./test shows how to use it
the idea is to issue a curl command into a /tmp/file and then use jsoncmp to verify the exact value of one or more fields. it will print to stdout JSON with "error" or "result" and to stderr if there is an error
##### ../agents/iguana notary
Here are some preliminary instructions for iguana dPoW support:
0. Install and start ../agents/iguana add any coin via coins/genbtcd or coins/basilisk
1. Create an iguana wallet with encryptwallet if you dont already have one:
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"use high entropy passphrase that generates the pubkey\"}"
2. Create an executable (chmod +x) file "SuperNET/iguana/wp" with the following in it:
curl --url "http://127.0.0.1:7778" --data "{\"method\":\"walletpassphrase\",\"params\":[\"same passphrase as above\", 9999999]}"
Now from SuperNET/iguana if you run ./wp it will show the various addresses including "btcpubkey" which is your notary pubkey. Post this in #notarynode if you havent already.
3. create a text file SuperNET/iguana/myip.txt with just your ip address in it:
12.34.56.78
The ipaddress is only used for registering notary node and not directly correlated with your pubkey.
4. copy SuperNET/iguana/coins/btc btc_7776 kmd and kmd_7776 up one directory to SuperNET/iguana and edit "path" to match your home directory. if your home directory is /home/username then \"path\":\"home/username\"
5. make a copy of SuperNET/iguana/wp -> SuperNET/iguana/wp_7776 and change port 7778 to port 7776

8
iguana/iguana_notary.c

@ -726,10 +726,16 @@ void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,s
for (i=DPOW_FIFOSIZE-1; i>0; i--)
{
if ( (offset= (tip.blockhash.height - fifo[i].blockhash.height)) >= 0 && offset < DPOW_FIFOSIZE )
{
printf("[offset %d = (%d - %d)] <- i.%d\n",offset,tip.blockhash.height,fifo[i].blockhash.height,i);
newfifo[offset] = fifo[i];
}
}
newfifo[0] = tip;
memcpy(fifo,newfifo,sizeof(newfifo));
for (i=0; i<DPOW_FIFOSIZE; i++)
printf("%d ",bits256_nonz(fifo[i].blockhash.hash));
printf(" <- fifo\n");
}
void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *checkpoint,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
@ -743,8 +749,8 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che
void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
{
void **ptrs;
printf("%s srcupdate ht.%d destupdated.%u nonz.%d\n",dp->symbol,height,dp->destupdated,bits256_nonz(dp->srcfifo[dp->srcconfirms].blockhash.hash));
dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime);
printf("%s srcupdate ht.%d destupdated.%u nonz.%d %llx\n",dp->symbol,height,dp->destupdated,bits256_nonz(dp->srcfifo[dp->srcconfirms].blockhash.hash),(long long)dp->last.blockhash.hash.txid);
dpow_fifoupdate(myinfo,dp->srcfifo,dp->last);
if ( dp->destupdated != 0 && bits256_nonz(dp->srcfifo[dp->srcconfirms].blockhash.hash) != 0 )
{

2
iguana/tests/notaryinit

@ -6,7 +6,7 @@ coins/gennotary
tests/addnotarys_7776
tests/getinfoN_7776
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"$myip\"}"
./wp
./wp_7776
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"activehandle\"}"
./btc_7776
./kmd_7776

Loading…
Cancel
Save