Filecoin 백서

Filecoin

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 52쪽 중 52쪽

returned InvocResult.MsgCid will not match the Cid param If the caller wants to ensure that exactly the requested message was executed, they MUST check that InvocResult.MsgCid is equal to the provided Cid. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) Perms: read Inputs: ```json [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ] ``` Response: ```json { "MsgCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9, "EventsRoot": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } }, "GasCost": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "GasUsed": "0", "BaseFeeBurn": "0", "OverEstimationBurn": "0", "MinerPenalty": "0", "MinerTip": "0", "Refund": "0", "TotalCost": "0" }, "ExecutionTrace": { "Msg": { "From": "f01234", "To": "f01234", "Value": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "ParamsCodec": 42, "GasLimit": 42, "ReadOnly": true, "CodeCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "ReturnCodec": 42 }, "GasCharges": [ { "Name": "string value", "tg": 9, "cg": 9, "sg": 9, "tt": 60000000000 } ], "Subcalls": [ { "Msg": { "From": "f01234", "To": "f01234", "Value": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "ParamsCodec": 42, "GasLimit": 42, "ReadOnly": true, "CodeCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "ReturnCodec": 42 }, "GasCharges": [ { "Name": "string value", "tg": 9, "cg": 9, "sg": 9, "tt": 60000000000 } ], "Subcalls": null } ] }, "Error": "string value", "Duration": 60000000000 } ``` ## StateSearchMsg StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message - the MsgLookup.Message will be a different CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the result of the execution of the replacing message. If the caller wants to ensure that exactly the requested message was executed, they must check that MsgLookup.Message is equal to the provided 'cid', or set the `allowReplaced` parameter to false. Without this check, and with `allowReplaced` set to true, both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) Perms: read Inputs: ```json [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, 10101, true ] ``` Response: ```json { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Receipt": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9, "EventsRoot": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } }, "ReturnDec": {}, "TipSet": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], "Height": 10101 } ``` ## StateSectorExpiration StateSectorExpiration returns epoch at which given sector will expire Perms: read Inputs: ```json [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: ```json { "OnTime": 10101, "Early": 10101 } ``` ## StateSectorGetInfo StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate expiration epoch Perms: read Inputs: ```json [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: ```json { "SectorNumber": 9, "SealProof": 8, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "DealIDs": [5432], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", "VerifiedDealWeight": "0", "InitialPledge": "0", "ExpectedDayReward": "0", "ExpectedStoragePledge": "0", "ReplacedSectorAge": 10101, "ReplacedDayReward": "0", "SectorKeyCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "SimpleQAPower": true } ``` ## StateSectorPartition StateSectorPartition finds deadline/partition with the specified sector Perms: read Inputs: ```json [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: ```json { "Deadline": 42, "Partition": 42 } ``` ## StateSectorPreCommitInfo StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector. Returns nil and no error if the sector isn't precommitted. Note that the sector number may be allocated while PreCommitInfo is nil. This means that either allocated sector numbers were compacted, and the sector number was marked as allocated in order to reduce size of the allocated sectors bitfield, or that the sector was precommitted, but the precommit has expired. Perms: read Inputs: ```json [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: ```json { "Info": { "SealProof": 8, "SectorNumber": 9, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "SealRandEpoch": 10101, "DealIDs": [5432], "Expiration": 10101, "UnsealedCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } }, "PreCommitDeposit": "0", "PreCommitEpoch": 10101 } ``` ## StateVMCirculatingSupplyInternal StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset. This is the value reported by the runtime interface to actors code. Perms: read Inputs: ```json [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: ```json { "FilVested": "0", "FilMined": "0", "FilBurnt": "0", "FilLocked": "0", "FilCirculating": "0", "FilReserveDisbursed": "0" } ``` ## StateVerifiedClientStatus StateVerifiedClientStatus returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address. Perms: read Inputs: ```json [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: `"0"` ## StateVerifiedRegistryRootKey StateVerifiedRegistryRootKey returns the address of the Verified Registry's root key Perms: read Inputs: ```json [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: `"f01234"` ## StateVerifierStatus StateVerifierStatus returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address. Perms: read Inputs: ```json [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: `"0"` ## StateWaitMsg StateWaitMsg looks back up to limit epochs in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth. NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message - the MsgLookup.Message will be a different CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the result of the execution of the replacing message. If the caller wants to ensure that exactly the requested message was executed, they must check that MsgLookup.Message is equal to the provided 'cid', or set the `allowReplaced` parameter to false. Without this check, and with `allowReplaced` set to true, both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) Perms: read Inputs: ```json [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, 42, 10101, true ] ``` Response: ```json { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Receipt": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9, "EventsRoot": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } }, "ReturnDec": {}, "TipSet": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], "Height": 10101 } ``` [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/json-rpc/state) # Sync The Sync method group contains methods for interacting with and observing the lotus sync service. ## SyncCheckBad SyncCheckBad checks if a block was marked as bad, and if it was, returns the reason. Perms: read Inputs: ```json [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ] ``` Response: `"string value"` ## SyncCheckpoint SyncCheckpoint marks a blocks as checkpointed, meaning that it won't ever fork away from it. Perms: admin Inputs: ```json [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: `{}` ## SyncIncomingBlocks SyncIncomingBlocks returns a channel streaming incoming, potentially not yet synced block headers. Perms: read Inputs: `null` Response: ```json { "Miner": "f01234", "Ticket": { "VRFProof": "Ynl0ZSBhcnJheQ==" }, "ElectionProof": { "WinCount": 9, "VRFProof": "Ynl0ZSBhcnJheQ==" }, "BeaconEntries": [ { "Round": 42, "Data": "Ynl0ZSBhcnJheQ==" } ], "WinPoStProof": [ { "PoStProof": 8, "ProofBytes": "Ynl0ZSBhcnJheQ==" } ], "Parents": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "ParentWeight": "0", "Height": 10101, "ParentStateRoot": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "ParentMessageReceipts": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Messages": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "BLSAggregate": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "Timestamp": 42, "BlockSig": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "ForkSignaling": 42, "ParentBaseFee": "0" } ``` ## SyncMarkBad SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced. Use with extreme caution. Perms: admin Inputs: ```json [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ] ``` Response: `{}` ## SyncState SyncState returns the current status of the lotus sync system. Perms: read Inputs: `null` Response: ```json { "ActiveSyncs": [ { "WorkerID": 42, "Base": { "Cids": null, "Blocks": null, "Height": 0 }, "Target": { "Cids": null, "Blocks": null, "Height": 0 }, "Stage": 1, "Height": 10101, "Start": "0001-01-01T00:00:00Z", "End": "0001-01-01T00:00:00Z", "Message": "string value" } ], "VMApplied": 42 } ``` ## SyncSubmitBlock SyncSubmitBlock can be used to submit a newly created block to the. network through this node Perms: write Inputs: ```json [ { "Header": { "Miner": "f01234", "Ticket": { "VRFProof": "Ynl0ZSBhcnJheQ==" }, "ElectionProof": { "WinCount": 9, "VRFProof": "Ynl0ZSBhcnJheQ==" }, "BeaconEntries": [ { "Round": 42, "Data": "Ynl0ZSBhcnJheQ==" } ], "WinPoStProof": [ { "PoStProof": 8, "ProofBytes": "Ynl0ZSBhcnJheQ==" } ], "Parents": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "ParentWeight": "0", "Height": 10101, "ParentStateRoot": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "ParentMessageReceipts": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Messages": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "BLSAggregate": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "Timestamp": 42, "BlockSig": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "ForkSignaling": 42, "ParentBaseFee": "0" }, "BlsMessages": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "SecpkMessages": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ] } ] ``` Response: `{}` ## SyncUnmarkAllBad SyncUnmarkAllBad purges bad block cache, making it possible to sync to chains previously marked as bad Perms: admin Inputs: `null` Response: `{}` ## SyncUnmarkBad SyncUnmarkBad unmarks a blocks as bad, making it possible to be validated and synced again. Perms: admin Inputs: ```json [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ] ``` Response: `{}` ## SyncValidateTipset SyncValidateTipset indicates whether the provided tipset is valid or not Perms: read Inputs: ```json [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ] ``` Response: `true` [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/json-rpc/sync) # Wallet ## WalletBalance WalletBalance returns the balance of the given address at the current head of the chain. Perms: read Inputs: ```json ["f01234"] ``` Response: `"0"` ## WalletDefaultAddress WalletDefaultAddress returns the address marked as default in the wallet. Perms: write Inputs: `null` Response: `"f01234"` ## WalletDelete WalletDelete deletes an address from the wallet. Perms: admin Inputs: ```json ["f01234"] ``` Response: `{}` ## WalletExport WalletExport returns the private key of an address in the wallet. Perms: admin Inputs: ```json ["f01234"] ``` Response: ```json { "Type": "bls", "PrivateKey": "Ynl0ZSBhcnJheQ==" } ``` ## WalletHas WalletHas indicates whether the given address is in the wallet. Perms: write Inputs: ```json ["f01234"] ``` Response: `true` ## WalletImport WalletImport receives a KeyInfo, which includes a private key, and imports it into the wallet. Perms: admin Inputs: ```json [ { "Type": "bls", "PrivateKey": "Ynl0ZSBhcnJheQ==" } ] ``` Response: `"f01234"` ## WalletList WalletList lists all the addresses in the wallet. Perms: write Inputs: `null` Response: ```json ["f01234"] ``` ## WalletNew WalletNew creates a new address in the wallet with the given sigType. Available key types: bls, secp256k1, secp256k1-ledger Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated Perms: write Inputs: ```json ["bls"] ``` Response: `"f01234"` ## WalletSetDefault WalletSetDefault marks the given address as as the default one. Perms: write Inputs: ```json ["f01234"] ``` Response: `{}` ## WalletSign WalletSign signs the given bytes using the given address. Perms: sign Inputs: ```json ["f01234", "Ynl0ZSBhcnJheQ=="] ``` Response: ```json { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" } ``` ## WalletSignMessage WalletSignMessage signs the given message using the given address. Perms: sign Inputs: ```json [ "f01234", { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ] ``` Response: ```json { "Message": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "Signature": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ``` ## WalletValidateAddress WalletValidateAddress validates whether a given string can be decoded as a well-formed address Perms: read Inputs: ```json ["string value"] ``` Response: `"f01234"` ## WalletVerify WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet. Perms: read Inputs: ```json [ "f01234", "Ynl0ZSBhcnJheQ==", { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" } ] ``` Response: `true` [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/json-rpc/wallet) # Web3 ## Web3ClientVersion Returns the client version Perms: read Inputs: `null` Response: `"string value"` [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/reference/json-rpc/web3)
프로젝트로 돌아가기