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: variables:
package: tezos-unix-signers package: tezos-unix-signers
opam:38:tezos-client-commands:
<<: *opam_definition
variables:
package: tezos-client-commands
##END_OPAM## ##END_OPAM##

View File

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

View File

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

View File

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

View File

@ -8,8 +8,9 @@ source $test_dir/test_lib.inc.sh "$@"
start_node 1 start_node 1
sleep 2 sleep 2
$client inject protocol "$test_dir/demo"
$client list protocols $admin_client inject protocol "$test_dir/demo"
$admin_client list protocols
echo echo
echo End of test 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}" tezos_sandboxed_node="${1:-$test_dir/../../bin_node/tezos-sandboxed-node.sh}"
local_node="${2:-$test_dir/../../../_build/default/src/bin_node/main.exe}" 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}" 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" contract_dir="contracts"

View File

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