| 1 |
package cid |
| 2 |
|
| 3 |
// These are multicodec-packed content types. The should match |
| 4 |
// the codes described in the authoritative document: |
| 5 |
// https://github.com/multiformats/multicodec/blob/master/table.csv |
| 6 |
const ( |
| 7 |
Raw = 0x55 |
| 8 |
|
| 9 |
DagProtobuf = 0x70 |
| 10 |
DagCBOR = 0x71 |
| 11 |
Libp2pKey = 0x72 |
| 12 |
|
| 13 |
GitRaw = 0x78 |
| 14 |
|
| 15 |
EthBlock = 0x90 |
| 16 |
EthBlockList = 0x91 |
| 17 |
EthTxTrie = 0x92 |
| 18 |
EthTx = 0x93 |
| 19 |
EthTxReceiptTrie = 0x94 |
| 20 |
EthTxReceipt = 0x95 |
| 21 |
EthStateTrie = 0x96 |
| 22 |
EthAccountSnapshot = 0x97 |
| 23 |
EthStorageTrie = 0x98 |
| 24 |
BitcoinBlock = 0xb0 |
| 25 |
BitcoinTx = 0xb1 |
| 26 |
ZcashBlock = 0xc0 |
| 27 |
ZcashTx = 0xc1 |
| 28 |
DecredBlock = 0xe0 |
| 29 |
DecredTx = 0xe1 |
| 30 |
) |
| 31 |
|
| 32 |
// Codecs maps the name of a codec to its type |
| 33 |
var Codecs = map[string]uint64{ |
| 34 |
"v0": DagProtobuf, |
| 35 |
"raw": Raw, |
| 36 |
"protobuf": DagProtobuf, |
| 37 |
"cbor": DagCBOR, |
| 38 |
"libp2p-key": Libp2pKey, |
| 39 |
"git-raw": GitRaw, |
| 40 |
"eth-block": EthBlock, |
| 41 |
"eth-block-list": EthBlockList, |
| 42 |
"eth-tx-trie": EthTxTrie, |
| 43 |
"eth-tx": EthTx, |
| 44 |
"eth-tx-receipt-trie": EthTxReceiptTrie, |
| 45 |
"eth-tx-receipt": EthTxReceipt, |
| 46 |
"eth-state-trie": EthStateTrie, |
| 47 |
"eth-account-snapshot": EthAccountSnapshot, |
| 48 |
"eth-storage-trie": EthStorageTrie, |
| 49 |
"bitcoin-block": BitcoinBlock, |
| 50 |
"bitcoin-tx": BitcoinTx, |
| 51 |
"zcash-block": ZcashBlock, |
| 52 |
"zcash-tx": ZcashTx, |
| 53 |
"decred-block": DecredBlock, |
| 54 |
"decred-tx": DecredTx, |
| 55 |
} |
| 56 |
|
| 57 |
// CodecToStr maps the numeric codec to its name |
| 58 |
var CodecToStr = map[uint64]string{ |
| 59 |
Raw: "raw", |
| 60 |
DagProtobuf: "protobuf", |
| 61 |
DagCBOR: "cbor", |
| 62 |
Libp2pKey: "libp2p-key", |
| 63 |
GitRaw: "git-raw", |
| 64 |
EthBlock: "eth-block", |
| 65 |
EthBlockList: "eth-block-list", |
| 66 |
EthTxTrie: "eth-tx-trie", |
| 67 |
EthTx: "eth-tx", |
| 68 |
EthTxReceiptTrie: "eth-tx-receipt-trie", |
| 69 |
EthTxReceipt: "eth-tx-receipt", |
| 70 |
EthStateTrie: "eth-state-trie", |
| 71 |
EthAccountSnapshot: "eth-account-snapshot", |
| 72 |
EthStorageTrie: "eth-storage-trie", |
| 73 |
BitcoinBlock: "bitcoin-block", |
| 74 |
BitcoinTx: "bitcoin-tx", |
| 75 |
ZcashBlock: "zcash-block", |
| 76 |
ZcashTx: "zcash-tx", |
| 77 |
DecredBlock: "decred-block", |
| 78 |
DecredTx: "decred-tx", |
| 79 |
} |