# How do I interact with a local node (go-ipfs) via a javascript script?

**URL:** <https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050>\
**Category:** Help\
**Tags:** js-ipfs, go-ipfs\
**Created:** [April 25, 2021, 2:27pm UTC](https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050 "2021-04-25T14:27:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![coinfupanda](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/coinfupanda/32/6205_2.png) [@coinfupanda](https://discuss.ipfs.tech/u/coinfupanda)\
**Post date:** [April 25, 2021, 2:27pm UTC](https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050/1 "2021-04-25T14:27:40Z")

</div>

Hi peeps, thanks for any help with this - I have read the docs and can’t figure it out:

Please correct me if I’m wrong:

1. If I want to run a local ipfs node, I need to implement go-ipfs.

I have got a local node running and would like to interact with it via a script, ideally javascript.  
2) Is this possible or do I need to use the js-ipfs implementation?

1. If I do need to use js-ipfs, can I run a local node too?  
i.e. host a local node using go-ipfs, then interact with it (add/cat/get etc) using a js script js-ipfs?

Thank you for your help! As you can tell, I’m a little confused…

---

<div class="post-metadata">

**Author:** ![wclayf](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/wclayf/32/4936_2.png) [@wclayf](https://discuss.ipfs.tech/u/wclayf)\
**Post date:** [April 25, 2021, 4:00pm UTC](https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050/2 "2021-04-25T16:00:34Z")

</div>

If your goal is to say on JS if you can, just install JS-IPFS, and yes that can run a full node and be eithe rin NodeJS (server side even) or completely inside browser. Why were you wanting to use GO-IPFS if you need/want only JS? In my setup I’m using GO-IPFS and then calling the API thru the HTTP-API, so that’s an interesting question about whether the JS API can directly control a GO instance. I’m not sure.

---

<div class="post-metadata">

**Author:** ![adin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/adin/32/2679_2.png) [@adin](https://discuss.ipfs.tech/u/adin)\
**Post date:** [April 25, 2021, 7:33pm UTC](https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050/3 "2021-04-25T19:33:11Z")

</div>

There is a js [implementation](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client) of the HTTP API. If you check out the js-ipfs [docs](https://github.com/ipfs/js-ipfs#documentation) and repo structure you should see more info. There is also a [shared interface](https://github.com/ipfs/js-ipfs/tree/master/packages/interface-ipfs-core#modules-that-implement-the-interface) that can be backed by either the HTTP API or a js-ipfs node.

> [@wclayf](#):
>
> Why were you wanting to use GO-IPFS if you need/want only JS?

If you’re in an environment where you can use go-ipfs over js-ipfs (i.e. you don’t need the node to be fully in a browser and you are not trying to configure/create subcomponents of IPFS using JS) it’s likely that go-ipfs is the better choice given that it tends to get features first.

---

<div class="post-metadata">

**Author:** ![coinfupanda](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/coinfupanda/32/6205_2.png) [@coinfupanda](https://discuss.ipfs.tech/u/coinfupanda)\
**Post date:** [April 26, 2021, 8:00pm UTC](https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050/4 "2021-04-26T20:00:19Z")

</div>

Thanks - it was my intention to run the go-ipfs node, because it appears to be the ‘default’ version, that is all. I do not need to run it in a browser, so wanted to have a ~standalone ipfs node running, separately to everything else.  
Not done this before so not sure what the best approach is!

---

<div class="post-metadata">

**Author:** ![coinfupanda](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/coinfupanda/32/6205_2.png) [@coinfupanda](https://discuss.ipfs.tech/u/coinfupanda)\
**Post date:** [April 26, 2021, 8:01pm UTC](https://discuss.ipfs.tech/t/how-do-i-interact-with-a-local-node-go-ipfs-via-a-javascript-script/11050/5 "2021-04-26T20:01:30Z")

</div>

Brilliant, thanks. I had not come across the shared interface yet - will read it now! Thanks for your help.
