From d310c3ca21aaa5d3b6a0d7753fb08d53266b395f Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 26 Jul 2024 16:00:23 +0800 Subject: [PATCH] fix: add docs --- README.md | 28 ++++++++-------------------- cmd/README.md | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 cmd/README.md diff --git a/README.md b/README.md index 0bceb0f..a6ba65d 100644 --- a/README.md +++ b/README.md @@ -2,34 +2,22 @@ ## Adding a New Protocol Adapter -### 1. Modify `whitelist.go` +### 1. Add your project under adapters/projects folder -Open `whitelist.go` add the new protocol entry to the whitelist. +### 2. Write an indexer in the new folder -### 2. Example Protocol Entry +An example adapter for tracking OrderFulfilled Event on the OKX marketplace can be seen [here](./adapters/projects/okx/order_fulfilled.go) -An example entry format for adding a new protocol is: +### 3. Test out the adapter by adding it to the cli -- Name: Name of Protocol -- Slug: name-of-protocol -- Contracts: 0x0 +An example on how to add a new adapter to the cli is [here](./cmd/README.md) -```json -{ - "name": "Name of Protocol", - "slug": "name-of-protocol", - "contracts": [ - "0x0" - ] -} -``` - -### 3. Create a Pull Request +### 4. Create a Pull Request Create a pull request (PR) on GitHub to merge your changes into the main branch. Provide a clear description of the changes and the protocol added. -### 6. Review and Merge +### 5. Review and Merge -Wait for the PR to be reviewed by the maintainers. Once approved, your changes will be merged, and the new protocol will be added to the whitelist. +Wait for the PR to be reviewed by the maintainers. Once approved, your changes will be merged, and the protocol info will be added to trailblazers. For further details, refer to the official documentation or contact the maintainers for support. diff --git a/cmd/README.md b/cmd/README.md new file mode 100644 index 0000000..4642565 --- /dev/null +++ b/cmd/README.md @@ -0,0 +1,17 @@ +# Trailblazer Adapters CLI + +## Adding a New CLI Command + +### 1. Add a new option under ```adapterOptions``` in ```root.go``` + +### 2. Import adapter + +An example on how to add import a newly added adapter [here](./order_fulfilled.go) + +### 3. Test out the CLI + +Test out the CLI with the following command and input your parameters accordingly. +``` +go run main.go process +``` +