制作和使用external-adapters https://blog.chain.link/build-and-use-external-adapters/
Clone this repo and change "ExternalAdapterProject" below to the name of your project
git clone https://github.com/thodges-gh/CL-EA-NodeJS-Template.git ExternalAdapterProject
Enter into the newly-created directory
cd ExternalAdapterProject
You can remove the existing git history by running:
rm -rf .git
See Install Locally for a quickstart
Install dependencies:
yarn
Run the local tests:
yarn test
yarn start
curl -X POST -H "content-type:application/json" "http://localhost:8080/" --data '{ "id": 0, "data": { "from": "ETH", "to": "USD" } }'
If you wish to use Docker to run the adapter, you can build the image by running the following command:
docker build . -t external-adapter