https://github.com/application-research/random-cid
Generate a random CID
https://github.com/application-research/random-cid
Last synced: 2 months ago
JSON representation
Generate a random CID
- Host: GitHub
- URL: https://github.com/application-research/random-cid
- Owner: application-research
- License: mit
- Created: 2022-06-06T14:58:16.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-13T20:34:09.000Z (almost 4 years ago)
- Last Synced: 2025-01-25T04:11:09.180Z (over 1 year ago)
- Language: Go
- Homepage: https://random-cid-api.onrender.com
- Size: 84 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# random-cid
Generate a random CID
## Building
```bash
git clone https://github.com/application-research/random-cid.git
cd random-cid
go build .
```
### Usage
You can use the CLI directly
```bash
# random v1 CID
$ ./random-cid
bafkreigd6pc65n4mcfabl3ucv2waoxwizxqizrd32r6cmqjx5zsul4jv3i
# random v0 CID
$ ./random-cid -c 0
QmaA14Co9Q9AuNHcs6KH2ZmJ8sCTwW6ZN7TJfxNcXnrUAX
```
Or you can start an API to retrieve CIDs over HTTP
```bash
./random-cid api
```
The API endpoints are:
- `GET /`: returns a random CID v1
- `GET /v0`: returns a random CID v0
- `GET /v1`: returns a random CID v1
- `GET /peer`: returns the libp2p peer address for the random-cid ipfs node