{"modulePath":"github.com/polynetwork/poly","version":"v1.8.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Constants\n\n```go\nconst (\n\tDEFAULT_COMPRESS_TYPE         = COMPRESS_TYPE_ZLIB\n\tEXPORT_BLOCK_METADATA_LEN     = 256\n\tEXPORT_BLOCK_METADATA_VERSION = 1\n)\n```\n\n```go\nconst (\n\tDEFAULT_EXPORT_FILE   = \"./OntBlocks.dat\"\n\tDEFAULT_ABI_PATH      = \"./abi\"\n\tDEFAULT_EXPORT_HEIGHT = 0\n\tDEFAULT_WALLET_PATH   = \"./wallet_data\"\n)\n```\n\n```go\nconst (\n\tPARAMS_SPLIT          = \",\"\n\tPARAM_TYPE_SPLIT      = \":\"\n\tPARAM_TYPE_ARRAY      = \"array\"\n\tPARAM_TYPE_BYTE_ARRAY = \"bytearray\"\n\tPARAM_TYPE_STRING     = \"string\"\n\tPARAM_TYPE_INTEGER    = \"int\"\n\tPARAM_TYPE_BOOLEAN    = \"bool\"\n\tPARAM_LEFT_BRACKET    = \"[\"\n\tPARAM_RIGHT_BRACKET   = \"]\"\n\tPARAM_ESC_CHAR        = `/`\n)\n```\n\n```go\nconst (\n\tERROR_INVALID_PARAMS   = rpcerr.INVALID_PARAMS\n\tERROR_ONTOLOGY_COMMON  = 10000\n\tERROR_ONTOLOGY_SUCCESS = 0\n)\n```\n\n```go\nconst (\n\tCOMPRESS_TYPE_ZLIB = iota\n)\n```\n\n```go\nconst JSON_RPC_VERSION = \"2.0\"\n```\nJsonRpc version\n\n## Variables\n\n```go\nvar (\n\t//Ontology setting\n\tConfigFlag = cli.StringFlag{\n\t\tName:  \"config\",\n\t\tUsage: \"Genesis block config `\u003cfile\u003e`. If doesn't specifies, use main net config as default.\",\n\t}\n\tLogLevelFlag = cli.UintFlag{\n\t\tName:  \"loglevel\",\n\t\tUsage: \"Set the log level to `\u003clevel\u003e` (0~6). 0:Trace 1:Debug 2:Info 3:Warn 4:Error 5:Fatal 6:MaxLevel\",\n\t\tValue: config.DEFAULT_LOG_LEVEL,\n\t}\n\tDisableEventLogFlag = cli.BoolFlag{\n\t\tName:  \"disable-event-log\",\n\t\tUsage: \"Discard event log output by smart contract execution\",\n\t}\n\tWalletFileFlag = cli.StringFlag{\n\t\tName:  \"wallet,w\",\n\t\tValue: config.DEFAULT_WALLET_FILE_NAME,\n\t\tUsage: \"Wallet `\u003cfile\u003e`\",\n\t}\n\tImportFileFlag = cli.StringFlag{\n\t\tName:  \"import-file\",\n\t\tUsage: \"Path of import `\u003cfile\u003e`\",\n\t\tValue: DEFAULT_EXPORT_FILE,\n\t}\n\tImportEndHeightFlag = cli.UintFlag{\n\t\tName:  \"end-height\",\n\t\tUsage: \"Stop import block `\u003cheight\u003e` of the import.\",\n\t\tValue: DEFAULT_EXPORT_HEIGHT,\n\t}\n\tDataDirFlag = cli.StringFlag{\n\t\tName:  \"data-dir\",\n\t\tUsage: \"Block data storage `\u003cpath\u003e`\",\n\t\tValue: config.DEFAULT_DATA_DIR,\n\t}\n\n\t//Consensus setting\n\tEnableConsensusFlag = cli.BoolFlag{\n\t\tName:  \"enable-consensus\",\n\t\tUsage: \"Start consensus module\",\n\t}\n\tMaxTxInBlockFlag = cli.IntFlag{\n\t\tName:  \"max-tx-in-block\",\n\t\tUsage: \"Max transaction `\u003cnumber\u003e` in block\",\n\t\tValue: config.DEFAULT_MAX_TX_IN_BLOCK,\n\t}\n\n\t//Test Mode setting\n\tEnableTestModeFlag = cli.BoolFlag{\n\t\tName:  \"testmode\",\n\t\tUsage: \"Single node network for testing. In test mode, will start rpc, rest, web socket server, and set default gasprice to 0\",\n\t}\n\tTestModeGenBlockTimeFlag = cli.UintFlag{\n\t\tName:  \"testmode-gen-block-time\",\n\t\tUsage: \"Block-out `\u003ctime\u003e`(s) in test mode.\",\n\t\tValue: config.DEFAULT_GEN_BLOCK_TIME,\n\t}\n\n\t//P2P setting\n\tReservedPeersOnlyFlag = cli.BoolFlag{\n\t\tName:  \"reserved-only\",\n\t\tUsage: \"Connect reserved peers only. Reserved peers are configured with --reserved-file.\",\n\t}\n\tReservedPeersFileFlag = cli.StringFlag{\n\t\tName:  \"reserved-file\",\n\t\tUsage: \"Reserved peers `\u003cfile\u003e`\",\n\t\tValue: config.DEFAULT_RESERVED_FILE,\n\t}\n\tNetworkIdFlag = cli.UintFlag{\n\t\tName:  \"networkid\",\n\t\tUsage: \"Network id `\u003cnumber\u003e`. 1=ontology main net, 2=polaris test net, 3=testmode, and other for custom network\",\n\t\tValue: config.NETWORK_ID_MAIN_NET,\n\t}\n\tNodePortFlag = cli.UintFlag{\n\t\tName:  \"nodeport\",\n\t\tUsage: \"P2P network port `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_NODE_PORT,\n\t}\n\tDualPortSupportFlag = cli.BoolFlag{\n\t\tName:  \"dual-port\",\n\t\tUsage: \"Enable a dual network, P2P network for transaction messages and for consensus messages.\",\n\t}\n\tConsensusPortFlag = cli.UintFlag{\n\t\tName:  \"consensus-port\",\n\t\tUsage: \"Consensus network port `\u003cnumber\u003e`. Effectively after set --dual-port parameter\",\n\t\tValue: config.DEFAULT_CONSENSUS_PORT,\n\t}\n\tHttpInfoPortFlag = cli.UintFlag{\n\t\tName:  \"httpinfo-port\",\n\t\tUsage: \"The listening port of http server for viewing node information `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_HTTP_INFO_PORT,\n\t}\n\tMaxConnInBoundFlag = cli.UintFlag{\n\t\tName:  \"max-conn-in-bound\",\n\t\tUsage: \"Max connection `\u003cnumber\u003e` in bound\",\n\t\tValue: config.DEFAULT_MAX_CONN_IN_BOUND,\n\t}\n\tMaxConnOutBoundFlag = cli.UintFlag{\n\t\tName:  \"max-conn-out-bound\",\n\t\tUsage: \"Max connection `\u003cnumber\u003e` out bound\",\n\t\tValue: config.DEFAULT_MAX_CONN_OUT_BOUND,\n\t}\n\tMaxConnInBoundForSingleIPFlag = cli.UintFlag{\n\t\tName:  \"max-conn-in-bound-single-ip\",\n\t\tUsage: \"Max connection `\u003cnumber\u003e` in bound for single ip\",\n\t\tValue: config.DEFAULT_MAX_CONN_IN_BOUND_FOR_SINGLE_IP,\n\t}\n\t// RPC settings\n\tRPCDisabledFlag = cli.BoolFlag{\n\t\tName:  \"disable-rpc\",\n\t\tUsage: \"Shut down the rpc server.\",\n\t}\n\tRPCPortFlag = cli.UintFlag{\n\t\tName:  \"rpcport\",\n\t\tUsage: \"Json rpc server listening port `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_RPC_PORT,\n\t}\n\tRPCLocalEnableFlag = cli.BoolFlag{\n\t\tName:  \"localrpc\",\n\t\tUsage: \"Enable local rpc server\",\n\t}\n\tRPCLocalProtFlag = cli.UintFlag{\n\t\tName:  \"localrpcport\",\n\t\tUsage: \"Json rpc local server listening port `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_RPC_LOCAL_PORT,\n\t}\n\n\t//Websocket setting\n\tWsEnabledFlag = cli.BoolFlag{\n\t\tName:  \"ws\",\n\t\tUsage: \"Enable web socket server\",\n\t}\n\tWsPortFlag = cli.UintFlag{\n\t\tName:  \"wsport\",\n\t\tUsage: \"Ws server listening port `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_WS_PORT,\n\t}\n\n\t//Restful setting\n\tRestfulEnableFlag = cli.BoolFlag{\n\t\tName:  \"rest\",\n\t\tUsage: \"Enable restful api server\",\n\t}\n\tRestfulPortFlag = cli.UintFlag{\n\t\tName:  \"restport\",\n\t\tUsage: \"Restful server listening port `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_REST_PORT,\n\t}\n\tRestfulMaxConnsFlag = cli.UintFlag{\n\t\tName:  \"restmaxconns\",\n\t\tUsage: \"Restful server maximum connections `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_REST_MAX_CONN,\n\t}\n\n\t//Account setting\n\tAccountPassFlag = cli.StringFlag{\n\t\tName:   \"password,p\",\n\t\tHidden: true,\n\t\tUsage:  \"Account `\u003cpassword\u003e` when Ontology node starts.\",\n\t}\n\tAccountAddressFlag = cli.StringFlag{\n\t\tName:  \"account,a\",\n\t\tUsage: \"Account `\u003caddress\u003e` when the Ontology node starts. If not specific, using default account instead\",\n\t}\n\tAccountDefaultFlag = cli.BoolFlag{\n\t\tName:  \"default,d\",\n\t\tUsage: \"Default settings to create a new account (equal to '-t ecdsa -b 256 -s SHA256withECDSA')\",\n\t}\n\tAccountTypeFlag = cli.StringFlag{\n\t\tName:  \"type,t\",\n\t\tUsage: \"Specifies the `\u003ckey-type\u003e` by signature algorithm.\",\n\t}\n\tAccountKeylenFlag = cli.StringFlag{\n\t\tName:  \"bit-length,b\",\n\t\tUsage: \"Specifies the `\u003cbit-length\u003e` of key\",\n\t}\n\tAccountSigSchemeFlag = cli.StringFlag{\n\t\tName:  \"signature-scheme,s\",\n\t\tUsage: \"Specifies the signature scheme `\u003cscheme\u003e`\",\n\t}\n\tAccountSetDefaultFlag = cli.BoolFlag{\n\t\tName:  \"as-default,d\",\n\t\tUsage: \"Set the specified account to default account of wallet\",\n\t}\n\tAccountQuantityFlag = cli.UintFlag{\n\t\tName:  \"number,n\",\n\t\tValue: 1,\n\t\tUsage: \"Specifies the `\u003cquantity\u003e` of account to create.\",\n\t}\n\tAccountSourceFileFlag = cli.StringFlag{\n\t\tName:  \"source,s\",\n\t\tUsage: \"Source wallet `\u003cfile\u003e` to import\",\n\t}\n\tAccountLabelFlag = cli.StringFlag{\n\t\tName:  \"label,l\",\n\t\tUsage: \"Set account `\u003clabel\u003e` for easy and fast use of accounts.\",\n\t}\n\tAccountKeyFlag = cli.StringFlag{\n\t\tName:  \"key,k\",\n\t\tUsage: \"Use `\u003cprivate key\u003e` (hex encoding) of the account\",\n\t}\n\tAccountVerboseFlag = cli.BoolFlag{\n\t\tName:  \"verbose,v\",\n\t\tUsage: \"Display accounts with details\",\n\t}\n\tAccountChangePasswdFlag = cli.BoolFlag{\n\t\tName:  \"change-passwd\",\n\t\tUsage: \"Change account password\",\n\t}\n\tAccountLowSecurityFlag = cli.BoolFlag{\n\t\tName:  \"low-security\",\n\t\tUsage: \"Change account to low protection strength for low performance devices\",\n\t}\n\tAccountWIFFlag = cli.BoolFlag{\n\t\tName:  \"wif\",\n\t\tUsage: \"Import WIF keys from the source file specified by --source option\",\n\t}\n\tAccountMultiMFlag = cli.UintFlag{\n\t\tName:  \"m\",\n\t\tUsage: \"Min signature `\u003cnumber\u003e` of multi signature address\",\n\t\tValue: 1,\n\t}\n\tAccountMultiPubKeyFlag = cli.StringFlag{\n\t\tName:  \"pubkey\",\n\t\tUsage: \"Pub key list of multi `\u003caddresses\u003e`, separate addreses with comma `,`\",\n\t}\n\tIdentityFlag = cli.BoolFlag{\n\t\tName:  \"ontid\",\n\t\tUsage: \"create an ONT ID instead of account\",\n\t}\n\n\t//SmartContract setting\n\tContractAddrFlag = cli.StringFlag{\n\t\tName:  \"address\",\n\t\tUsage: \"Contract `\u003caddress\u003e`\",\n\t}\n\tContractStorageFlag = cli.BoolFlag{\n\t\tName:  \"needstore\",\n\t\tUsage: \"Is need use storage in contract\",\n\t}\n\tContractCodeFileFlag = cli.StringFlag{\n\t\tName:  \"code\",\n\t\tUsage: \"File path of contract code `\u003cpath\u003e`\",\n\t}\n\tContractNameFlag = cli.StringFlag{\n\t\tName:  \"name\",\n\t\tUsage: \"Specifies contract name to `\u003cname\u003e`\",\n\t}\n\tContractVersionFlag = cli.StringFlag{\n\t\tName:  \"version\",\n\t\tUsage: \"Specifies contract version to `\u003cver\u003e`\",\n\t}\n\tContractAuthorFlag = cli.StringFlag{\n\t\tName:  \"author\",\n\t\tUsage: \"Set `\u003caddress\u003e` as the contract owner\",\n\t\tValue: \"\",\n\t}\n\tContractEmailFlag = cli.StringFlag{\n\t\tName:  \"email\",\n\t\tUsage: \"Set `\u003cemail\u003e` owner's email address\",\n\t\tValue: \"\",\n\t}\n\tContractDescFlag = cli.StringFlag{\n\t\tName:  \"desc\",\n\t\tUsage: \"Set `\u003ctext\u003e` as the description of the contract\",\n\t\tValue: \"\",\n\t}\n\tContractParamsFlag = cli.StringFlag{\n\t\tName:  \"params\",\n\t\tUsage: \"Contract parameters list to invoke. separate params with comma ','\",\n\t}\n\tContractPrepareDeployFlag = cli.BoolFlag{\n\t\tName:  \"prepare,p\",\n\t\tUsage: \"Prepare deploy contract without commit to ledger\",\n\t}\n\tContractPrepareInvokeFlag = cli.BoolFlag{\n\t\tName:  \"prepare,p\",\n\t\tUsage: \"Prepare invoke contract without commit to ledger\",\n\t}\n\tContractReturnTypeFlag = cli.StringFlag{\n\t\tName:  \"return\",\n\t\tUsage: \"Return `\u003ctype\u003e` of contract. bytearray(hexstring), string, integer, boolean\",\n\t}\n\n\t//information cmd settings\n\tBlockHashInfoFlag = cli.StringFlag{\n\t\tName:  \"hash\",\n\t\tUsage: \"Get block info by block hash\",\n\t}\n\tBlockHeightInfoFlag = cli.UintFlag{\n\t\tName:  \"height\",\n\t\tUsage: \"Get block info by block height\",\n\t}\n\n\tTransactionHashFlag = cli.StringFlag{\n\t\tName:  \"hash\",\n\t\tUsage: \"Transaction `\u003chash\u003e`\",\n\t}\n\tTransactionPayerFlag = cli.StringFlag{\n\t\tName:  \"payer\",\n\t\tUsage: \"Transaction fee payer `\u003caddress\u003e`,Default is the signer address\",\n\t}\n\n\t//Asset setting\n\tApproveAssetFromFlag = cli.StringFlag{\n\t\tName:  \"from\",\n\t\tUsage: \"Transfer-out account `\u003caddress\u003e`\",\n\t}\n\tApproveAssetToFlag = cli.StringFlag{\n\t\tName:  \"to\",\n\t\tUsage: \"Transfer-in account `\u003caddress\u003e`\",\n\t}\n\tApproveAssetFlag = cli.StringFlag{\n\t\tName:  \"asset\",\n\t\tUsage: \"Asset of ONT of ONG to approve\",\n\t\tValue: \"ont\",\n\t}\n\tApproveAmountFlag = cli.StringFlag{\n\t\tName:  \"amount\",\n\t\tUsage: \"Amount of approve. Float number\",\n\t}\n\tTransferFromAmountFlag = cli.StringFlag{\n\t\tName:  \"amount\",\n\t\tUsage: \"Amount of transfer from. Float number\",\n\t}\n\tTransferFromSenderFlag = cli.StringFlag{\n\t\tName:  \"sender\",\n\t\tUsage: \"Sender account `\u003caddress\u003e` of transfer from transaction, Default is transfer-to account\",\n\t}\n\tSendTxFlag = cli.BoolFlag{\n\t\tName:  \"send,s\",\n\t\tUsage: \"Send raw transaction to Ontology\",\n\t}\n\tForceSendTxFlag = cli.BoolFlag{\n\t\tName:  \"force,f\",\n\t\tUsage: \"Force to send transaction\",\n\t}\n\tRawTransactionFlag = cli.StringFlag{\n\t\tName:  \"raw-tx\",\n\t\tUsage: \"Raw `\u003ctransaction\u003e` encode with hex string\",\n\t}\n\tPrepareExecTransactionFlag = cli.BoolFlag{\n\t\tName:  \"prepare,p\",\n\t\tUsage: \"Prepare execute transaction, without commit to ledger\",\n\t}\n\tWithdrawONGReceiveAccountFlag = cli.StringFlag{\n\t\tName:  \"receive\",\n\t\tUsage: \"ONG receive `\u003caddress\u003e`，Default the same with owner account\",\n\t}\n\tWithdrawONGAmountFlag = cli.StringFlag{\n\t\tName:  \"amount\",\n\t\tUsage: \"Withdraw amount `\u003cnumber\u003e`, Float number. Default withdraw all\",\n\t}\n\tForceTxFlag = cli.BoolFlag{\n\t\tName:  \"force,f\",\n\t\tUsage: \"Force to send transaction\",\n\t}\n\n\t//Cli setting\n\tCliAddressFlag = cli.StringFlag{\n\t\tName:  \"cliaddress\",\n\t\tUsage: \"Rpc bind `\u003caddress\u003e`\",\n\t\tValue: config.DEFUALT_CLI_RPC_ADDRESS,\n\t}\n\tCliRpcPortFlag = cli.UintFlag{\n\t\tName:  \"cliport\",\n\t\tUsage: \"Rpc bind port `\u003cnumber\u003e`\",\n\t\tValue: config.DEFAULT_CLI_RPC_PORT,\n\t}\n\tCliABIPathFlag = cli.StringFlag{\n\t\tName:  \"abi\",\n\t\tUsage: \"Abi `\u003cfile\u003e` path\",\n\t\tValue: DEFAULT_ABI_PATH,\n\t}\n\tCliWalletDirFlag = cli.StringFlag{\n\t\tName:  \"walletdir\",\n\t\tUsage: \"Wallet data `\u003cpath\u003e`\",\n\t\tValue: DEFAULT_WALLET_PATH,\n\t}\n\n\t//Export setting\n\tExportFileFlag = cli.StringFlag{\n\t\tName:  \"export-file\",\n\t\tUsage: \"Export `\u003cfile\u003e` path\",\n\t\tValue: DEFAULT_EXPORT_FILE,\n\t}\n\tExportStartHeightFlag = cli.UintFlag{\n\t\tName:  \"start-height\",\n\t\tUsage: \"Start block height `\u003cnumber\u003e` to export\",\n\t\tValue: DEFAULT_EXPORT_HEIGHT,\n\t}\n\tExportEndHeightFlag = cli.UintFlag{\n\t\tName:  \"end-height\",\n\t\tUsage: \"Stop block height `\u003cnumber\u003e` to export\",\n\t\tValue: DEFAULT_EXPORT_HEIGHT,\n\t}\n\tExportSpeedFlag = cli.StringFlag{\n\t\tName:  \"export-speed\",\n\t\tUsage: \"Export block speed `\u003clevel\u003e` (h|m|l), h for high speed, m for middle speed and l for low speed\",\n\t\tValue: \"m\",\n\t}\n\n\t//PreExecute switcher\n\tTxpoolPreExecDisableFlag = cli.BoolFlag{\n\t\tName:  \"disable-tx-pool-pre-exec\",\n\t\tUsage: \"Disable preExecute in tx pool\",\n\t}\n\n\tDisableBroadcastNetTxFlag = cli.BoolFlag{\n\t\tName:  \"disable-broadcast-net-tx\",\n\t\tUsage: \"Disable broadcast tx from network in tx pool\",\n\t}\n\n\tNonOptionFlag = cli.StringFlag{\n\t\tName:  \"option\",\n\t\tUsage: \"this command does not need option, please run directly\",\n\t}\n)\n```\n\n```go\nvar (\n\tPARAM_TYPE_SPLIT_INC = string([]byte{0})\n\tPARAM_SPLIT_INC      = string([]byte{1})\n)\n```\n\n## Functions\n\n```go\nfunc CompressBlockData(data []byte, compressType byte) ([]byte, error)\n```\n\n```go\nfunc DecompressBlockData(data []byte, compressType byte) ([]byte, error)\n```\n\n```go\nfunc GenExportBlocksFileName(name string, start, end uint32) string\n```\n\n```go\nfunc GetBlock(hashOrHeight interface{}) ([]byte, error)\n```\n\n```go\nfunc GetBlockCount() (uint32, error)\n```\n\n```go\nfunc GetBlockData(hashOrHeight interface{}) ([]byte, error)\n```\n\n```go\nfunc GetFlagName(flag cli.Flag) string\n```\nGetFlagName deal with short flag, and return the flag name whether flag name have short name\n\n```go\nfunc GetJsonObjectFromFile(filePath string, jsonObject interface{}) error\n```\n\n```go\nfunc GetNetworkId() (uint32, error)\n```\n\n```go\nfunc GetRawTransaction(txHash string) ([]byte, error)\n```\n\n```go\nfunc GetSmartContractEventInfo(txHash string) ([]byte, error)\n```\n\n```go\nfunc GetStoreDirPath(dataDir, networkName string) string\n```\n\n```go\nfunc GetTxHeight(txHash string) (uint32, error)\n```\n\n```go\nfunc MultiSigTransaction(mutTx *types.Transaction, m uint16, pubKeys []keypair.PublicKey, signer *account.Account) error\n```\n\n```go\nfunc ParseParams(rawParamStr string) ([]interface{}, error)\n```\nParseParams return interface{} array of encode params item. A param item compose of type and value, type can be: bytearray, string, int, bool Param type and param value split with \":\", such as int:10 Param array can be express with \"\\[]\", such \\[int:10,string:foo], param array can be nested, such as \\[int:10,\\[int:12,bool:true]] A raw params example: string:foo,\\[int:0,\\[bool:true,string:bar],bool:false] Note that if string contain some special char like :,\\[,] and so one, please '/' char to escape. For example: string:did/:ed1e25c9dccae0c694ee892231407afa20b76008\n\n```go\nfunc PrepareSendRawTransaction(txData string) (*states.PreExecResult, error)\n```\n\n```go\nfunc SendRawTransactionData(txData string) (string, error)\n```\n\n```go\nfunc Sign(data []byte, signer *account.Account) ([]byte, error)\n```\nSign sign return the signature to the data of private key\n\n```go\nfunc SignTransaction(signer *account.Account, tx *types.Transaction) error\n```\n\n```go\nfunc ZLibCompress(data []byte) ([]byte, error)\n```\n\n```go\nfunc ZLibDecompress(data []byte) ([]byte, error)\n```\n\n## Types\n\n```go\ntype ExportBlockMetadata struct {\n\tVersion          byte\n\tCompressType     byte\n\tStartBlockHeight uint32\n\tEndBlockHeight   uint32\n}\n```\n\n```go\nfunc NewExportBlockMetadata() *ExportBlockMetadata\n```\n\n```go\nfunc (this *ExportBlockMetadata) Deserialize(r io.Reader) error\n```\n\n```go\nfunc (this *ExportBlockMetadata) Serialize(w io.Writer) error\n```\n\n```go\ntype JsonRpcRequest struct {\n\tVersion string        `json:\"jsonrpc\"`\n\tId      string        `json:\"id\"`\n\tMethod  string        `json:\"method\"`\n\tParams  []interface{} `json:\"params\"`\n}\n```\nJsonRpcRequest object in rpc\n\n```go\ntype JsonRpcResponse struct {\n\tError  int64           `json:\"error\"`\n\tDesc   string          `json:\"desc\"`\n\tResult json.RawMessage `json:\"result\"`\n}\n```\nJsonRpcResponse object response for JsonRpcRequest\n\n```go\ntype OntologyError struct {\n\tErrorCode int64\n\tError     error\n}\n```\n\n```go\nfunc NewOntologyError(err error, errCode ...int64) *OntologyError\n```\n\n","path":"github.com/polynetwork/poly/cmd/utils","name":"utils","synopsis":"","isRedistributable":true}
