Variables
Const BASE_CHAIN_ID
BASE_CHAIN_ID: "eip155" = "eip155"
Const CHAIN_ID
CHAIN_ID: "inmemory:12345" = "inmemory:12345"
Const DEFAULT_DOC_CACHE_LIMIT
DEFAULT_DOC_CACHE_LIMIT: 500 = 500
Const DEFAULT_MAX_POLL_TIME
DEFAULT_MAX_POLL_TIME: 7200000 = 7200000
Const DEFAULT_NETWORK
DEFAULT_NETWORK: "inmemory" = "inmemory"
Const DEFAULT_PINSET_DIRECTORY
DEFAULT_PINSET_DIRECTORY: string = path.join(os.homedir(), ".ceramic", "pinset")
Const DEFAULT_POLL_TIME
DEFAULT_POLL_TIME: 60000 = 60000
Const DID_MATCHER
DID_MATCHER: "^(did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?)([?][^#]*)?(#.*)?" = "^(did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.-]+(:[a-zA-Z0-9_.-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?)([?][^#]*)?(#.*)?"
Const HTTP_STATUS_NOT_FOUND
HTTP_STATUS_NOT_FOUND: 404 = 404
Const IPFS_GET_TIMEOUT
IPFS_GET_TIMEOUT: 60000 = 60000
Const IPFS_GET_TIMEOUT
IPFS_GET_TIMEOUT: 60000 = 60000
Const IPFS_GET_TIMEOUT
IPFS_GET_TIMEOUT: 60000 = 60000
Const IPFS_MAX_RECORD_SIZE
IPFS_MAX_RECORD_SIZE: 256000 = 256000
Const IPFS_RESUBSCRIBE_INTERVAL_DELAY
IPFS_RESUBSCRIBE_INTERVAL_DELAY: number = 1000 * 15
Const MAX_NUMBER_OF_EVENT_LISTENERS
MAX_NUMBER_OF_EVENT_LISTENERS: 100 = 100
Const PEER_DISCOVERY_INTERVAL_DELAY
PEER_DISCOVERY_INTERVAL_DELAY: number = 1000 * 60 * 60
Const TESTING
TESTING: boolean = process.env.NODE_ENV == 'test'
Const TESTING
TESTING: boolean = process.env.NODE_ENV == 'test'
Let peerDiscoveryPeriodicTask
peerDiscoveryPeriodicTask: any
Ceramic Core
Getting started
Installation
$ npm install @ceramicnetwork/core
Usage
import Ceramic from '@ceramicnetwork/core' import IPFS from 'ipfs' import dagJose from 'dag-jose' import basicsImport from 'multiformats/cjs/src/basics-import.js' import legacy from 'multiformats/cjs/src/legacy.js' basicsImport.multicodec.add(dagJose) const format = legacy(basicsImport, dagJose.name) const ipfs = Ipfs.create({ ipld: { formats: [format] }, }) const config: CeramicConfig = {} const ceramic = await Ceramic.create(ipfs, config) // create document example const doctype1 = await ceramic.createDocument('tile', { content: { test: 123 } })
Ceramic API
Complete Ceramic core API is available on Ceramic API.
Development
Run tests:
$ npm test
Run linter:
npm run lint
Contributing
We are happy to accept small and large contributions. Make sure to check out the Ceramic specifications for details of how the protocol works.
License