mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
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
51 lines
1.1 KiB
Bash
Executable file
51 lines
1.1 KiB
Bash
Executable file
#! /bin/bash
|
|
|
|
INDEX='index.html'
|
|
proxy="http://localhost:8500"
|
|
delimiter='{"entries":[{'
|
|
|
|
|
|
if [[ ! -z "$2" ]]; then
|
|
proxy="$2"
|
|
fi
|
|
|
|
if [ -f "$1" ]; then
|
|
hash=`wget -q -O- --post-file="$1" $proxy/bzzr:/`
|
|
mime=`mimetype -b "$1"`
|
|
# echo wget -q -O- --post-data="$delimiter\"hash\":\"$hash\",\"contentType\":\"$mime\"}]}" $proxy/bzzr:/
|
|
wget -q -O- --post-data="$delimiter\"hash\":\"$hash\",\"contentType\":\"$mime\"}]}" $proxy/bzzr:/
|
|
echo
|
|
|
|
else
|
|
|
|
[ -d "$1" ] || exit -1
|
|
|
|
bzzroot="$1"
|
|
[ "_$1" = _ ] && bzzroot=.
|
|
|
|
pushd "$bzzroot" > /dev/null
|
|
|
|
(for path in `find . -type f`
|
|
do
|
|
name=`echo "$path" | cut -c3-`
|
|
[ _`basename "$name"` = "_$INDEX" ] && name=`dirname "$name"`
|
|
echo -n "$delimiter"
|
|
hash=`wget -q -O- --post-file="$path" $proxy/bzzr:/`
|
|
mime=`mimetype -b "$path"`
|
|
if [ "$mime" = "text/plain" ]; then
|
|
echo -n $path|grep -q '.css' && mime="text/css"
|
|
fi
|
|
if [ "_$name" = '_.' ]; then
|
|
echo -n "\"hash\":\"$hash\",\"contentType\":\"$mime\""
|
|
else
|
|
echo -n "\"hash\":\"$hash\",\"path\":\"$name\",\"contentType\":\"$mime\""
|
|
fi
|
|
delimiter='},{'
|
|
|
|
done
|
|
echo -n '}]}') | wget -q -O- --post-data=`cat` $proxy/bzzr:/
|
|
echo
|
|
|
|
popd > /dev/null
|
|
|
|
fi
|