Client: identity -> address

This commit is contained in:
Vincent Bernardoff 2018-06-10 10:45:11 +02:00 committed by Benjamin Canou
parent 3247a3f491
commit b022a605b4
8 changed files with 31 additions and 61 deletions

View File

@ -2844,8 +2844,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$error: $error:
/* ... FIXME ... */ /* ... FIXME ... */
@ -3739,8 +3738,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string</pre> string</pre>
</div> </div>
@ -4998,8 +4996,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -5423,8 +5420,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -5703,8 +5699,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -6049,8 +6044,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -6313,8 +6307,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$error: $error:
/* ... FIXME ... */ /* ... FIXME ... */
@ -6900,8 +6893,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -7029,8 +7021,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -7213,8 +7204,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.michelson_v1.expression: $micheline.michelson_v1.expression:
/* Micheline expression (michelson_v1 variant) */ /* Micheline expression (michelson_v1 variant) */
@ -7346,8 +7336,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$micheline.location: $micheline.location:
/* Canonical location in a Micheline expression /* Canonical location in a Micheline expression
@ -8271,8 +8260,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$error: $error:
/* ... FIXME ... */ /* ... FIXME ... */
@ -8728,8 +8716,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$error: $error:
/* ... FIXME ... */ /* ... FIXME ... */
@ -9185,8 +9172,7 @@ Protocol Alpha
$contract_id: $contract_id:
/* A contract handle /* A contract handle
A contract notation as given to an RPC or inside scripts. Can be a A contract notation as given to an RPC or inside scripts. Can be a
base58 public key hash, representing the implicit contract of this base58 implicit contract hash or a base58 originated contract hash. */
identity, or a base58 originated contract hash. */
string string
$error: $error:
/* ... FIXME ... */ /* ... FIXME ... */

View File

