adm: Add commands to invoke methods of policy
contract #868
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#868
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/cmd-invoke-policy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #834
Added new three commands:
frostfs-adm morph ape add-rule-chain
frostfs-adm morph ape list-rule-chains
frostfs-adm morph ape rm-rule-chain
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -39,2 +41,4 @@
protoConfigPath = "protocol"
walletAddressFlag = "wallet-address"
jsonFlag = "json"
jsonFlagDesc = "Output rule chains in JSON format"
Is naming agreed?
What about
put-policy
,delete-policy
,policy-id
,policy
,policy-json
and so on? It sounds clearer this way I think.No, names for commands can be discussed. @fyrchik, @aarifullin your thoughts?
@dstepanov-yadro , if you look at
frostfs-adm
modules, then you will see already usedpolicy
module and a user can misinterpret flags withpolicy
prefixI would add
frostfs-adm morph ape
command withadd-chain
etc. subcommands.Absolutely agree, now
morph
looks too big.@ -0,0 +84,4 @@
}
err := chain.DecodeBytes(rule)
commonCmd.ExitOnErr(cmd, "chain decode error: %w", err)
}
I suppose we need
meaning a rule has been given neither by json nor by statement
Agree, fixed.
@ -0,0 +94,4 @@
chain := parseChain(cmd)
target := parseTarget(cmd)
pci := newPolicyContractInterface(cmd)
_, _, err := pci.AddMorphRuleChain(apechain.Ingress, target, chain)
After
MorphRuleChainStorage
's methods have been changed, sinceAddMorphRuleChain
andRemoveMorphRuleChain
returntxHash util.Uint256, vub uint32
.@fyrchik, could you tell, please. Do we need to
awaitTx
here?The current way to await a transaction is not applicable for the contract interface because it is a part of
initializeContext
where contracts are invoked in another mannerYes, we receive hash and VUB, we need to poll until VUB block and then check that tx with
hash
exists.Added wait for result.
4d8ae74d9d
toe8a362ab33
e8a362ab33
toefb3f55c9c
efb3f55c9c
to79fe04650c
79fe04650c
tod5771fc967
@ -239,2 +253,4 @@
Run: listNetmapCandidatesNodes,
}
addRuleChainCmd = &cobra.Command{
Can we make it a separate subcommand to group this?
Moved all new commands under
frostfs-adm morph ape
.d5771fc967
to32f4e72e6a