在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:PatrickAlphaC/ipfs_cl_ea开源软件地址:https://github.com/PatrickAlphaC/ipfs_cl_ea开源编程语言:JavaScript 97.1%开源软件介绍:
Chainlink NodeJS IPFS External AdapterSend and get data from your IPFS node. TODO
Creating your own adapter from this templateClone this repo and change "ExternalAdapterProject" below to the name of your project git clone https://github.com/PatrickAlphaC/ipfs_cl_ea Enter into the newly-created directory cd ipfs_cl_ea See Install Locally for a quickstart Input ParamsThis is currently a work in progress, and supports some of the IPFS HTTP parameters. PRs are welcome :)
Parameters from the IPFS API:
Example input
Output{
"jobRunID":0,
"data":{
"Name":"test.json",
"Hash":"Qmd3zUksep8MQnjeSsXgEE4xa2DKgw48HJPjk5BiMDn1u7",
"Size":"24",
"result":"Qmd3zUksep8MQnjeSsXgEE4xa2DKgw48HJPjk5BiMDn1u7"
},
"result":"Qmd3zUksep8MQnjeSsXgEE4xa2DKgw48HJPjk5BiMDn1u7",
"statusCode":200
} or Example inputcurl -X POST -H "content-type:application/json" "http://localhost:8080/" --data '{ "id": 0, "data": {"endpoint":"api/v0/cat", "arg":"Qmd3zUksep8MQnjeSsXgEE4xa2DKgw48HJPjk5BiMDn1u7"}}' Output{"jobRunID":0,"data":{"cat":"dog"},"statusCode":200} Example Inputcurl -X POST -H "content-type:application/json" "http://localhost--data '{ "id": 0, "data": {"text_for_file_name":"patrick.json", "text_for_file":"[\"dog\"]"}}' Output{"jobRunID":0,"data":{"Name":"patrick.json","Hash":"QmWk8NQVeoXyMizcxT3D2y85eFDQGQfmRvupCnni3nuS1q","Size":"15","result":"QmWk8NQVeoXyMizcxT3D2y85eFDQGQfmRvupCnni3nuS1q"},"result":"QmWk8NQVeoXyMizcxT3D2y85eFDQGQfmRvupCnni3nuS1q","statusCode":200} Install LocallyInstall dependencies: yarn TestRun the local tests: yarn test Natively run the application (defaults to port 8080): Runyarn start Call the external adapter/API servercurl -X POST -H "content-type:application/json" "http://localhost:8080/" --data '{ "id": 0, "data": {"file":"./test/test.json"}}' DockerIf you wish to use Docker to run the adapter, you can build the image by running the following command: docker build . -t external-adapter Then run it with: docker run -p 8080:8080 -it external-adapter:latest Serverless hostsAfter installing locally: Create the zipzip -r external-adapter.zip . Install to AWS Lambda
To Set Up an API Gateway (HTTP API)If using a HTTP API Gateway, Lambda's built-in Test will fail, but you will be able to externally call the function successfully.
To Set Up an API Gateway (REST API)If using a REST API Gateway, you will need to disable the Lambda proxy integration for Lambda-based adapter to function.
Install to GCP
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论