 9bdcbe0447
			
		
	
	9bdcbe0447
	
	
	
		
			
			Major integrations and fixes: - Added BACKBEAT SDK integration for P2P operation timing - Implemented beat-aware status tracking for distributed operations - Added Docker secrets support for secure license management - Resolved KACHING license validation via HTTPS/TLS - Updated docker-compose configuration for clean stack deployment - Disabled rollback policies to prevent deployment failures - Added license credential storage (CHORUS-DEV-MULTI-001) Technical improvements: - BACKBEAT P2P operation tracking with phase management - Enhanced configuration system with file-based secrets - Improved error handling for license validation - Clean separation of KACHING and CHORUS deployment stacks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			116 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			116 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| go-cid
 | |
| ==================
 | |
| 
 | |
| [](http://ipn.io)
 | |
| [](http://ipfs.io/)
 | |
| [](http://webchat.freenode.net/?channels=%23ipfs)
 | |
| [](https://github.com/RichardLitt/standard-readme)
 | |
| [](https://godoc.org/github.com/ipfs/go-cid)
 | |
| [](https://coveralls.io/github/ipfs/go-cid?branch=master)
 | |
| [](https://travis-ci.org/ipfs/go-cid)
 | |
| 
 | |
| > A package to handle content IDs in Go.
 | |
| 
 | |
| This is an implementation in Go of the [CID spec](https://github.com/ipld/cid).
 | |
| It is used in `go-ipfs` and related packages to refer to a typed hunk of data.
 | |
| 
 | |
| ## Lead Maintainer
 | |
| 
 | |
| [Eric Myhre](https://github.com/warpfork)
 | |
| 
 | |
| ## Table of Contents
 | |
| 
 | |
| - [Install](#install)
 | |
| - [Usage](#usage)
 | |
| - [API](#api)
 | |
| - [Contribute](#contribute)
 | |
| - [License](#license)
 | |
| 
 | |
| ## Install
 | |
| 
 | |
| `go-cid` is a standard Go module which can be installed with:
 | |
| 
 | |
| ```sh
 | |
| go get github.com/ipfs/go-cid
 | |
| ```
 | |
| 
 | |
| ## Usage
 | |
| 
 | |
| ### Running tests
 | |
| 
 | |
| Run tests with `go test` from the directory root
 | |
| 
 | |
| ```sh
 | |
| go test
 | |
| ```
 | |
| 
 | |
| ### Examples
 | |
| 
 | |
| #### Parsing string input from users
 | |
| 
 | |
| ```go
 | |
| // Create a cid from a marshaled string
 | |
| c, err := cid.Decode("bafzbeigai3eoy2ccc7ybwjfz5r3rdxqrinwi4rwytly24tdbh6yk7zslrm")
 | |
| if err != nil {...}
 | |
| 
 | |
| fmt.Println("Got CID: ", c)
 | |
| ```
 | |
| 
 | |
| #### Creating a CID from scratch
 | |
| 
 | |
| ```go
 | |
| 
 | |
| import (
 | |
|   cid "github.com/ipfs/go-cid"
 | |
|   mc "github.com/multiformats/go-multicodec"
 | |
|   mh "github.com/multiformats/go-multihash"
 | |
| )
 | |
| 
 | |
| // Create a cid manually by specifying the 'prefix' parameters
 | |
| pref := cid.Prefix{
 | |
| 	Version: 1,
 | |
| 	Codec: uint64(mc.Raw),
 | |
| 	MhType: mh.SHA2_256,
 | |
| 	MhLength: -1, // default length
 | |
| }
 | |
| 
 | |
| // And then feed it some data
 | |
| c, err := pref.Sum([]byte("Hello World!"))
 | |
| if err != nil {...}
 | |
| 
 | |
| fmt.Println("Created CID: ", c)
 | |
| ```
 | |
| 
 | |
| #### Check if two CIDs match
 | |
| 
 | |
| ```go
 | |
| // To test if two cid's are equivalent, be sure to use the 'Equals' method:
 | |
| if c1.Equals(c2) {
 | |
| 	fmt.Println("These two refer to the same exact data!")
 | |
| }
 | |
| ```
 | |
| 
 | |
| #### Check if some data matches a given CID
 | |
| 
 | |
| ```go
 | |
| // To check if some data matches a given cid, 
 | |
| // Get your CIDs prefix, and use that to sum the data in question:
 | |
| other, err := c.Prefix().Sum(mydata)
 | |
| if err != nil {...}
 | |
| 
 | |
| if !c.Equals(other) {
 | |
| 	fmt.Println("This data is different.")
 | |
| }
 | |
| 
 | |
| ```
 | |
| 
 | |
| ## Contribute
 | |
| 
 | |
| PRs are welcome!
 | |
| 
 | |
| Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
 | |
| 
 | |
| ## License
 | |
| 
 | |
| MIT © Jeromy Johnson
 |