Blockchain Management

This is a dump of email messages. We need to create a formal how-to for taking care of blockchain.

 

Here's what's needed to start geth again. We need to add this to something so if the server restarts it does this:

cd private-ethereum/

sudo nohup geth --datadir myDataDir --syncmode 'full' --port 30303 --rpc --rpcaddr '0.0.0.0' --rpcport 8501 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --networkid 808 --gasprice '1' --unlock '0x4531572DF3a913203f58808290d3F9F40F8bb2a7' --password .nodepw --mine   --rpccorsdomain '*' --allow-insecure-unlock 

I've put this into /etc/init.d/geth-start

++++++++++++++++++++++++++++++++++

Once you’re in.. this is to run GETH to start it.

cd private-ethereum/

sudo nohup geth --datadir myDataDir --syncmode 'full' --port 30303 --rpc --rpcaddr '0.0.0.0' --rpcport 8501 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --networkid 808 --gasprice '1' --unlock '0x4531572DF3a913203f58808290d3F9F40F8bb2a7' --password .nodepw --mine   --rpccorsdomain '*' --allow-insecure-unlock 

You should be submitting hashes from the pre-funded accounts (e.g. the 0xf2ee...3650 wallet we've used on Remix), not from the sealer's account. The gas price of 1 just means 1 wei (1 / 10**18 ETH). It's really low and therefore should basically never run out for any of your pre-funded wallets which have billions of ETH each. Note that we use 1 wei instead of 0 to avoid possible transaction spam from anyone else who might connect and try to submit transactions without a funded wallet.

++++++++++++++++++++++++++++++++++

Hopefully this isn't too long..

It wasn't easy, but this is finally up and running stable. Obstacles were getting the ETH back into the accounts that process transactions, sending transactions from admin accounts only (or the entry would get revoked) and the correct account based on what's running on GETH, account in add_entry_onbehalf needs to be sent from an authorized signer. 

Needless to say, I'm happy it's finally up and running stable. I've done a bunch of different transaction tests.

How it works (simple terms)

When a user uploads a document, it's added to the blockchain server by a hash. Every time you refresh the report page, it checks the hash against the one on the server. If it doesn't match, it would be an X. When it does, it shows a checkmark. 

Testing It:

Here's how you can test it. Test on Admin first please. It works on both but the instructions are a little different to test. 

1) If you log into petsmart admin, it creates an account on the blockchain server (since you don't have one already).

2) You can then upload a document in any form (example form below)

https://petsmart.auditmachine.com/auditprotocol/view.php?id=154176

 3) Once it's uploaded it will then be scheduled to be added to the blockchain. 

(You can get here by clicking "Document Log" in users)

(Here's Mine)

https://petsmart.auditmachine.com/auditprotocol/uploaded_document_log.php?user_id=MjE=&is_portal=0

You can see it as pending.

For now, just run the URL below. It will return an entry ID but you don't need it. 

IMPORTANT

After you have a pending, Click This, this is what will be in the cron: https://petsmart.auditmachine.com/auditprotocol//run_all_cron.php?c=blockchain&is_portal=0 

(This part will be on a schedule but for debugging we'll do it this time)

So if I was to delete the file off the audit server, or change the file on the audit server in any way, it will become an X instead since it can't find that hash on the blockchain.

Let me know when you do some of the top , and I can check on our end to make sure it's working correctly.

++++++++++++++++++++++++++++++++++

Firewall Rules

TCP 8501 between Server IP and BlockChain Server IP (ingress and egress rules)

TCP 8545 between Server IP and BlockChain Server IP (ingress and egress rules)

TCP 9545 between Server IP and BlockChain Server IP (ingress and egress rules)

TCP 30303 between Server IP and BlockChain Server IP (ingress and egress rules)