rpc mining api and test