repo-configs

0.7.0 • Public • Published

repo-configs

IPFS repo configs including PeerID, PrivKey & datastore_spec

import { blockstore, config } from 'repo-configs';
import Repo from 'ipfs';
const ipfsRepo = new Repo(<path to repo>);
 
config().then(({spec, repo, netkey}) => {
  writeFileSync(join(repoPath, 'datastore_spec'), JSON.stringify(spec, null, '\t'));
  writeFileSync(join(repoPath, 'config'), JSON.stringify(repo, null, '\t'));
  writeFileSync(join(repoPath, 'swarm.key'), netkey);
  
  // or
  ipfsRepo.init(repo) // full config
  
  ipfsRepo.init(blockstore) // minimal config for working with the blockstore  
})
 

API

config

/repo-configs/

    Package Sidebar

    Install

    npm i repo-configs

    Weekly Downloads

    24

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    34.9 kB

    Total Files

    6

    Last publish

    Collaborators

    • vandeurenglenn