Client: move protocol injection commands to the admin client

This commit is contained in:
Benjamin Canou 2018-02-14 16:24:08 +01:00
parent bacb55800d
commit 345bbc715d
7 changed files with 20 additions and 6 deletions

View File

@ -401,6 +401,11 @@ opam:37:tezos-unix-signers:
variables:
package: tezos-unix-signers
opam:38:tezos-client-commands:
<<: *opam_definition
variables:
package: tezos-client-commands
##END_OPAM##

View File

@ -2,7 +2,7 @@
(executables
((names (main_client main_admin))
(public_names (tezos-client tezos-admin))
(public_names (tezos-client tezos-admin-client))
(libraries (tezos-base
tezos-rpc-http
tezos-shell-services

View File

@ -44,7 +44,6 @@ let select_commands ctxt { block ; protocol } =
Client_rpc_commands.commands @
Client_network_commands.commands () @
Client_keys_commands.commands () @
Client_protocols.commands () @
Client_helpers_commands.commands () @
commands_for_version

View File

@ -13,6 +13,7 @@
${bin:tezos-node}
${bin:tezos-init-sandboxed-client.sh}
${bin:tezos-client}
${bin:tezos-admin-client}
))))
(alias
@ -28,6 +29,7 @@
${bin:tezos-node}
${bin:tezos-init-sandboxed-client.sh}
${bin:tezos-client}
${bin:tezos-admin-client}
))))
(alias
@ -45,6 +47,7 @@
${bin:tezos-node}
${bin:tezos-init-sandboxed-client.sh}
${bin:tezos-client}
${bin:tezos-admin-client}
))))
(alias
@ -60,6 +63,7 @@
${bin:tezos-node}
${bin:tezos-init-sandboxed-client.sh}
${bin:tezos-client}
${bin:tezos-admin-client}
))))
(alias

View File

@ -8,8 +8,9 @@ source $test_dir/test_lib.inc.sh "$@"
start_node 1
sleep 2
$client inject protocol "$test_dir/demo"
$client list protocols
$admin_client inject protocol "$test_dir/demo"
$admin_client list protocols
echo
echo End of test

View File

@ -9,7 +9,8 @@ sandbox_file="$test_dir/sandbox.json"
tezos_sandboxed_node="${1:-$test_dir/../../bin_node/tezos-sandboxed-node.sh}"
local_node="${2:-$test_dir/../../../_build/default/src/bin_node/main.exe}"
tezos_init_sandboxed_client="${3:-$test_dir/../../bin_client/tezos-init-sandboxed-client.sh}"
local_client="${4:-$test_dir/../../../_build/default/src/bin_client/main.exe}"
local_client="${4:-$test_dir/../../../_build/default/src/bin_client/main_client.exe}"
local_admin_client="${5:-$test_dir/../../../_build/default/src/bin_client/main_admin.exe}"
contract_dir="contracts"

View File

@ -4,6 +4,7 @@ set -e
client_dir="${client_dir:=$HOME/.tezos-client}"
client="${client:=tezos-client -base-dir $client_dir}"
admin_client="${client:=tezos-admin-client -base-dir $client_dir}"
client_dirs=()
@ -16,6 +17,7 @@ init_sandboxed_client() {
client_dir="$(mktemp -d -t tezos-tmp-client.XXXXXXXX)"
client_dirs+=("$client_dir")
client="$local_client -base-dir $client_dir -addr 127.0.0.1 -port $rpc"
admin_client="$local_admin_client -base-dir $client_dir -addr 127.0.0.1 -port $rpc"
}
@ -215,8 +217,10 @@ main () {
local bin_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
if [ $(basename "$bin_dir") = "bin_client" ]; then
local_client="${local_client:-$bin_dir/../../_build/default/src/bin_client/main_client.exe}"
local_admin_client="${local_admin_client:-$bin_dir/../../_build/default/src/bin_client/main_admin.exe}"
else
local_client="${local_client:-tezos-client}"
local_admin_client="${local_admin_client:-tezos-admin-client}"
fi
if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then
@ -233,7 +237,7 @@ main () {
echo "exec $client \"\$@\"" >> $client_dir/bin/tezos-client
chmod +x $client_dir/bin/tezos-client
echo '#!/bin/sh' > $client_dir/bin/tezos-admin-client
echo "exec $client \"\$@\"" | sed s/main_client/main_admin/g >> $client_dir/bin/tezos-admin-client
echo "exec $admin_client \"\$@\"" >> $client_dir/bin/tezos-admin-client
chmod +x $client_dir/bin/tezos-admin-client
cat <<EOF