diff --git a/README.md b/README.md index 75803eef4520b2deaf4a59a68fb53f9b5bead06c..e2b78e86fe3789a3180088cbeda21b15f1a5b5ff 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,15 @@ 2. `sudo apt install jq ncurses-bin` 3. `mkdir ~/bfa` 4. `PATH=${PATH}:${HOME}/bfa/bin` -5. geth --password /dev/null --datadir $BFANETWORKDIR/node1 account new -6. geth --datadir $BFANETWORKDIR/node1 init $BFAHOME/src/genesis.json -7. run `start.sh` -8. create your contract (there is already one deployed, so do not confuse the two) -9. `insert.sh "I'm doing great today."` -10. wait a bit - if you are lucky 15 seconds only -11. `verify.sh "Hi there"` -12. `verify.sh "I'm doing great today."` -13. Try the basic `explorer.sh` -14. consider this crontab: @reboot bfa/network5445/start.sh -15. Try out walker.pl +5. run `start.sh` +6. create your contract (there is already one deployed, so do not confuse the two) +7. `insert.sh "I'm doing great today."` +8. wait a bit - if you are lucky only 15 seconds +9. `verify.sh TimestampDocument "Hi there"` +10. `verify.sh TimestampDocument "I'm doing great today."` +11. Try the basic `explorer.sh` +12. consider this crontab: @reboot bfa/network5445/start.sh +13. Try out walker.pl ## start.sh requires: **geth** @@ -32,7 +30,7 @@ Compiles and deploys a contract to the blockchain. A local "node1" must already Argument 1 is the contract to compile. -Example: `./create.contract src/contract.TimestampDocument.sol` +Example: `create.contract src/contract.TimestampDocument.sol` ## insert.sh requires: **geth** @@ -51,7 +49,11 @@ Simple script to look at blocks ## src/contract.TimestampDocument.sol -The initial Timestamp service. Could be made better. +The initial Timestamp service. + +## src/contract.TimeStampAuthority.sol + +Simpler TSA. ## walker.pl requires: **geth**, **perl**, __(libjson-perl)__ diff --git a/bin/insert.sh b/bin/insert.sh index 558e4743f23109050aa2603a413fa64d38875c3b..c52dda09f3e1355f2adacf35c9cd42396352f183 100755 --- a/bin/insert.sh +++ b/bin/insert.sh @@ -14,16 +14,17 @@ else contract="$1" text="$2" fi -if [ ! -e "${contract}" -a -r "${BFANETWORKDIR}/contracts/${contract}" ] +prefix="${BFANETWORKDIR}/contracts" +if [ ! -e "${contract}" -a -r "${prefix}/${contract}" ] then - contract=${BFANETWORKDIR}/contracts/${contract} + contract=${prefix}/${contract} fi test -L "${contract}" && - contract=$( readlink "${contract}" ) + contract=$( realpath "${contract}" ) test -n "${contract}" basecontract=$( basename "${contract}" ) test -n "${basecontract}" -abi=$( cat ${BFANETWORKDIR}/contracts/${contract}/abi ) +abi=$( cat ${contract}/abi ) test -n "${abi}" test -n "$text" || text="Hello World!" js=$( mktemp ) diff --git a/bin/verify.sh b/bin/verify.sh index dcb0ab5214722161ad30d17ca14458a87d4249a0..3419ebc6dcb9269e8db5a7a9cd7692da9eaf069b 100755 --- a/bin/verify.sh +++ b/bin/verify.sh @@ -15,12 +15,13 @@ else contract="$1" text="$2" fi -if [ ! -e "${contract}" -a -r "${BFANETWORKDIR}/contracts/${contract}" ] +prefix="${BFANETWORKDIR}/contracts" +if [ ! -e "${contract}" -a -r "${prefix}/${contract}" ] then - contract=${BFANETWORKDIR}/contracts/${contract} + contract=${prefix}/${contract} fi test -L "${contract}" && - contract=$( readlink "${contract}" ) + contract=$( realpath "${contract}" ) test -n "${contract}" basecontract=$( basename "${contract}" ) test -n "${basecontract}"