# Internet Base VS Code extension

**URL:** <https://forum.dfinity.org/t/internet-base-vs-code-extension/20080>\
**Category:** Developers\
**Created:** [May 18, 2023, 3:44pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080 "2023-05-18T15:44:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 18, 2023, 3:44pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/1 "2023-05-18T15:44:40Z")

</div>

I am happy to present to you, the Internet Base extension (alpha).

Currently, it adds notebooks that can run js with icblast.  
You can easily interact with mainnet or locally deployed canisters.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/6/6f88fac673e204caf0018126faccda9ac727c167.png)

It also has an interface browser from which you can directly generate the code for calls.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/b/b39ec27dcd2b35b748150c71bbe5d147351c2642.png)  
The identity used in these Blast notebooks is stored inside VS Code’s account system.

You can install the extension from the marketplace.

- Works in desktop VSCode
- Works in VSCode Web [https://vscode.dev/](https://vscode.dev/) and Github workspaces.

I welcome comments and suggestions

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [May 18, 2023, 5:24pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/2 "2023-05-18T17:24:47Z")

</div>

Very cool. I really like the way you handle variants and opt values.

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/6/61a27c217d525439e57cc6334386101b1ff30bb4.png)  
What does this icon do? Doesn’t seem to do anything when I click it

Keep up the good work!

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 18, 2023, 6:05pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/3 "2023-05-18T18:05:48Z")

</div>

Thanks.  
Glad you asked about the button - it generates code for your call. You need to have an open file so it can insert code inside.

Btw. Here is post explaining the icblast - agentjs differences.  
Basically OPT: Instead of being `key:[val]` becomes `key:val`

> [@ICBlast - Opinionated client library | undefined or \[\]?](https://forum.dfinity.org/t/icblast-opinionated-client-library-undefined-or/19578):
>
> Icblast 2.0.6 - alpha. (Not production ready) Just got released. It is wrapping around Agentjs and provides extra convenience and functionality. It is very opinionated. What it does: converts all input, passes it to Agentjs actor, then converts the output and returns it. Opinions: thinking Opt has to be undefined not [] The main argument against is that Opt Opt Opt Nat8 is valid candid. However, my opinion is that nobody should create APIs that differentiate opt levels. {param:[]} {para…

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 22, 2023, 7:49pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/4 "2023-05-22T19:49:12Z")

</div>

We’ve decided to do our homework and launch SNS locally.  
It’s great that dfx allows the whole NNS to be installed locally 👏.  
We’ve made a few .blasts to facilitate the process without using any tools except the casual `dfx deploy` and such.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/d/d40918b8cba7bc2bd40e6d214659bc478c81a92b.jpeg)  
This helped us understand what is going on on a lower level (imo the proper level). The ic-admin tool is great, but kind of obfuscates the process. Questions like, what calls are you making? Is it one, are there more? What are they doing? Where are they going? Who is making them? Are unanswered (unless you read the tool code)  
These blasts at [GitHub - infu/internet-base-vsc-examples](https://github.com/infu/internet-base-vsc-examples) are using simple ic calls to get it done.

Few fun facts from our observations.  
It’s possible to create a pre-SNS dao that launches the SNS.  
It’s possible for one SNS to launch another SNS

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [May 22, 2023, 9:00pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/5 "2023-05-22T21:00:12Z")

</div>

I’d love to see it deconstructed for deploying them as application canisters instead of being deployed from the sns.

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 22, 2023, 9:18pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/6 "2023-05-22T21:18:04Z")

</div>

The code is the repo. Give me a few min to fix it for dfx 13.1 (it also had wrong steps, I am replaying it again to see how it goes) Then make sure you clone the latest repo

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 22, 2023, 10:17pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/7 "2023-05-22T22:17:53Z")

</div>

Following the step by step guide should look like this ~8min

