Run profiler with remote state and contract
Is your feature request related to a problem? Please describe. Usually for profiling, developer wants to use an existing contract with some pre-existing state. For example from Testnet.
Describe the solution you'd like
Add profile option to near-cli for developers:
export NEAR_ENV=<network>
near profile <contract_name> <method_name> <args>
This can pull the contract and state via RPC and leverage https://github.com/nearprotocol/nearcore/pull/3038 to run the profiler and output the profile.
Describe alternatives you've considered
Alternative is that this option should be added to the runtime standalone.
But developers are getting familiar with near tool so it could be good to leave it within familiar context.
Profiler just got merged, so feel free to use it.