when I run node.js , the function
(const node = new IPFS({
init: true,
start: true,
repo: repoPath)}
)
will produce the new node again, hence I can't change the config in this node, because I don't know how to use the node I had produced.
Hi @kappabooom, you are telling the node to "init the repo" again with the option "init: true". You can get your issue solved and simplified by just having:
const node = new IPFS({
repo: repoPath
})
@diasdavid Thanks for your answer~ but I got some troubles on use 'repoPath' , it will appear error " Error: repo already exists", when I run the code:
const repoPath = 'test';
const node = new IPFS({
repo: repoPath,
});
Right. My bad, that is because it defaults to init the repo. Do:
const node = new IPFS({
init: false,
repo: repoPath
})
On the second time
@diasdavid Yes, I solved this problem. Thank you very much!!!
wooot @kappabooom :D
Is there a way to tell it to init the repo if it hasn't already been inited, and not otherwise ?