[![](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/0/0faa2dd6d6777041566905841abc872c6e0da4c0.jpeg "Launching ICP SNS DAO locally") ](https://www.youtube.com/watch?v=aBRbsNRV_VQ)

---

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [May 23, 2023, 7:14am UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/8 "2023-05-23T07:14:35Z")

</div>

I just want to highlight how amazing that video is 👆

---

<div class="post-metadata">

**Author:** ![ZackDS](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zackds/32/40368_2.png) [@ZackDS](https://forum.dfinity.org/u/ZackDS)\
**Post date:** [May 23, 2023, 8:39am UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/9 "2023-05-23T08:39:55Z")

</div>

This is great, simple, elegant and fast 🙂 Messed with it for half hour still failed. Note to self must buy a Mac. Thanks for the video

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 23, 2023, 10:48am UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/10 "2023-05-23T10:48:01Z")

</div>

FYI. The security of VSCode extensions is tragic. Node and NPM packages are the same.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/f/f1baf61b5b50b1d3b068a51f3289df35f708d7dd.png)  
A possible solution is to use the web-based Github Codespaces or vscode.dev and Deno instead of Node.

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 25, 2023, 3:41pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/11 "2023-05-25T15:41:21Z")

</div>

We are absolutely thrilled to announce that we have successfully added a Dev Container for the Internet Computer to both VS Code desktop and Github Codespaces 🥳. This addition, which was just approved a few hours ago, will now be globally accessible in every application that supports the dev container specification. Significantly, this marks the first-ever inclusion of a Web3 Dev Container template into such a registry.

List of supporting tools [https://containers.dev/supporting](https://containers.dev/supporting)

If you have the “Dev Containers” extension, you can start developing on the IC after a few clicks without having to worry about setting your environment. There are a few benefits:

- **Security** - NPM extensions and scripts you run won’t have access to your computer, because they are inside a Docker. It’s pretty insecure to run public projects locally. Deno fixes some of these concerns, but it’s not as popular as Node.

- **Replicability** - Your whole team and the public will be able to run your projects and see the same thing without additional environment setup. Our Dockerfile is based on the one for reproducible builds [https://internetcomputer.org/docs/current/developer-docs/backend/reproducible-builds/](https://internetcomputer.org/docs/current/developer-docs/backend/reproducible-builds/) This means if you get your project running inside a Dev Container, you are one step from creating Dockerfiles that compile your reproducible builds. Think of Docker Containers as reproducible apps. If you are only reproducing the wasm files, that won’t allow others to see how the app works locally without them compromising their security.

If you run this command you will be creating a blank container that’s not mounting any local folder.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/2/25ebf823b7024a5f385b8c29cb740d6005463560.png)

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/7/738f648f63903c4125da4fe35787b7932912b8be.jpeg)

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/2/243193e720b268745fae36427b096f2cafcc48a2.png)

You can then start with sns/1\_start.blast and get the whole NNS running locally, then launch your local SNS within minutes.

## What Dev Containers do?

They are isolated containers you can start and stop whenever you want. Applications inside can’t touch the files outside of containers except for the folders you mounted.

.devcontainer/devcontainer.json - config  
.devcontainer/Dockerfile - build instructions  
… the rest of the files are examples and will contain example projects to kickstart Motoko, Rust, Azle, Kybra projects.

You can take this folder from the templates and place it in your own projects. You can also do that by clicking this green button and choosing “Add dev configuration files” or typing the command

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/2/21ba1f417f390581f15a5cd082ae7e2081d9c528.png)  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/8/81c2f4a48ee7fcafea57f5f738635371b7ea7707.png)

If you copy the .devcontainer files inside your own project, then all you need to do is hit +

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/9/9a6b2be6a689bad7fea02fa762f79f45c9dc13e8.png)  
and ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/5/54d8348d27a390444a6cf0037243d5eb09f6bec8.png)

You can also modify the Dockerfile however you want, we are just providing the starting template.

VS Code info about Dev Containers [Developing inside a Container](https://code.visualstudio.com/docs/devcontainers/containers)

Good luck with whatever obstacles there may be ahead and have fun!

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/1/148e03c1e422d1c05ff5c7b3d3d35cbd3bcb804f.jpeg)

