![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@rsksmart/ipfs-cpinner-provider
Advanced tools
@rsksmart/ipfs-cpinner-provider
RIF Identity - IPFS Centralized Pinner Provider
npm i @rsksmart/ipfs-cpinner-provider
A Centralized Data Vault provider compatible with RIF Data Vault standard interface. It stores content in an IPFS node associated to a given DID and key.
It is strongly recommend to encrypt the content saved in IPFS using this package.
The IPFS Centralized pinner provider was designed to use in Centralized pinner service but can be used as standalone
First of all you need to have access to an IPFS node API. To run it locally:
Install IPFS CLI. Find your option: https://docs.ipfs.io/how-to/command-line-quick-start/.
Init IPFS (once)
ipfs init
ipfs daemon
This will expose the IPFS API in http://localhost:5001
Plug and play configuration
import { ipfsPinnerProviderFactory } from '@rsksmart/ipfs-cpinner-provider'
const ipfsApi = 'http://localhost:5001'
const database = 'my-ipfs-pinner-provider.sqlite'
const ipfsPinnerProvider = await ipfsPinnerProviderFactory(ipfsApi, database)
// NOTE: ipfsApi and database are optional params. Defaults are: 'http://localhost:5001' and 'ipfsPinnerProvider.sqlite'
This allows to configure the ipfs-http-client
and set the DB connection with the desired configuration
import { createConnection } from 'typeorm'
import IpfsHttpClient from 'ipfs-http-client'
import IpfsPinnerProvider, { IpfsClient, IpfsPinner, MetadataManager, Entities, IpfsMetadata, IpfsPinnedCid } from '@rsksmart/ipfs-cpinner-provider'
// ipfs config
const ipfsConfig = { ...yourConfig, url: 'http://localhost:5001' } // refer to https://www.npmjs.com/package/ipfs-http-client
const ipfsHttpClient = IpfsHttpClient(ipfsConfig)
// db config
const database = 'my-ipfs-pinner-database.sqlite'
const dbConnection = await createConnection({
type: 'sqlite',
database,
entities: Entities,
logging: false,
dropSchema: true,
synchronize: true
})
const pinnedCidsRepository = dbConnection.getRepository(IpfsPinnedCid)
const metadataRepository = dbConnection.getRepository(IpfsMetadata)
// set dependencies to inject
const ipfsClient = new IpfsClient(ipfsHttpClient)
const ipfsPinner = new IpfsPinner(ipfsHttpClient, pinnedCidsRepository)
const metadataManager = new MetadataManager(metadataRepository)
const IpfsPinnerProvider = new IpfsPinnerProvider(ipfsClient, metadataManager, ipfsPinner)
const did = 'did:ethr:rsk:12345678'
const key = 'the key'
const content = 'the content'
const cid: string = await ipfsPinnerProvider.put(did, key, content)
const cids: string[] = await ipfsPinnerProvider.get(did, key)
const newCid: string = await ipfsPinnerProvider.swap(did, key, 'the new content')
const anotherCid: string = await ipfsPinnerProvider.swap(did, key, 'the new content', newCid) // cid can be specified if there is more than one content associated to the given did and key
const deleted: boolean = await ipfsPinnerProvider.delete(did, key)
const deleted: boolean = await ipfsPinnerProvider.delete(did, key, cid) // cid can be specified if there is more than one content associated to the given did and key
From base repo directory run npm test
or any of the described test script variants.
FAQs
RIF Identity - IPFS Centralized Pinner Provider
The npm package @rsksmart/ipfs-cpinner-provider receives a total of 0 weekly downloads. As such, @rsksmart/ipfs-cpinner-provider popularity was classified as not popular.
We found that @rsksmart/ipfs-cpinner-provider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.