Skip to content

Commit f5b6f99

Browse files
Update HowToUseClientSmartContract.md
Adding client smart contract troubleshoot
1 parent f1f13ed commit f5b6f99

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

HowToUseClientSmartContract.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,19 @@ To check the address of the contract assigned to you, first check the associated
160160
Direct data import scheduled for execution
161161
```
162162
163+
## Troubleshooting
164+
If the client contract is reverting this is usually caused by one of the following things:
165+
- client doesn't have enough DC allowance on the contract
166+
- contract doesn't have enough DC
167+
- client tries to use SP that's not whitelisted
168+
- allocation to this SP would exceed "fair DC distribution" limits (a.k.a. if Client got 1 PiB of DC and there are 5 whitelisted SPs, max 200 TiB +/- 10% can be allocated to each one of them)
169+
170+
**How to verify what's the cause**
171+
1. Install https://getfoundry.sh/introduction/installation
172+
2. Check if contract has enough DC: `curl 'https://api.node.glif.io/' -X POST --data-raw '{"jsonrpc":"2.0","method":"Filecoin.StateVerifiedClientStatus","params":["f410fdfrfh3jhrys2w5rsjpdin3hab47gp4qy2z4fsdy",null],"id":0}'` (replace f410... with your contract address). **Result should be higher than the allocation you're trying to do.**
173+
3. Check if client has enough DC allowance on the contract: `cast call --rpc-url https://api.node.glif.io/rpc/v1 0xCONTRACT_ADDRESS 'allowances(address)(uint256)' 0xCLIENT_ADDRESS`. _Use https://beryx.io/address_converter to convert to 0x addresses._ **Result should be higher than the allocation you're trying to do.**
174+
4. Check if SP is whitelisted: `cast call --rpc-url https://api.node.glif.io/rpc/v1 0xCONTRACT_ADDRESS 'clientSPs(address)(uint256[])' 0xCLIENT_ADDRESS` . **SP ID you're using should be on this list (list doesn't include f0 prefix)**
175+
5. Fair distribution - **total amount of DC used by this client for given SP can't exceed total DC the client got allocated divided by the number of whitelisted SPs (+10%).**
176+
163177
164178
8. Watch the `boostd` UI to verify that the new DDO deal reaches "Complete" and "Claim Verified" state.

0 commit comments

Comments
 (0)