---

<div class="post-metadata">

**Author:** ![Fulco](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/fulco/32/910_2.png) [@Fulco](https://forum.dfinity.org/u/Fulco)\
**Post date:** [May 26, 2023, 1:59pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/12 "2023-05-26T13:59:24Z")

</div>

Sadly doesn’t seem to work on an apple silicon mac ☹ .

I have tried to make a devcontainer in the past, but annoyingly the sdk doesn’t have an aarch64 build [SDK for aarch64 · dfinity/sdk · Discussion #2642 · GitHub](https://github.com/dfinity/sdk/discussions/2642)

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [May 26, 2023, 3:07pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/13 "2023-05-26T15:07:46Z")

</div>

You can use Codespaces.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/7/761bf2e50d9b1ea64979b9b447fa95e58acea22e.jpeg)  
I suppose one has to make sure they stop their containers when not in use.

UPDATE: Made the Blast Node Kernel use esbuild, now it can import libraries.  
Dockerfile is getting fixed right now. no sudo and Nvm was installed for the root user.  
Whoever used the previous version should recreate their containers (the new version is coming later today)

---

<div class="post-metadata">

**Author:** ![pramitgaha](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/pramitgaha/32/11659_2.png) [@pramitgaha](https://forum.dfinity.org/u/pramitgaha)\
**Post date:** [June 30, 2023, 11:53pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/14 "2023-06-30T23:53:44Z")

</div>

hello @infu  
I’m trying out the container:  
it fails with the following error:

```auto
 => ERROR [builder 3/13] RUN curl http://archive.ubuntu.com/ubuntu/pool/ 1.2s
------                                                                          
 > [builder 3/13] RUN curl http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb --output libssl1.deb && dpkg -i libssl1.deb:                            
#0 0.194 % Total % Received % Xferd Average Speed Time Time Time Current
#0 0.194 Dload Upload Total Spent Left Speed
100 1101k 100 1101k 0 0 1126k 0 --:--:-- --:--:-- --:--:-- 1125k  
#0 1.219 dpkg: error processing archive libssl1.deb (--install):
#0 1.219 package architecture (amd64) does not match system (arm64)
#0 1.231 Errors were encountered while processing:
#0 1.231 libssl1.deb
------
Dockerfile-with-features:23
--------------------
  21 |     
  22 | # Ubuntu 23.04 comes with libssl3 while dfx uses libssl1.1
  23 | >>> RUN curl http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb --output libssl1.deb && dpkg -i libssl1.deb
  24 |     
  25 |     
--------------------
error: failed to solve: process "/bin/sh -c curl http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb --output libssl1.deb && dpkg -i libssl1.deb" did not complete successfully: exit code: 1
[126705 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.42.0-1688168989295/Dockerfile-with-features -t vsc-ic-2-b06f1d4b63a661fe184e84ea57fad2dce9ee9100435f6a2ceb6e1f8e6f43d2f8 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=builder /workspaces/ic-2/.devcontainer
[126706 ms] at vte (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2004:1698)
[126706 ms] at runMicrotasks (<anonymous>)
[126706 ms] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[126707 ms] at async zx (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2003:3911)
[126707 ms] at async IN (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2003:2830)
[126707 ms] at async Ote (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2020:3660)
[126707 ms] at async Hf (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2020:4775)
[126707 ms] at async Qre (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2151:10371)
[126708 ms] at async Zre (/root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js:2151:10112)
[126721 ms] Exit code 1
[126722 ms] Start: Run: docker rm -f be3efe7e89fb8a6bffc82cbebe99931bea66cdfefdc670e129607027d8902a72
[126724 ms] Command failed: node /root/.vscode-remote-containers/dist/dev-containers-cli-0.295.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-8c7731a7-0168-4287-86be-1c89befae7411688168970383 --workspace-folder /workspaces/ic-2 --workspace-mount-consistency cached --id-label vsc.devcontainer.volume.name=ic-2 --id-label vsc.devcontainer.volume.folder=ic-2 --id-label devcontainer.config_file=/workspaces/ic-2/.devcontainer/devcontainer.json --log-level debug --log-format json --config /workspaces/ic-2/.devcontainer/devcontainer.json --override-config /tmp/devcontainer-4392ab1d-4ccf-44bd-94e3-234a9e49e520.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=ic-2,target=/workspaces,external=true --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default off --mount-workspace-git-root true
[126724 ms] Exit code 1

```

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [July 1, 2023, 11:30am UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/15 "2023-07-01T11:30:24Z")

</div>

Can’t see anything that makes sense in this error.

I’ve just rebuilt it with DFX 4.2 and it worked out.  
Then I uploaded the built image to Docker Hub and placed it inside devcontainer.json.  
This way it won’t take 12min to launch it the first time, probably less than 1min.  
You can pull the latest repo and try again.

---

<div class="post-metadata">

**Author:** ![pramitgaha](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/pramitgaha/32/11659_2.png) [@pramitgaha](https://forum.dfinity.org/u/pramitgaha)\
**Post date:** [July 1, 2023, 12:30pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/16 "2023-07-01T12:30:02Z")

</div>

4.2 ??  
I have 14.1  
so to use the container I need to downgrade dfx to 4.2?

---

<div class="post-metadata">

**Author:** ![pramitgaha](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/pramitgaha/32/11659_2.png) [@pramitgaha](https://forum.dfinity.org/u/pramitgaha)\
**Post date:** [July 1, 2023, 12:30pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/17 "2023-07-01T12:30:52Z")

</div>

I got the error in both ways, cloning the code and using `new dev container` too.

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [July 1, 2023, 2:28pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/18 "2023-07-01T14:28:25Z")

</div>

typo. I meant 14.2 (it’s inside the docker, you don’t need to upgrade or downgrade)

> [@pramitgaha](#):
>
> got the error in both ways

What is your PC and OS? Maybe that is the problem. Also, your Docker version could be old.  
You are using this correct? [https://github.com/infu/internet-computer-start](https://github.com/infu/internet-computer-start)

You can also check Codespaces. Click on Use this template and open in Codespaces

---

<div class="post-metadata">

**Author:** ![Inuani](https://avatars.discourse-cdn.com/v4/letter/i/c77e96/32.png) [@Inuani](https://forum.dfinity.org/u/Inuani)\
**Post date:** [October 28, 2023, 1:57pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/19 "2023-10-28T13:57:44Z")

</div>

I am trying to use it but I get so many permission errors.

I did change the version of Rust and dfx in the Dockerfile

```auto
ENV RUST_VERSION=1.71.0
and 
ENV DFX_VERSION=0.15.1

```

but I get the older version anyway  
I managed to changed the version of Rust but other errors and now I have

```auto
/usr/bin/ld:/tmp/rustcbvyiC5/list:3: syntax error in VERSION script

```

when I do cargo build because of other errors when I run dfx deploy

the project is deploying fine on my computer when not on docker

---

<div class="post-metadata">

**Author:** ![infu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/infu/32/11321_2.png) [@infu](https://forum.dfinity.org/u/infu)\
**Post date:** [October 29, 2023, 1:34pm UTC](https://forum.dfinity.org/t/internet-base-vs-code-extension/20080/20 "2023-10-29T13:34:08Z")

</div>

I’ve made the last one to start from a docker image so it should spawn a lot faster and if a remote API breaks should work still.  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/6/62d180f360e8a2e87fc625a43db0f845c2335520.png)  
[https://github.com/infu/internet-computer-start/blob/main/.devcontainer/devcontainer.json](https://github.com/infu/internet-computer-start/blob/main/.devcontainer/devcontainer.json)

If you start changing versions, you may find this useful [https://internetcomputer.org/docs/current/developer-docs/backend/reproducible-builds](https://internetcomputer.org/docs/current/developer-docs/backend/reproducible-builds)
