RPC: remove the deprecated value RPC.service
This commit is contained in:
parent
7ac969beb1
commit
bfb6694afb
@ -36,34 +36,42 @@ let wrap_tzerror encoding =
|
|||||||
|
|
||||||
|
|
||||||
let operations custom_root =
|
let operations custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "All the operations of the block (fully decoded)."
|
~description: "All the operations of the block (fully decoded)."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
(list (list (dynamic_size Operation.encoding))))
|
(list (list (dynamic_size Operation.encoding))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "operations")
|
RPC.Path.(custom_root / "operations")
|
||||||
|
|
||||||
let header custom_root =
|
let header custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "The header of the block (fully decoded)."
|
~description: "The header of the block (fully decoded)."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror Block_header.encoding)
|
~output: (wrap_tzerror Block_header.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "header")
|
RPC.Path.(custom_root / "header")
|
||||||
|
|
||||||
module Header = struct
|
module Header = struct
|
||||||
|
|
||||||
let priority custom_root =
|
let priority custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Baking priority of the block."
|
~description: "Baking priority of the block."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror uint16)
|
~output: (wrap_tzerror uint16)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "header" / "priority")
|
RPC.Path.(custom_root / "header" / "priority")
|
||||||
|
|
||||||
let seed_nonce_hash custom_root =
|
let seed_nonce_hash custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Hash of the seed nonce of the block."
|
~description: "Hash of the seed nonce of the block."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror Nonce_hash.encoding)
|
~output: (wrap_tzerror Nonce_hash.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "header" / "seed_nonce_hash")
|
RPC.Path.(custom_root / "header" / "seed_nonce_hash")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -71,74 +79,92 @@ end
|
|||||||
module Constants = struct
|
module Constants = struct
|
||||||
|
|
||||||
let cycle_length custom_root =
|
let cycle_length custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Cycle length"
|
~description: "Cycle length"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "cycle length" int32)
|
describe ~title: "cycle length" int32)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "cycle_length")
|
RPC.Path.(custom_root / "constants" / "cycle_length")
|
||||||
|
|
||||||
let voting_period_length custom_root =
|
let voting_period_length custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Length of the voting period"
|
~description: "Length of the voting period"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "voting period length" int32)
|
describe ~title: "voting period length" int32)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "voting_period_length")
|
RPC.Path.(custom_root / "constants" / "voting_period_length")
|
||||||
|
|
||||||
let time_before_reward custom_root =
|
let time_before_reward custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Time before reward"
|
~description: "Time before reward"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "time before reward" Period.encoding)
|
describe ~title: "time before reward" Period.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "time_before_reward")
|
RPC.Path.(custom_root / "constants" / "time_before_reward")
|
||||||
|
|
||||||
let slot_durations custom_root =
|
let slot_durations custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Slot durations"
|
~description: "Slot durations"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "time between slots" (list Period.encoding))
|
describe ~title: "time between slots" (list Period.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "time_between_slots")
|
RPC.Path.(custom_root / "constants" / "time_between_slots")
|
||||||
|
|
||||||
let first_free_baking_slot custom_root =
|
let first_free_baking_slot custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "First free baking slot"
|
~description: "First free baking slot"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "first free baking slot" uint16)
|
describe ~title: "first free baking slot" uint16)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "first_free_baking_slot")
|
RPC.Path.(custom_root / "constants" / "first_free_baking_slot")
|
||||||
|
|
||||||
let max_signing_slot custom_root =
|
let max_signing_slot custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Max signing slot"
|
~description: "Max signing slot"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "max signing slot" uint16)
|
describe ~title: "max signing slot" uint16)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "max_signing_slot")
|
RPC.Path.(custom_root / "constants" / "max_signing_slot")
|
||||||
|
|
||||||
let instructions_per_transaction custom_root =
|
let instructions_per_transaction custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Instructions per transaction"
|
~description: "Instructions per transaction"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "instructions per transaction" int31)
|
describe ~title: "instructions per transaction" int31)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "instructions_per_transaction")
|
RPC.Path.(custom_root / "constants" / "instructions_per_transaction")
|
||||||
|
|
||||||
let proof_of_work_threshold custom_root =
|
let proof_of_work_threshold custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Stamp threshold"
|
~description: "Stamp threshold"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "proof_of_work threshold" int64)
|
describe ~title: "proof_of_work threshold" int64)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "proof_of_work_threshold")
|
RPC.Path.(custom_root / "constants" / "proof_of_work_threshold")
|
||||||
|
|
||||||
let errors custom_root =
|
let errors custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Schema for all the RPC errors from this protocol version"
|
~description: "Schema for all the RPC errors from this protocol version"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: json_schema
|
~output: json_schema
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "constants" / "errors")
|
RPC.Path.(custom_root / "constants" / "errors")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -146,41 +172,51 @@ end
|
|||||||
module Context = struct
|
module Context = struct
|
||||||
|
|
||||||
let level custom_root =
|
let level custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Detailled level information for the current block"
|
~description: "Detailled level information for the current block"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "detailled level info" Level.encoding)
|
describe ~title: "detailled level info" Level.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "level")
|
RPC.Path.(custom_root / "context" / "level")
|
||||||
|
|
||||||
let next_level custom_root =
|
let next_level custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Detailled level information for the next block"
|
~description: "Detailled level information for the next block"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "detailled level info" Level.encoding)
|
describe ~title: "detailled level info" Level.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "next_level")
|
RPC.Path.(custom_root / "context" / "next_level")
|
||||||
|
|
||||||
let roll_value custom_root =
|
let roll_value custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror Tez.encoding)
|
~output: (wrap_tzerror Tez.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "roll_value")
|
RPC.Path.(custom_root / "context" / "roll_value")
|
||||||
|
|
||||||
let next_roll custom_root =
|
let next_roll custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror int32)
|
~output: (wrap_tzerror int32)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "next_roll")
|
RPC.Path.(custom_root / "context" / "next_roll")
|
||||||
|
|
||||||
let voting_period_kind custom_root =
|
let voting_period_kind custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Voting period kind for the current block"
|
~description: "Voting period kind for the current block"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output:
|
~output:
|
||||||
(wrap_tzerror @@
|
(wrap_tzerror @@
|
||||||
(obj1
|
(obj1
|
||||||
(req "voting_period_kind" Voting_period.kind_encoding)))
|
(req "voting_period_kind" Voting_period.kind_encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "voting_period_kind")
|
RPC.Path.(custom_root / "context" / "voting_period_kind")
|
||||||
|
|
||||||
|
|
||||||
@ -208,18 +244,22 @@ module Context = struct
|
|||||||
]
|
]
|
||||||
|
|
||||||
let get custom_root =
|
let get custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Info about the nonce of a previous block."
|
~description: "Info about the nonce of a previous block."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror nonce_encoding)
|
~output: (wrap_tzerror nonce_encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "nonce" /: Raw_level.arg)
|
RPC.Path.(custom_root / "context" / "nonce" /: Raw_level.arg)
|
||||||
|
|
||||||
let hash custom_root =
|
let hash custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Hash of the current block's nonce."
|
~description: "Hash of the current block's nonce."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "nonce hash" Nonce_hash.encoding)
|
describe ~title: "nonce hash" Nonce_hash.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "nonce")
|
RPC.Path.(custom_root / "context" / "nonce")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -245,17 +285,21 @@ module Context = struct
|
|||||||
(req "public_key" Ed25519.Public_key.encoding))
|
(req "public_key" Ed25519.Public_key.encoding))
|
||||||
|
|
||||||
let list custom_root =
|
let list custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "List the known public keys"
|
~description: "List the known public keys"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@ list pk_encoding)
|
~output: (wrap_tzerror @@ list pk_encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "keys")
|
RPC.Path.(custom_root / "context" / "keys")
|
||||||
|
|
||||||
let get custom_root =
|
let get custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Fetch the stored public key"
|
~description: "Fetch the stored public key"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@ pk_encoding)
|
~output: (wrap_tzerror @@ pk_encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "keys" /: public_key_hash_arg )
|
RPC.Path.(custom_root / "context" / "keys" /: public_key_hash_arg )
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -265,59 +309,75 @@ module Context = struct
|
|||||||
module Contract = struct
|
module Contract = struct
|
||||||
|
|
||||||
let balance custom_root =
|
let balance custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the balance of a contract."
|
~description: "Access the balance of a contract."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror Tez.encoding)
|
~output: (wrap_tzerror Tez.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "balance")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "balance")
|
||||||
|
|
||||||
let manager custom_root =
|
let manager custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the manager of a contract."
|
~description: "Access the manager of a contract."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror Ed25519.Public_key_hash.encoding)
|
~output: (wrap_tzerror Ed25519.Public_key_hash.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "manager")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "manager")
|
||||||
|
|
||||||
let delegate custom_root =
|
let delegate custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the delegate of a contract, if any."
|
~description: "Access the delegate of a contract, if any."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror (option Ed25519.Public_key_hash.encoding))
|
~output: (wrap_tzerror (option Ed25519.Public_key_hash.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "delegate")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "delegate")
|
||||||
|
|
||||||
let counter custom_root =
|
let counter custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the counter of a contract, if any."
|
~description: "Access the counter of a contract, if any."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror int32)
|
~output: (wrap_tzerror int32)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "counter")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "counter")
|
||||||
|
|
||||||
let spendable custom_root =
|
let spendable custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Tells if the contract tokens can be spent by the manager."
|
~description: "Tells if the contract tokens can be spent by the manager."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror bool)
|
~output: (wrap_tzerror bool)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "spendable")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "spendable")
|
||||||
|
|
||||||
let delegatable custom_root =
|
let delegatable custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Tells if the contract delegate can be changed."
|
~description: "Tells if the contract delegate can be changed."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror bool)
|
~output: (wrap_tzerror bool)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "delegatable")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "delegatable")
|
||||||
|
|
||||||
let script custom_root =
|
let script custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the code and data of the contract."
|
~description: "Access the code and data of the contract."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror (option Script.encoding))
|
~output: (wrap_tzerror (option Script.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "script")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "script")
|
||||||
|
|
||||||
let storage custom_root =
|
let storage custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the data of the contract."
|
~description: "Access the data of the contract."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror (option Script.expr_encoding))
|
~output: (wrap_tzerror (option Script.expr_encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "storage")
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg / "storage")
|
||||||
|
|
||||||
type info = {
|
type info = {
|
||||||
@ -330,8 +390,9 @@ module Context = struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
let get custom_root =
|
let get custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Access the complete status of a contract."
|
~description: "Access the complete status of a contract."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output:
|
~output:
|
||||||
(wrap_tzerror @@
|
(wrap_tzerror @@
|
||||||
@ -349,14 +410,17 @@ module Context = struct
|
|||||||
(opt "value" Ed25519.Public_key_hash.encoding))
|
(opt "value" Ed25519.Public_key_hash.encoding))
|
||||||
(opt "script" Script.encoding)
|
(opt "script" Script.encoding)
|
||||||
(req "counter" int32))
|
(req "counter" int32))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg)
|
RPC.Path.(custom_root / "context" / "contracts" /: Contract.arg)
|
||||||
|
|
||||||
let list custom_root =
|
let list custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"All existing contracts (including non-empty default contracts)."
|
"All existing contracts (including non-empty default contracts)."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@ list Contract.encoding)
|
~output: (wrap_tzerror @@ list Contract.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "context" / "contracts")
|
RPC.Path.(custom_root / "context" / "contracts")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -368,11 +432,13 @@ end
|
|||||||
module Helpers = struct
|
module Helpers = struct
|
||||||
|
|
||||||
let minimal_timestamp custom_root =
|
let minimal_timestamp custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Minimal timestamp for the next block."
|
~description: "Minimal timestamp for the next block."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (opt "priority" int31))
|
~input: (obj1 (opt "priority" int31))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj1 (req "timestamp" Timestamp.encoding))
|
obj1 (req "timestamp" Timestamp.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "minimal_timestamp")
|
RPC.Path.(custom_root / "helpers" / "minimal_timestamp")
|
||||||
|
|
||||||
let run_code_input_encoding =
|
let run_code_input_encoding =
|
||||||
@ -385,18 +451,21 @@ module Helpers = struct
|
|||||||
(opt "origination_nonce" Contract.origination_nonce_encoding))
|
(opt "origination_nonce" Contract.origination_nonce_encoding))
|
||||||
|
|
||||||
let run_code custom_root =
|
let run_code custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Run a piece of code in the current context"
|
~description: "Run a piece of code in the current context"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: run_code_input_encoding
|
~input: run_code_input_encoding
|
||||||
~output: (wrap_tzerror
|
~output: (wrap_tzerror
|
||||||
(obj2
|
(obj2
|
||||||
(req "storage" Script.expr_encoding)
|
(req "storage" Script.expr_encoding)
|
||||||
(req "output" Script.expr_encoding)))
|
(req "output" Script.expr_encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "run_code")
|
RPC.Path.(custom_root / "helpers" / "run_code")
|
||||||
|
|
||||||
let apply_operation custom_root =
|
let apply_operation custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Applies an operation in the current context"
|
~description: "Applies an operation in the current context"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj4
|
~input: (obj4
|
||||||
(req "pred_block" Block_hash.encoding)
|
(req "pred_block" Block_hash.encoding)
|
||||||
(req "operation_hash" Operation_hash.encoding)
|
(req "operation_hash" Operation_hash.encoding)
|
||||||
@ -404,13 +473,15 @@ module Helpers = struct
|
|||||||
(opt "signature" Ed25519.Signature.encoding))
|
(opt "signature" Ed25519.Signature.encoding))
|
||||||
~output: (wrap_tzerror
|
~output: (wrap_tzerror
|
||||||
(obj1 (req "contracts" (list Contract.encoding))))
|
(obj1 (req "contracts" (list Contract.encoding))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "apply_operation")
|
RPC.Path.(custom_root / "helpers" / "apply_operation")
|
||||||
|
|
||||||
|
|
||||||
let trace_code custom_root =
|
let trace_code custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Run a piece of code in the current context, \
|
~description: "Run a piece of code in the current context, \
|
||||||
keeping a trace"
|
keeping a trace"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: run_code_input_encoding
|
~input: run_code_input_encoding
|
||||||
~output: (wrap_tzerror
|
~output: (wrap_tzerror
|
||||||
(obj3
|
(obj3
|
||||||
@ -421,52 +492,63 @@ module Helpers = struct
|
|||||||
(req "location" Script.location_encoding)
|
(req "location" Script.location_encoding)
|
||||||
(req "gas" int31)
|
(req "gas" int31)
|
||||||
(req "stack" (list (Script.expr_encoding)))))))
|
(req "stack" (list (Script.expr_encoding)))))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "trace_code")
|
RPC.Path.(custom_root / "helpers" / "trace_code")
|
||||||
|
|
||||||
let typecheck_code custom_root =
|
let typecheck_code custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Typecheck a piece of code in the current context"
|
~description: "Typecheck a piece of code in the current context"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Script.expr_encoding
|
~input: Script.expr_encoding
|
||||||
~output: (wrap_tzerror Script_ir_translator.type_map_enc)
|
~output: (wrap_tzerror Script_ir_translator.type_map_enc)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "typecheck_code")
|
RPC.Path.(custom_root / "helpers" / "typecheck_code")
|
||||||
|
|
||||||
let typecheck_data custom_root =
|
let typecheck_data custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Check that some data expression is well formed \
|
~description: "Check that some data expression is well formed \
|
||||||
and of a given type in the current context"
|
and of a given type in the current context"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj2
|
~input: (obj2
|
||||||
(req "data" Script.expr_encoding)
|
(req "data" Script.expr_encoding)
|
||||||
(req "type" Script.expr_encoding))
|
(req "type" Script.expr_encoding))
|
||||||
~output: (wrap_tzerror empty)
|
~output: (wrap_tzerror empty)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "typecheck_data")
|
RPC.Path.(custom_root / "helpers" / "typecheck_data")
|
||||||
|
|
||||||
let hash_data custom_root =
|
let hash_data custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Computes the hash of some data expression \
|
~description: "Computes the hash of some data expression \
|
||||||
using the same algorithm as script instruction H"
|
using the same algorithm as script instruction H"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (req "data" Script.expr_encoding))
|
~input: (obj1 (req "data" Script.expr_encoding))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj1 (req "hash" string))
|
obj1 (req "hash" string))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "hash_data")
|
RPC.Path.(custom_root / "helpers" / "hash_data")
|
||||||
|
|
||||||
let level custom_root =
|
let level custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "..."
|
~description: "..."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1
|
~input: (obj1
|
||||||
(opt "offset" int32))
|
(opt "offset" int32))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "block level and cycle information" Level.encoding)
|
describe ~title: "block level and cycle information" Level.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "level" /: Raw_level.arg)
|
RPC.Path.(custom_root / "helpers" / "level" /: Raw_level.arg)
|
||||||
|
|
||||||
let levels custom_root =
|
let levels custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Levels of a cycle"
|
~description: "Levels of a cycle"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
describe ~title: "levels of a cycle"
|
describe ~title: "levels of a cycle"
|
||||||
(obj2
|
(obj2
|
||||||
(req "first" Raw_level.encoding)
|
(req "first" Raw_level.encoding)
|
||||||
(req "last" Raw_level.encoding)))
|
(req "last" Raw_level.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "levels" /: Cycle.arg)
|
RPC.Path.(custom_root / "helpers" / "levels" /: Cycle.arg)
|
||||||
|
|
||||||
module Rights = struct
|
module Rights = struct
|
||||||
@ -489,10 +571,11 @@ module Helpers = struct
|
|||||||
(req "timestamp" Timestamp.encoding))
|
(req "timestamp" Timestamp.encoding))
|
||||||
|
|
||||||
let baking_rights custom_root =
|
let baking_rights custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List gelegates allowed to bake for the next level, \
|
"List gelegates allowed to bake for the next level, \
|
||||||
ordered by priority."
|
ordered by priority."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (opt "max_priority" int31))
|
~input: (obj1 (opt "max_priority" int31))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj2
|
obj2
|
||||||
@ -502,102 +585,121 @@ module Helpers = struct
|
|||||||
(obj2
|
(obj2
|
||||||
(req "delegate" Ed25519.Public_key_hash.encoding)
|
(req "delegate" Ed25519.Public_key_hash.encoding)
|
||||||
(req "timestamp" Timestamp.encoding)))))
|
(req "timestamp" Timestamp.encoding)))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights" / "baking")
|
RPC.Path.(custom_root / "helpers" / "rights" / "baking")
|
||||||
|
|
||||||
let baking_rights_for_level custom_root =
|
let baking_rights_for_level custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List delegate allowed to bake for a given level, \
|
"List delegate allowed to bake for a given level, \
|
||||||
ordered by priority."
|
ordered by priority."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (opt "max_priority" int31))
|
~input: (obj1 (opt "max_priority" int31))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj2
|
obj2
|
||||||
(req "level" Raw_level.encoding)
|
(req "level" Raw_level.encoding)
|
||||||
(req "delegates"
|
(req "delegates"
|
||||||
(list Ed25519.Public_key_hash.encoding)))
|
(list Ed25519.Public_key_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "baking" / "level" /: Raw_level.arg )
|
/ "baking" / "level" /: Raw_level.arg )
|
||||||
|
|
||||||
let baking_levels custom_root =
|
let baking_levels custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List level for which we might computed baking rights."
|
"List level for which we might computed baking rights."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj1 (req "levels" (list Raw_level.encoding)))
|
obj1 (req "levels" (list Raw_level.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "baking" / "level" )
|
/ "baking" / "level" )
|
||||||
|
|
||||||
let baking_rights_for_delegate custom_root =
|
let baking_rights_for_delegate custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Future baking rights for a given delegate."
|
~description: "Future baking rights for a given delegate."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: slots_range_encoding
|
~input: slots_range_encoding
|
||||||
~output: (wrap_tzerror (Data_encoding.list baking_slot_encoding))
|
~output: (wrap_tzerror (Data_encoding.list baking_slot_encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "baking" / "delegate" /: Context.Key.public_key_hash_arg )
|
/ "baking" / "delegate" /: Context.Key.public_key_hash_arg )
|
||||||
|
|
||||||
let baking_delegates custom_root =
|
let baking_delegates custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List delegates with baking rights."
|
"List delegates with baking rights."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj1 (req "delegates"
|
obj1 (req "delegates"
|
||||||
(list Ed25519.Public_key_hash.encoding)))
|
(list Ed25519.Public_key_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "baking" / "delegate" )
|
/ "baking" / "delegate" )
|
||||||
|
|
||||||
let endorsement_rights custom_root =
|
let endorsement_rights custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List delegates allowed to endorse for the current block."
|
"List delegates allowed to endorse for the current block."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (opt "max_priority" int31))
|
~input: (obj1 (opt "max_priority" int31))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj2
|
obj2
|
||||||
(req "level" Raw_level.encoding)
|
(req "level" Raw_level.encoding)
|
||||||
(req "delegates"
|
(req "delegates"
|
||||||
(list Ed25519.Public_key_hash.encoding)))
|
(list Ed25519.Public_key_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights" / "endorsement")
|
RPC.Path.(custom_root / "helpers" / "rights" / "endorsement")
|
||||||
|
|
||||||
let endorsement_rights_for_level custom_root =
|
let endorsement_rights_for_level custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List delegates allowed to endorse blocks for a given level."
|
"List delegates allowed to endorse blocks for a given level."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (opt "max_priority" int31))
|
~input: (obj1 (opt "max_priority" int31))
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj2
|
obj2
|
||||||
(req "level" Raw_level.encoding)
|
(req "level" Raw_level.encoding)
|
||||||
(req "delegates"
|
(req "delegates"
|
||||||
(list Ed25519.Public_key_hash.encoding)))
|
(list Ed25519.Public_key_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "endorsement" / "level" /: Raw_level.arg )
|
/ "endorsement" / "level" /: Raw_level.arg )
|
||||||
|
|
||||||
let endorsement_levels custom_root =
|
let endorsement_levels custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List level for which we might computed endorsement rights."
|
"List level for which we might computed endorsement rights."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj1 (req "levels" (list Raw_level.encoding)))
|
obj1 (req "levels" (list Raw_level.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "endorsement" / "level" )
|
/ "endorsement" / "level" )
|
||||||
|
|
||||||
let endorsement_rights_for_delegate custom_root =
|
let endorsement_rights_for_delegate custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Compute endorsement rights for a given delegate."
|
~description: "Compute endorsement rights for a given delegate."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: slots_range_encoding
|
~input: slots_range_encoding
|
||||||
~output: (wrap_tzerror @@ Data_encoding.list endorsement_slot_encoding)
|
~output: (wrap_tzerror @@ Data_encoding.list endorsement_slot_encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "endorsement" / "delegate" /: Context.Key.public_key_hash_arg )
|
/ "endorsement" / "delegate" /: Context.Key.public_key_hash_arg )
|
||||||
|
|
||||||
let endorsement_delegates custom_root =
|
let endorsement_delegates custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List delegates with endorsement rights."
|
"List delegates with endorsement rights."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (wrap_tzerror @@
|
~output: (wrap_tzerror @@
|
||||||
obj1 (req "delegates"
|
obj1 (req "delegates"
|
||||||
(list Ed25519.Public_key_hash.encoding)))
|
(list Ed25519.Public_key_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "rights"
|
RPC.Path.(custom_root / "helpers" / "rights"
|
||||||
/ "endorsement" / "delegate" )
|
/ "endorsement" / "delegate" )
|
||||||
|
|
||||||
@ -606,14 +708,16 @@ module Helpers = struct
|
|||||||
module Forge = struct
|
module Forge = struct
|
||||||
|
|
||||||
let operations custom_root =
|
let operations custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Forge an operation"
|
~description:"Forge an operation"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Operation.unsigned_operation_encoding
|
~input: Operation.unsigned_operation_encoding
|
||||||
~output:
|
~output:
|
||||||
(wrap_tzerror @@
|
(wrap_tzerror @@
|
||||||
(obj1
|
(obj1
|
||||||
(req "operation" @@
|
(req "operation" @@
|
||||||
describe ~title: "hex encoded operation" bytes)))
|
describe ~title: "hex encoded operation" bytes)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "forge" / "operations" )
|
RPC.Path.(custom_root / "helpers" / "forge" / "operations" )
|
||||||
|
|
||||||
let empty_proof_of_work_nonce =
|
let empty_proof_of_work_nonce =
|
||||||
@ -621,8 +725,9 @@ module Helpers = struct
|
|||||||
(String.make Constants_repr.proof_of_work_nonce_size '\000')
|
(String.make Constants_repr.proof_of_work_nonce_size '\000')
|
||||||
|
|
||||||
let block_proto_header custom_root =
|
let block_proto_header custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Forge the protocol-specific part of a block header"
|
~description: "Forge the protocol-specific part of a block header"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input:
|
~input:
|
||||||
(obj3
|
(obj3
|
||||||
(req "priority" uint16)
|
(req "priority" uint16)
|
||||||
@ -632,6 +737,7 @@ module Helpers = struct
|
|||||||
Tezos_context.Constants.proof_of_work_nonce_size)
|
Tezos_context.Constants.proof_of_work_nonce_size)
|
||||||
empty_proof_of_work_nonce))
|
empty_proof_of_work_nonce))
|
||||||
~output: (wrap_tzerror bytes)
|
~output: (wrap_tzerror bytes)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "forge" / "block_proto_header")
|
RPC.Path.(custom_root / "helpers" / "forge" / "block_proto_header")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -639,21 +745,25 @@ module Helpers = struct
|
|||||||
module Parse = struct
|
module Parse = struct
|
||||||
|
|
||||||
let operations custom_root =
|
let operations custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Parse operations"
|
~description:"Parse operations"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input:
|
~input:
|
||||||
(obj2
|
(obj2
|
||||||
(req "operations" (list (dynamic_size Operation.raw_encoding)))
|
(req "operations" (list (dynamic_size Operation.raw_encoding)))
|
||||||
(opt "check_signature" bool))
|
(opt "check_signature" bool))
|
||||||
~output:
|
~output:
|
||||||
(wrap_tzerror (list (dynamic_size Operation.encoding)))
|
(wrap_tzerror (list (dynamic_size Operation.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "parse" / "operations" )
|
RPC.Path.(custom_root / "helpers" / "parse" / "operations" )
|
||||||
|
|
||||||
let block custom_root =
|
let block custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Parse a block"
|
~description:"Parse a block"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Block_header.raw_encoding
|
~input: Block_header.raw_encoding
|
||||||
~output: (wrap_tzerror Block_header.proto_header_encoding)
|
~output: (wrap_tzerror Block_header.proto_header_encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "parse" / "block" )
|
RPC.Path.(custom_root / "helpers" / "parse" / "block" )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -32,17 +32,21 @@ let wrap_tzerror encoding =
|
|||||||
]
|
]
|
||||||
|
|
||||||
let echo_service custom_root =
|
let echo_service custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "An dummy echo service"
|
~description: "An dummy echo service"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Data_encoding.(obj1 (req "msg" string))
|
~input: Data_encoding.(obj1 (req "msg" string))
|
||||||
~output: Data_encoding.(obj1 (req "msg" string))
|
~output: Data_encoding.(obj1 (req "msg" string))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "echo")
|
RPC.Path.(custom_root / "echo")
|
||||||
|
|
||||||
let failing_service custom_root =
|
let failing_service custom_root =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "A failing service"
|
~description: "A failing service"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Data_encoding.(obj1 (req "arg" int31))
|
~input: Data_encoding.(obj1 (req "arg" int31))
|
||||||
~output: (wrap_tzerror Data_encoding.empty)
|
~output: (wrap_tzerror Data_encoding.empty)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "failing")
|
RPC.Path.(custom_root / "failing")
|
||||||
|
|
||||||
let rpc_services : Updater.rpc_context RPC.directory =
|
let rpc_services : Updater.rpc_context RPC.directory =
|
||||||
|
@ -34,8 +34,9 @@ let wrap_tzerror encoding =
|
|||||||
module Forge = struct
|
module Forge = struct
|
||||||
let block custom_root =
|
let block custom_root =
|
||||||
let open Data_encoding in
|
let open Data_encoding in
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Forge a block"
|
~description: "Forge a block"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input:
|
~input:
|
||||||
(merge_objs
|
(merge_objs
|
||||||
(obj6
|
(obj6
|
||||||
@ -47,6 +48,7 @@ module Forge = struct
|
|||||||
(req "fitness" Fitness.encoding))
|
(req "fitness" Fitness.encoding))
|
||||||
Data.Command.encoding)
|
Data.Command.encoding)
|
||||||
~output: (obj1 (req "payload" bytes))
|
~output: (obj1 (req "payload" bytes))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(custom_root / "helpers" / "forge" / "block")
|
RPC.Path.(custom_root / "helpers" / "forge" / "block")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -139,17 +139,6 @@ module Service = Resto.MakeService(Data)
|
|||||||
|
|
||||||
(* Compatibility layer, to be removed ASAP. *)
|
(* Compatibility layer, to be removed ASAP. *)
|
||||||
|
|
||||||
let service ?description ~input ~output path =
|
|
||||||
Service.post_service
|
|
||||||
?description
|
|
||||||
~query: Query.empty
|
|
||||||
~input
|
|
||||||
~output
|
|
||||||
~error: Data_encoding.null
|
|
||||||
path
|
|
||||||
|
|
||||||
type directory_descr = Data_encoding.json_schema Description.directory
|
|
||||||
|
|
||||||
let forge_request (type i) (service: (_,_,_,_,i,_,_) Service.t) params body =
|
let forge_request (type i) (service: (_,_,_,_,i,_,_) Service.t) params body =
|
||||||
let { Service.meth ; path } =
|
let { Service.meth ; path } =
|
||||||
Service.forge_request service params () in
|
Service.forge_request service params () in
|
||||||
|
@ -17,15 +17,6 @@ module Service : (module type of struct include Resto.MakeService(Data) end)
|
|||||||
|
|
||||||
(** Compatibility layer, to be removed ASAP. *)
|
(** Compatibility layer, to be removed ASAP. *)
|
||||||
|
|
||||||
val service:
|
|
||||||
?description: string ->
|
|
||||||
input: 'input Data_encoding.t ->
|
|
||||||
output: 'output Data_encoding.t ->
|
|
||||||
('prefix, 'params) Path.t ->
|
|
||||||
([ `POST ], 'prefix, 'params, unit, 'input, 'output, unit) Service.t
|
|
||||||
|
|
||||||
type directory_descr = Data_encoding.json_schema Description.directory
|
|
||||||
|
|
||||||
val forge_request :
|
val forge_request :
|
||||||
(_ , unit, 'params, unit, 'input, 'output, unit) Service.t ->
|
(_ , unit, 'params, unit, 'input, 'output, unit) Service.t ->
|
||||||
'params -> 'input -> MethMap.key * string list * Data_encoding.json
|
'params -> 'input -> MethMap.key * string list * Data_encoding.json
|
||||||
|
@ -12,10 +12,12 @@ open Data_encoding
|
|||||||
module Error = struct
|
module Error = struct
|
||||||
|
|
||||||
let service =
|
let service =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Schema for all the RPC errors from the shell"
|
~description: "Schema for all the RPC errors from the shell"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Data_encoding.empty
|
~input: Data_encoding.empty
|
||||||
~output: Data_encoding.json_schema
|
~output: Data_encoding.json_schema
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "errors")
|
RPC.Path.(root / "errors")
|
||||||
|
|
||||||
let encoding =
|
let encoding =
|
||||||
@ -148,61 +150,77 @@ module Blocks = struct
|
|||||||
RPC.Path.(root / "blocks" /: blocks_arg )
|
RPC.Path.(root / "blocks" /: blocks_arg )
|
||||||
|
|
||||||
let info =
|
let info =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"All the information about a block."
|
~description:"All the information about a block."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (dft "operations" bool true))
|
~input: (obj1 (dft "operations" bool true))
|
||||||
~output: block_info_encoding
|
~output: block_info_encoding
|
||||||
|
~error: Data_encoding.empty
|
||||||
block_path
|
block_path
|
||||||
|
|
||||||
let net_id =
|
let net_id =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the net of the chain in which the block belongs."
|
~description:"Returns the net of the chain in which the block belongs."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "net_id" Net_id.encoding))
|
~output: (obj1 (req "net_id" Net_id.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "net_id")
|
RPC.Path.(block_path / "net_id")
|
||||||
|
|
||||||
let level =
|
let level =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the block's level."
|
~description:"Returns the block's level."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "level" int32))
|
~output: (obj1 (req "level" int32))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "level")
|
RPC.Path.(block_path / "level")
|
||||||
|
|
||||||
let predecessor =
|
let predecessor =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the previous block's id."
|
~description:"Returns the previous block's id."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "predecessor" Block_hash.encoding))
|
~output: (obj1 (req "predecessor" Block_hash.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "predecessor")
|
RPC.Path.(block_path / "predecessor")
|
||||||
|
|
||||||
let predecessors =
|
let predecessors =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"...."
|
"...."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (req "length" Data_encoding.uint16))
|
~input: (obj1 (req "length" Data_encoding.uint16))
|
||||||
~output: (obj1
|
~output: (obj1
|
||||||
(req "blocks" (Data_encoding.list Block_hash.encoding)))
|
(req "blocks" (Data_encoding.list Block_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "predecessors")
|
RPC.Path.(block_path / "predecessors")
|
||||||
|
|
||||||
let hash =
|
let hash =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the block's id."
|
~description:"Returns the block's id."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "hash" Block_hash.encoding))
|
~output: (obj1 (req "hash" Block_hash.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "hash")
|
RPC.Path.(block_path / "hash")
|
||||||
|
|
||||||
let fitness =
|
let fitness =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the block's fitness."
|
~description:"Returns the block's fitness."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "fitness" Fitness.encoding))
|
~output: (obj1 (req "fitness" Fitness.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "fitness")
|
RPC.Path.(block_path / "fitness")
|
||||||
|
|
||||||
let timestamp =
|
let timestamp =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the block's timestamp."
|
~description:"Returns the block's timestamp."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "timestamp" Time.encoding))
|
~output: (obj1 (req "timestamp" Time.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "timestamp")
|
RPC.Path.(block_path / "timestamp")
|
||||||
|
|
||||||
type operations_param = {
|
type operations_param = {
|
||||||
@ -220,8 +238,9 @@ module Blocks = struct
|
|||||||
(dft "monitor" bool false))
|
(dft "monitor" bool false))
|
||||||
|
|
||||||
let operations =
|
let operations =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"List the block operations."
|
~description:"List the block operations."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: operations_param_encoding
|
~input: operations_param_encoding
|
||||||
~output: (obj1
|
~output: (obj1
|
||||||
(req "operations"
|
(req "operations"
|
||||||
@ -230,20 +249,25 @@ module Blocks = struct
|
|||||||
(req "hash" Operation_hash.encoding)
|
(req "hash" Operation_hash.encoding)
|
||||||
(opt "contents"
|
(opt "contents"
|
||||||
(dynamic_size Operation.encoding)))))))
|
(dynamic_size Operation.encoding)))))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "operations")
|
RPC.Path.(block_path / "operations")
|
||||||
|
|
||||||
let protocol =
|
let protocol =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"List the block protocol."
|
~description:"List the block protocol."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj1 (req "protocol" Protocol_hash.encoding))
|
~output: (obj1 (req "protocol" Protocol_hash.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "protocol")
|
RPC.Path.(block_path / "protocol")
|
||||||
|
|
||||||
let test_network =
|
let test_network =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Returns the status of the associated test network."
|
~description:"Returns the status of the associated test network."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: Test_network_status.encoding
|
~output: Test_network_status.encoding
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "test_network")
|
RPC.Path.(block_path / "test_network")
|
||||||
|
|
||||||
let pending_operations =
|
let pending_operations =
|
||||||
@ -252,9 +276,10 @@ module Blocks = struct
|
|||||||
(obj1 (req "hash" Operation_hash.encoding))
|
(obj1 (req "hash" Operation_hash.encoding))
|
||||||
Operation.encoding in
|
Operation.encoding in
|
||||||
(* TODO: branch_delayed/... *)
|
(* TODO: branch_delayed/... *)
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"List the not-yet-prevalidated operations."
|
"List the not-yet-prevalidated operations."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output:
|
~output:
|
||||||
(conv
|
(conv
|
||||||
@ -271,6 +296,7 @@ module Blocks = struct
|
|||||||
(dynamic_size
|
(dynamic_size
|
||||||
(Preapply_result.encoding Error.encoding))
|
(Preapply_result.encoding Error.encoding))
|
||||||
(obj1 (req "unprocessed" (list (dynamic_size operation_encoding))))))
|
(obj1 (req "unprocessed" (list (dynamic_size operation_encoding))))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "pending_operations")
|
RPC.Path.(block_path / "pending_operations")
|
||||||
|
|
||||||
let proto_path =
|
let proto_path =
|
||||||
@ -312,12 +338,14 @@ module Blocks = struct
|
|||||||
(Preapply_result.encoding Error.encoding))))
|
(Preapply_result.encoding Error.encoding))))
|
||||||
|
|
||||||
let preapply =
|
let preapply =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"Simulate the validation of a block that would contain \
|
"Simulate the validation of a block that would contain \
|
||||||
the given operations and return the resulting fitness."
|
the given operations and return the resulting fitness."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: preapply_param_encoding
|
~input: preapply_param_encoding
|
||||||
~output: (Error.wrap preapply_result_encoding)
|
~output: (Error.wrap preapply_result_encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "preapply")
|
RPC.Path.(block_path / "preapply")
|
||||||
|
|
||||||
let complete =
|
let complete =
|
||||||
@ -325,12 +353,14 @@ module Blocks = struct
|
|||||||
let destruct s = Ok s
|
let destruct s = Ok s
|
||||||
and construct s = s in
|
and construct s = s in
|
||||||
RPC.Arg.make ~name:"prefix" ~destruct ~construct () in
|
RPC.Arg.make ~name:"prefix" ~destruct ~construct () in
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Try to complete a prefix of a Base58Check-encoded data. \
|
~description: "Try to complete a prefix of a Base58Check-encoded data. \
|
||||||
This RPC is actually able to complete hashes of \
|
This RPC is actually able to complete hashes of \
|
||||||
block, operations, public_keys and contracts."
|
block, operations, public_keys and contracts."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (list string)
|
~output: (list string)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(block_path / "complete" /: prefix_arg )
|
RPC.Path.(block_path / "complete" /: prefix_arg )
|
||||||
|
|
||||||
type list_param = {
|
type list_param = {
|
||||||
@ -399,26 +429,30 @@ module Blocks = struct
|
|||||||
int31)))
|
int31)))
|
||||||
|
|
||||||
let list =
|
let list =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"Lists known heads of the blockchain sorted with decreasing fitness. \
|
"Lists known heads of the blockchain sorted with decreasing fitness. \
|
||||||
Optional arguments allows to returns the list of predecessors for \
|
Optional arguments allows to returns the list of predecessors for \
|
||||||
known heads or the list of predecessors for a given list of blocks."
|
known heads or the list of predecessors for a given list of blocks."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: list_param_encoding
|
~input: list_param_encoding
|
||||||
~output: (obj1 (req "blocks" (list (list block_info_encoding))))
|
~output: (obj1 (req "blocks" (list (list block_info_encoding))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "blocks")
|
RPC.Path.(root / "blocks")
|
||||||
|
|
||||||
let list_invalid =
|
let list_invalid =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"Lists blocks that have been declared invalid along with the errors\
|
"Lists blocks that have been declared invalid along with the errors\
|
||||||
that led to them being declared invalid"
|
that led to them being declared invalid"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input:empty
|
~input:empty
|
||||||
~output:(Data_encoding.list
|
~output:(Data_encoding.list
|
||||||
(obj3
|
(obj3
|
||||||
(req "block" Block_hash.encoding)
|
(req "block" Block_hash.encoding)
|
||||||
(req "level" int32)
|
(req "level" int32)
|
||||||
(req "errors" Error.encoding)))
|
(req "errors" Error.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "invalid_blocks")
|
RPC.Path.(root / "invalid_blocks")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -436,12 +470,14 @@ module Protocols = struct
|
|||||||
RPC.Arg.make ~name ~descr ~construct ~destruct ()
|
RPC.Arg.make ~name ~descr ~construct ~destruct ()
|
||||||
|
|
||||||
let contents =
|
let contents =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output:
|
~output:
|
||||||
(obj1 (req "data"
|
(obj1 (req "data"
|
||||||
(describe ~title: "Tezos protocol"
|
(describe ~title: "Tezos protocol"
|
||||||
(Protocol.encoding))))
|
(Protocol.encoding))))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "protocols" /: protocols_arg)
|
RPC.Path.(root / "protocols" /: protocols_arg)
|
||||||
|
|
||||||
type list_param = {
|
type list_param = {
|
||||||
@ -458,7 +494,8 @@ module Protocols = struct
|
|||||||
(opt "monitor" bool))
|
(opt "monitor" bool))
|
||||||
|
|
||||||
let list =
|
let list =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: list_param_encoding
|
~input: list_param_encoding
|
||||||
~output:
|
~output:
|
||||||
(obj1
|
(obj1
|
||||||
@ -469,6 +506,7 @@ module Protocols = struct
|
|||||||
(opt "contents"
|
(opt "contents"
|
||||||
(dynamic_size Protocol.encoding)))
|
(dynamic_size Protocol.encoding)))
|
||||||
)))
|
)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "protocols")
|
RPC.Path.(root / "protocols")
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -496,31 +534,39 @@ module Network = struct
|
|||||||
()
|
()
|
||||||
|
|
||||||
let versions =
|
let versions =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Supported network layer versions."
|
~description:"Supported network layer versions."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (list P2p_types.Version.encoding)
|
~output: (list P2p_types.Version.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "network" / "versions")
|
RPC.Path.(root / "network" / "versions")
|
||||||
|
|
||||||
let stat =
|
let stat =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Global network bandwidth statistics in B/s."
|
~description:"Global network bandwidth statistics in B/s."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: P2p_types.Stat.encoding
|
~output: P2p_types.Stat.encoding
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "network" / "stat")
|
RPC.Path.(root / "network" / "stat")
|
||||||
|
|
||||||
let events =
|
let events =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Stream of all network events"
|
~description:"Stream of all network events"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: P2p_types.Connection_pool_log_event.encoding
|
~output: P2p_types.Connection_pool_log_event.encoding
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "network" / "log")
|
RPC.Path.(root / "network" / "log")
|
||||||
|
|
||||||
let connect =
|
let connect =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"Connect to a peer"
|
~description:"Connect to a peer"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (dft "timeout" float 5.))
|
~input: (obj1 (dft "timeout" float 5.))
|
||||||
~output: (Error.wrap @@ empty)
|
~output: (Error.wrap @@ empty)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "network" / "connect" /: point_arg)
|
RPC.Path.(root / "network" / "connect" /: point_arg)
|
||||||
|
|
||||||
let monitor_encoding = obj1 (dft "monitor" bool false)
|
let monitor_encoding = obj1 (dft "monitor" bool false)
|
||||||
@ -528,23 +574,29 @@ module Network = struct
|
|||||||
module Connection = struct
|
module Connection = struct
|
||||||
|
|
||||||
let list =
|
let list =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:"List the running P2P connection."
|
~description:"List the running P2P connection."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (list P2p_types.Connection_info.encoding)
|
~output: (list P2p_types.Connection_info.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "network" / "connection")
|
RPC.Path.(root / "network" / "connection")
|
||||||
|
|
||||||
let info =
|
let info =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (option P2p_types.Connection_info.encoding)
|
~output: (option P2p_types.Connection_info.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description:"Details about the current P2P connection to the given peer."
|
~description:"Details about the current P2P connection to the given peer."
|
||||||
RPC.Path.(root / "network" / "connection" /: peer_id_arg)
|
RPC.Path.(root / "network" / "connection" /: peer_id_arg)
|
||||||
|
|
||||||
let kick =
|
let kick =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: (obj1 (req "wait" bool))
|
~input: (obj1 (req "wait" bool))
|
||||||
~output: empty
|
~output: empty
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description:"Forced close of the current P2P connection to the given peer."
|
~description:"Forced close of the current P2P connection to the given peer."
|
||||||
RPC.Path.(root / "network" / "connection" /: peer_id_arg / "kick")
|
RPC.Path.(root / "network" / "connection" /: peer_id_arg / "kick")
|
||||||
|
|
||||||
@ -553,28 +605,34 @@ module Network = struct
|
|||||||
module Point = struct
|
module Point = struct
|
||||||
|
|
||||||
let info =
|
let info =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (option P2p_types.Point_info.encoding)
|
~output: (option P2p_types.Point_info.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description: "Details about a given `IP:addr`."
|
~description: "Details about a given `IP:addr`."
|
||||||
RPC.Path.(root / "network" / "point" /: point_arg)
|
RPC.Path.(root / "network" / "point" /: point_arg)
|
||||||
|
|
||||||
let events =
|
let events =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: monitor_encoding
|
~input: monitor_encoding
|
||||||
~output: (list P2p_connection_pool_types.Point_info.Event.encoding)
|
~output: (list P2p_connection_pool_types.Point_info.Event.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description: "Monitor network events related to an `IP:addr`."
|
~description: "Monitor network events related to an `IP:addr`."
|
||||||
RPC.Path.(root / "network" / "point" /: point_arg / "log")
|
RPC.Path.(root / "network" / "point" /: point_arg / "log")
|
||||||
|
|
||||||
let list =
|
let list =
|
||||||
let filter =
|
let filter =
|
||||||
obj1 (dft "filter" (list P2p_types.Point_state.encoding) []) in
|
obj1 (dft "filter" (list P2p_types.Point_state.encoding) []) in
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: filter
|
~input: filter
|
||||||
~output:
|
~output:
|
||||||
(list (tup2
|
(list (tup2
|
||||||
P2p_types.Point.encoding
|
P2p_types.Point.encoding
|
||||||
P2p_types.Point_info.encoding))
|
P2p_types.Point_info.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description:"List the pool of known `IP:port` \
|
~description:"List the pool of known `IP:port` \
|
||||||
used for establishing P2P connections ."
|
used for establishing P2P connections ."
|
||||||
RPC.Path.(root / "network" / "point")
|
RPC.Path.(root / "network" / "point")
|
||||||
@ -584,28 +642,34 @@ module Network = struct
|
|||||||
module Peer_id = struct
|
module Peer_id = struct
|
||||||
|
|
||||||
let info =
|
let info =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (option P2p_types.Peer_info.encoding)
|
~output: (option P2p_types.Peer_info.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description:"Details about a given peer."
|
~description:"Details about a given peer."
|
||||||
RPC.Path.(root / "network" / "peer_id" /: peer_id_arg)
|
RPC.Path.(root / "network" / "peer_id" /: peer_id_arg)
|
||||||
|
|
||||||
let events =
|
let events =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: monitor_encoding
|
~input: monitor_encoding
|
||||||
~output: (list P2p_connection_pool_types.Peer_info.Event.encoding)
|
~output: (list P2p_connection_pool_types.Peer_info.Event.encoding)
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description:"Monitor network events related to a given peer."
|
~description:"Monitor network events related to a given peer."
|
||||||
RPC.Path.(root / "network" / "peer_id" /: peer_id_arg / "log")
|
RPC.Path.(root / "network" / "peer_id" /: peer_id_arg / "log")
|
||||||
|
|
||||||
let list =
|
let list =
|
||||||
let filter =
|
let filter =
|
||||||
obj1 (dft "filter" (list P2p_types.Peer_state.encoding) []) in
|
obj1 (dft "filter" (list P2p_types.Peer_state.encoding) []) in
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: filter
|
~input: filter
|
||||||
~output:
|
~output:
|
||||||
(list (tup2
|
(list (tup2
|
||||||
P2p_types.Peer_id.encoding
|
P2p_types.Peer_id.encoding
|
||||||
P2p_types.Peer_info.encoding))
|
P2p_types.Peer_info.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
~description:"List the peers the node ever met."
|
~description:"List the peers the node ever met."
|
||||||
RPC.Path.(root / "network" / "peer_id")
|
RPC.Path.(root / "network" / "peer_id")
|
||||||
|
|
||||||
@ -614,10 +678,12 @@ module Network = struct
|
|||||||
end
|
end
|
||||||
|
|
||||||
let forge_block_header =
|
let forge_block_header =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Forge a block header"
|
~description: "Forge a block header"
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: Block_header.encoding
|
~input: Block_header.encoding
|
||||||
~output: (obj1 (req "block" bytes))
|
~output: (obj1 (req "block" bytes))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "forge_block_header")
|
RPC.Path.(root / "forge_block_header")
|
||||||
|
|
||||||
type inject_block_param = {
|
type inject_block_param = {
|
||||||
@ -657,7 +723,7 @@ let inject_block_param =
|
|||||||
(list (list (dynamic_size Operation.encoding))))))
|
(list (list (dynamic_size Operation.encoding))))))
|
||||||
|
|
||||||
let inject_block =
|
let inject_block =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"Inject a block in the node and broadcast it. The `operations` \
|
"Inject a block in the node and broadcast it. The `operations` \
|
||||||
embedded in `blockHeader` might be pre-validated using a \
|
embedded in `blockHeader` might be pre-validated using a \
|
||||||
@ -665,14 +731,16 @@ let inject_block =
|
|||||||
(e.g. '/blocks/head/context/preapply'). Returns the ID of the \
|
(e.g. '/blocks/head/context/preapply'). Returns the ID of the \
|
||||||
block. By default, the RPC will wait for the block to be \
|
block. By default, the RPC will wait for the block to be \
|
||||||
validated before answering."
|
validated before answering."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: inject_block_param
|
~input: inject_block_param
|
||||||
~output:
|
~output:
|
||||||
(Error.wrap @@
|
(Error.wrap @@
|
||||||
(obj1 (req "block_hash" Block_hash.encoding)))
|
(obj1 (req "block_hash" Block_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "inject_block")
|
RPC.Path.(root / "inject_block")
|
||||||
|
|
||||||
let inject_operation =
|
let inject_operation =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"Inject an operation in node and broadcast it. Returns the \
|
"Inject an operation in node and broadcast it. Returns the \
|
||||||
ID of the operation. The `signedOperationContents` should be \
|
ID of the operation. The `signedOperationContents` should be \
|
||||||
@ -681,6 +749,7 @@ let inject_operation =
|
|||||||
the operation to be (pre-)validated before answering. See \
|
the operation to be (pre-)validated before answering. See \
|
||||||
RPCs under /blocks/prevalidation for more details on the \
|
RPCs under /blocks/prevalidation for more details on the \
|
||||||
prevalidation context."
|
prevalidation context."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input:
|
~input:
|
||||||
(obj4
|
(obj4
|
||||||
(req "signedOperationContents"
|
(req "signedOperationContents"
|
||||||
@ -705,12 +774,14 @@ let inject_operation =
|
|||||||
describe
|
describe
|
||||||
~title: "Hash of the injected operation" @@
|
~title: "Hash of the injected operation" @@
|
||||||
(obj1 (req "injectedOperation" Operation_hash.encoding)))
|
(obj1 (req "injectedOperation" Operation_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "inject_operation")
|
RPC.Path.(root / "inject_operation")
|
||||||
|
|
||||||
let inject_protocol =
|
let inject_protocol =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:
|
~description:
|
||||||
"Inject a protocol in node. Returns the ID of the protocol."
|
"Inject a protocol in node. Returns the ID of the protocol."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input:
|
~input:
|
||||||
(obj3
|
(obj3
|
||||||
(req "protocol"
|
(req "protocol"
|
||||||
@ -732,15 +803,18 @@ let inject_protocol =
|
|||||||
describe
|
describe
|
||||||
~title: "Hash of the injected protocol" @@
|
~title: "Hash of the injected protocol" @@
|
||||||
(obj1 (req "injectedProtocol" Protocol_hash.encoding)))
|
(obj1 (req "injectedProtocol" Protocol_hash.encoding)))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "inject_protocol")
|
RPC.Path.(root / "inject_protocol")
|
||||||
|
|
||||||
let bootstrapped =
|
let bootstrapped =
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description:""
|
~description:""
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (obj2
|
~output: (obj2
|
||||||
(req "block" Block_hash.encoding)
|
(req "block" Block_hash.encoding)
|
||||||
(req "timestamp" Time.encoding))
|
(req "timestamp" Time.encoding))
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "bootstrapped")
|
RPC.Path.(root / "bootstrapped")
|
||||||
|
|
||||||
let complete =
|
let complete =
|
||||||
@ -748,12 +822,14 @@ let complete =
|
|||||||
let destruct s = Ok s
|
let destruct s = Ok s
|
||||||
and construct s = s in
|
and construct s = s in
|
||||||
RPC.Arg.make ~name:"prefix" ~destruct ~construct () in
|
RPC.Arg.make ~name:"prefix" ~destruct ~construct () in
|
||||||
RPC.service
|
RPC.Service.post_service
|
||||||
~description: "Try to complete a prefix of a Base58Check-encoded data. \
|
~description: "Try to complete a prefix of a Base58Check-encoded data. \
|
||||||
This RPC is actually able to complete hashes of \
|
This RPC is actually able to complete hashes of \
|
||||||
block and hashes of operations."
|
block and hashes of operations."
|
||||||
|
~query: RPC.Query.empty
|
||||||
~input: empty
|
~input: empty
|
||||||
~output: (list string)
|
~output: (list string)
|
||||||
|
~error: Data_encoding.empty
|
||||||
RPC.Path.(root / "complete" /: prefix_arg )
|
RPC.Path.(root / "complete" /: prefix_arg )
|
||||||
|
|
||||||
let describe =
|
let describe =
|
||||||
|
@ -293,13 +293,6 @@ end
|
|||||||
|
|
||||||
type 'a directory = 'a Directory.t
|
type 'a directory = 'a Directory.t
|
||||||
|
|
||||||
val service:
|
|
||||||
?description: string ->
|
|
||||||
input: 'input Data_encoding.t ->
|
|
||||||
output: 'output Data_encoding.t ->
|
|
||||||
('prefix, 'params) Path.t ->
|
|
||||||
([ `POST], 'prefix, 'params, unit, 'input, 'output, unit) Service.t
|
|
||||||
|
|
||||||
val register:
|
val register:
|
||||||
'prefix directory ->
|
'prefix directory ->
|
||||||
([ `POST ], 'prefix,
|
([ `POST ], 'prefix,
|
||||||
|
Loading…
Reference in New Issue
Block a user