go-ethereum/swarm/test/syncing/00.sh
zelig f7d5ce4985 SWORM - swarm poc 0.2 homestead RC1
synced up to go-ethereum 1.5.0-unstable develop branch

major features:
* api overhaul due to rpc v2 and node service stack interface changes
* blockchain/ethereum contract interaction rewritten using abi/abigen (chequebook, ens)
* swarm - cluster control CLI - migration and revamp of prehistoric eth-utils repo
* poor man's end to end testing: scripted scenarios in swarm/test using swarm CLI
* http proxy now handles 3 url schemes for 1) ens-enabled [bzz], 2) immutable [bzzi] and 3) raw manifest [bzzr] resolution
* fixes issues with remote address setting, forwarding and syncing
* new control flags to switch swap and sync on and off
* placeholder basic implementation Ethereum Name Service
* improved logging - now debug level is coherent

regression:
* uri based versioning support is dropped temporarily since state tree pruning does not guarantee historical record
* registrar related functionality temporarily restricted - current ENS provides basic free and unrestricted Register/Resolve

accounts/abi:
  * bind: repeated attempt deployment of contracts, validation against known code, transactor creation from private keys
  * accountmanager: getUnlocked snatch private key when unlocked

cmd:
  * unlockAccount  moved to utils/cmd   and exported
  * getPassPhrase  moved to utils/input and exported
  * accountcmds: reflect the change
  * js: GlobalRegistrar is dropped (ens)

flags:
  * chequebook, bzzaccount,  bzzport, bzzconfig, bzznoswap, bzznosync

chequebook:
  * move from common/ to swarm/services
  * abigen-ised
  * specifies its own API (removed chequebook api from swarm/api)

kademlia:
  * move from common to swarm/network/kademlia
  * address abstracted out to separate file + tests

dns/ens/registrar:
  * moved from swarm/api to swarm/services/ens
  * implementation is basic placeholder before ENS is implemented
  * temporary rpc api via ens namespace
  * the old common/registrar is removed (also from eth/backend apis)

swap:
  * the abstract swap module moved from common to swarm/services
  * now embedded in the swarm and chequebook specific setup (this will change)
  * safer chequebook deployment using abigen helpers
  * backend not field of swap params

eth:
  * public accessor for GPO, needed to construct a PublicBlockChainAPI
  * extends ContractBackend in eth/bind.go with BalanceAt, GetTxReceipt and CodeAt API calls

internal/web3ext
  * add js bindings for bzz, chequebook rpc apis

swarm/api:
  * refactored api into smaller modules filesystem/storage/testapi
  * ethereum backend (needed for dns, swap, etc) moved to abi/bind
  * TODO: further refactor  due to #2040
  * swarm/api/http: now supports the 3 uri schemes
  * examples/album updated

swarm/cmd:
  * migrate old eth-utils and modify into a cluster control CLI
  * bzzup now allows non-local gateway, endpoint specified as second argument

swarm/network:
  * forwarder improved log messages, fixup condition on whether syncer is nil
  * hive extended with controls for testing support block read/write, swap/sync enabled/disabled
  * hive keepAlive launches with alarm in case no discover and no kaddb
  * fix IP address formatting issue [::1] -> became ::1 which refused to dial, now use discover.NewNode#String
  * integrate functionality for enabling/disabling sync and swap
  * allow nil sync state - improve syncer interface in protocol
  * fix SData slice out of bounds bug
  * fix disconnects by not replacing a node when bucket is full

swarm/test
  * poor man's testing framework. scripts invoking swarm/cmd/swarm
  * added tests for basic scenarios connections, swap, sync

swarm:
  * rewrite api using rpc v2
  * blockchain comms via abi/abigen + eth.ContractBackend
  * integrate new flags
2016-05-27 13:08:47 +02:00

55 lines
1.2 KiB
Bash

#!/bin/bash
echo "TEST sync/00:"
echo " two nodes that sync (no swap and do not have any funds)"
echo " can be in sync content with each other"
dir=`dirname $0`
source $dir/../../cmd/swarm/test.sh
mkdir -p /tmp/swarm-test-files
FILE_00=/tmp/swarm-test-files/00
FILE_01=/tmp/swarm-test-files/01
FILE_02=/tmp/swarm-test-files/02
FILE_03=/tmp/swarm-test-files/03
FILE_04=/tmp/swarm-test-files/04
for f in $FILE_00 $FILE_01 $FILE_02 $FILE_03 $FILE_04; do
randomfile 20 > $f
done
# options="--verbosity=0 --vmodule=swarm/network/*=6,common/chequebook/*=6,common/swap/*=6,common/kademlia/*=5"
key=/tmp/key
swarm init 2 $options
swarm info 00
swarm info 01
swarm up 00 $FILE_00|tail -n1 > $key
swarm needs 00 $key $FILE_00
# sleep $wait
swarm needs 01 $key $FILE_00
swarm stop 01
# exit 1;
swarm up 00 $FILE_01|tail -n1 > $key
swarm needs 00 $key $FILE_01
swarm start 01 $options
swarm needs 01 $key $FILE_01
swarm up 00 $FILE_02|tail -n1 > $key
swarm needs 00 $key $FILE_02
swarm needs 01 $key $FILE_02
swarm up 01 $FILE_03|tail -n1 > $key
swarm needs 01 $key $FILE_03
swarm needs 00 $key $FILE_03
swarm stop 00
swarm up 01 $FILE_04|tail -n1 > $key
swarm needs 01 $key $FILE_04
swarm start 00 #--bzznoswap
swarm needs 00 $key $FILE_04
swarm stop all