[#270] Add IR epoch tick control call

Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
Alejandro Lopez 2023-04-25 15:09:20 +03:00 committed by Evgenii Stratonikov
parent 58f1ba4b51
commit ff25521204
20 changed files with 711 additions and 127 deletions

View file

@ -8,10 +8,14 @@ import (
// NewEpoch updates FrostFS epoch number through
// Netmap contract call.
func (c *Client) NewEpoch(epoch uint64) error {
// If `force` is true, this call is normally initiated by a control
// service command and uses a control notary transaction internally
// to ensure all nodes produce the same transaction with high probability.
func (c *Client) NewEpoch(epoch uint64, force bool) error {
prm := client.InvokePrm{}
prm.SetMethod(newEpochMethod)
prm.SetArgs(epoch)
prm.SetControlTX(force)
if err := c.client.Invoke(prm); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)