File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,35 @@ func main() {
55
55
1 . Run ` go mod init ` to set up your ` go.mod ` file
56
56
2 . You should now be able to interact with the Boost API.
57
57
58
+ ### JSON-RPC in Other Languages
59
+
60
+ The JSON-RPC API can also be communicated with programmatically from other languages. Here is an example written in Python.
61
+ Note that the ` method ` must be prefixed with ` Filecoin. `
62
+
63
+ ```
64
+ import requests
65
+ import json
66
+
67
+ def main():
68
+ url = "http://localhost:3051/rpc/v0"
69
+ headers = {'content-type': 'application/json', "Authorization": "Bearer <token>"}
70
+ payload = {
71
+ "method": "Filecoin.BoostOfflineDealWithData",
72
+ "params": [
73
+ "<deal-uuid>",
74
+ "<file-path>",
75
+ True
76
+ ],
77
+ "jsonrpc": "2.0",
78
+ "id": 1,
79
+ }
80
+ response = requests.post(url, data=json.dumps(payload), headers=headers)
81
+ print(response.text)
82
+
83
+ if __name__ == "__main__":
84
+ main()
85
+ ```
86
+
58
87
## Groups
59
88
60
89
* [ Actor] ( #actor )
You can’t perform that action at this time.
0 commit comments