@ -311,8 +311,8 @@ the appropriate value:
:: ::
$ ./alphanet.sh client list known identities $ ./alphanet.sh client list known addresses
my_identity: tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H (public key known) (secret key known) my_account: tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H (public key known) (secret key known)
$ ./alphanet.sh client rpc post /chains/main/blocks/head/helpers/rights/baking/delegate/tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H with {} $ ./alphanet.sh client rpc post /chains/main/blocks/head/helpers/rights/baking/delegate/tz1iFY8aDskx9QGbgBy68SNAGgkc7AE2iG9H with {}
{ "ok": { "ok":
[ { "level": 1400.000000, "priority": 2.000000, [ { "level": 1400.000000, "priority": 2.000000,

View File

@ -448,8 +448,6 @@ usage() {
echo " $0 start [--rpc-port <int>] [OPTIONS]" echo " $0 start [--rpc-port <int>] [OPTIONS]"
echo " Launch a full Tezos alphanet node in a docker container" echo " Launch a full Tezos alphanet node in a docker container"
echo " automatically generating a new network identity." echo " automatically generating a new network identity."
echo " An account 'my_account' for a manager 'my_identity' is also"
echo " created to be used via the client."
echo " OPTIONS (others than --rpc-port) are directly passed to the" echo " OPTIONS (others than --rpc-port) are directly passed to the"
echo " Tezos node, see '$0 shell tezos-node config --help'" echo " Tezos node, see '$0 shell tezos-node config --help'"
echo " for more details." echo " for more details."

View File

@ -35,7 +35,7 @@ $client gen keys $key2 --sig secp256k1
$client gen keys $key3 --sig ed25519 $client gen keys $key3 --sig ed25519
# $client gen keys $key6 --sig p256 # $client gen keys $key6 --sig p256
$client list known identities $client list known addresses
$client get balance for bootstrap1 $client get balance for bootstrap1
bake_after $client transfer 1,000 from bootstrap1 to $key1 bake_after $client transfer 1,000 from bootstrap1 to $key1

View File

@ -83,20 +83,6 @@ wait_for_the_node_to_be_bootstraped() {
$client bootstrapped $client bootstrapped
} }
## Account #################################################################
may_create_identity() {
if ! $client get balance for "my_identity" >/dev/null 2>&1 ; then
echo "Generating new manager key (known as 'my_identity')..."
$client gen keys "my_identity"
fi
if ! $client get balance for "my_account" >/dev/null 2>&1 ; then
echo "Creating new account for 'my_identity' (known as 'my_account')..."
$client forget contract "my_account" >/dev/null 2>&1 || true
$client originate free account "my_account" for "my_identity"
fi
}
## Baker ################################################################### ## Baker ###################################################################
check_baker() { check_baker() {
@ -317,7 +303,7 @@ The client is now properly initialized. In the rest of this shell
session, you might now run \`tezos-client\` to communicate with a session, you might now run \`tezos-client\` to communicate with a
tezos node launched with \`launch-sandboxed-node $1\`. For instance: tezos node launched with \`launch-sandboxed-node $1\`. For instance:
tezos-client rpc get /chains/main/blocks/head/metadata/protocol_hash tezos-client rpc get /chains/main/blocks/head/metadata
Note: if the current protocol version, as reported by the previous Note: if the current protocol version, as reported by the previous
command, is "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im", you command, is "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im", you

View File

@ -202,9 +202,9 @@ let commands () : Client_context.io_wallet Clic.command list =
Signature.Public_key_hash.pp pkh >>= fun () -> Signature.Public_key_hash.pp pkh >>= fun () ->
Public_key.add ~force cctxt name (pk_uri, public_key)) ; Public_key.add ~force cctxt name (pk_uri, public_key)) ;
command ~group ~desc: "Add an identity to the wallet." command ~group ~desc: "Add an address to the wallet."
(args1 (Public_key.force_switch ())) (args1 (Public_key.force_switch ()))
(prefixes [ "add" ; "identity" ] (prefixes [ "add" ; "address" ]
@@ Public_key_hash.fresh_alias_param @@ Public_key_hash.fresh_alias_param
@@ Public_key_hash.source_param @@ Public_key_hash.source_param
@@ stop) @@ stop)
@ -212,9 +212,9 @@ let commands () : Client_context.io_wallet Clic.command list =
Public_key_hash.of_fresh cctxt force name >>=? fun name -> Public_key_hash.of_fresh cctxt force name >>=? fun name ->
Public_key_hash.add ~force cctxt name hash) ; Public_key_hash.add ~force cctxt name hash) ;
command ~group ~desc: "List all identities and associated keys." command ~group ~desc: "List all addresses and associated keys."
no_options no_options
(fixed [ "list" ; "known" ; "identities" ]) (fixed [ "list" ; "known" ; "addresses" ])
(fun () (cctxt : #Client_context.io_wallet) -> (fun () (cctxt : #Client_context.io_wallet) ->
list_keys cctxt >>=? fun l -> list_keys cctxt >>=? fun l ->
iter_s begin fun (name, pkh, pk, sk) -> iter_s begin fun (name, pkh, pk, sk) ->
@ -232,16 +232,16 @@ let commands () : Client_context.io_wallet Clic.command list =
end >>= fun () -> return () end >>= fun () -> return ()
end l) ; end l) ;
command ~group ~desc: "Show the keys associated with an identity." command ~group ~desc: "Show the keys associated with an implicit account."
(args1 show_private_switch) (args1 show_private_switch)
(prefixes [ "show" ; "identity"] (prefixes [ "show" ; "address"]
@@ Public_key_hash.alias_param @@ Public_key_hash.alias_param
@@ stop) @@ stop)
(fun show_private (name, _) (cctxt : #Client_context.io_wallet) -> (fun show_private (name, _) (cctxt : #Client_context.io_wallet) ->
alias_keys cctxt name >>=? fun key_info -> alias_keys cctxt name >>=? fun key_info ->
match key_info with match key_info with
| None -> | None ->
cctxt#message "No keys found for identity" >>= fun () -> cctxt#message "No keys found for address" >>= fun () ->
return () return ()
| Some (pkh, pk, skloc) -> | Some (pkh, pk, skloc) ->
cctxt#message "Hash: %a" cctxt#message "Hash: %a"

View File

@ -77,17 +77,17 @@ let arg_arg =
let delegate_arg = let delegate_arg =
Client_keys.Public_key_hash.source_arg Client_keys.Public_key_hash.source_arg
~long:"delegate" ~long:"delegate"
~placeholder:"identity" ~placeholder:"address"
~doc:"delegate of the contract\n\ ~doc:"delegate of the contract\n\
Must be a known identity." Must be a known address."
() ()
let source_arg = let source_arg =
arg arg
~long:"source" ~long:"source"
~placeholder:"identity" ~placeholder:"address"
~doc:"source of the deposits to be paid\n\ ~doc:"source of the deposits to be paid\n\
Must be a known identity." Must be a known address."
string_parameter string_parameter
let spendable_switch = let spendable_switch =

View File

@ -54,8 +54,8 @@ let encoding =
"A contract handle" "A contract handle"
~description: ~description:
"A contract notation as given to an RPC or inside scripts. \ "A contract notation as given to an RPC or inside scripts. \
Can be a base58 public key hash, representing the implicit contract \ Can be a base58 implicit contract hash \
of this identity, or a base58 originated contract hash." @@ or a base58 originated contract hash." @@
splitted splitted
~binary: ~binary:
(union ~tag_size:`Uint8 [ (union ~tag_size:`Uint8 [