Skip to content

Commit

Permalink
feat: Remove sdk address (#105)
Browse files Browse the repository at this point in the history
* Remove sdk address
  • Loading branch information
wangwzhou authored Sep 20, 2024
1 parent 4d3ba72 commit 9ef4a74
Show file tree
Hide file tree
Showing 54 changed files with 17 additions and 137 deletions.
46 changes: 0 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,25 +527,13 @@ using `GetBlocksByRange`.
4. Update the checkpoint.
5. Repeat above steps periodically.

```shell
export CHAINSTORAGE_SDK_AUTH_HEADER=cb-nft-api-token
export CHAINSTORAGE_SDK_AUTH_TOKEN=****
go run ./examples/batch
```

### Stream

[This example](/examples/stream/main.go) demonstrates how to stream the latest blocks and handle chain reorgs.
The worker processes the events sequentially and relies on [BlockchainEvent_Type](/protos/coinbase/chainstorage/api.proto)
to construct the canonical chain.
For example, given `+1, +2, +3, -3, -2, +2', +3'` as the events, the canonical chain would be `+1, +2', +3'`.

```shell
export CHAINSTORAGE_SDK_AUTH_HEADER=cb-nft-api-token
export CHAINSTORAGE_SDK_AUTH_TOKEN=****
go run ./examples/stream
```

### Unified

The [last example](/examples/unified/main.go) showcases how to turn the data processing into an embarrassingly parallel
Expand All @@ -562,40 +550,6 @@ and out of order, the logical ordering guarantee is preserved.
6. Update watermark once all the batches have been processed.
7. Repeat above steps.

```shell
export CHAINSTORAGE_SDK_AUTH_HEADER=cb-nft-api-token
export CHAINSTORAGE_SDK_AUTH_TOKEN=****
go run ./examples/unified
```

## Public APIs

The ChainStorage APIs are in beta preview. Note that the APIs are currently exposed as restful APIs through grpc
transcoding. Please refer to the [proto file](/protos/coinbase/chainstorage/api.proto) for the data schema.

See below for a few examples.

```shell
export CHAINSTORAGE_SDK_AUTH_TOKEN=****
curl -s -X POST \
-H "content-type: application/json" \
-H "x-apikey: ${CHAINSTORAGE_SDK_AUTH_TOKEN}" \
https://launchpad.coinbase.com/api/exp/chainstorage/ethereum/mainnet/v1/coinbase.chainstorage.ChainStorage/GetLatestBlock | jq
curl -s -X POST \
-H "content-type: application/json" \
-H "x-apikey: ${CHAINSTORAGE_SDK_AUTH_TOKEN}" \
-d '{"height": 16000000}' \
https://launchpad.coinbase.com/api/exp/chainstorage/ethereum/mainnet/v1/coinbase.chainstorage.ChainStorage/GetNativeBlock | jq
curl -s -X POST \
-H "content-type: application/json" \
-H "x-apikey: ${CHAINSTORAGE_SDK_AUTH_TOKEN}" \
-d '{"start_height": 16000000, "end_height": 16000005}' \
https://launchpad.coinbase.com/api/exp/chainstorage/ethereum/mainnet/v1/coinbase.chainstorage.ChainStorage/GetNativeBlocksByRange | jq
```

## Contact Us

We have set up a Discord server soon. Here is the link to join (limited 10) https://discord.com/channels/1079683467018764328/1079683467786334220.
2 changes: 1 addition & 1 deletion config/chainstorage/aptos/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/aptos/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/aptos/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/arbitrum/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/arbitrum/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/arbitrum/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/avacchain/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/avacchain/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/avacchain/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/base/goerli/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/base/goerli/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/base/goerli/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/base/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/base/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/base/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/bitcoin/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/bitcoin/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/bitcoin/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/bsc/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/bsc/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/bsc/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/dogecoin/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/dogecoin/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/dogecoin/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/ethereum/goerli/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/ethereum/goerli/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/ethereum/goerli/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/ethereum/holesky/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/ethereum/holesky/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/ethereum/holesky/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/ethereum/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/ethereum/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/ethereum/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/fantom/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/fantom/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/fantom/mainnet/production.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/chainstorage/optimism/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/chainstorage/optimism/mainnet/development.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9ef4a74

Please sign in to comment.