<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Ganache_CLI</id>
	<title>Ganache CLI - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Ganache_CLI"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Ganache_CLI&amp;action=history"/>
	<updated>2026-04-26T01:20:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Ganache_CLI&amp;diff=37&amp;oldid=prev</id>
		<title>imported&gt;Jeremy-busk at 18:27, 18 January 2019</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Ganache_CLI&amp;diff=37&amp;oldid=prev"/>
		<updated>2019-01-18T18:27:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;# Installing &amp;amp; Using Ganache CLI on Ubuntu:Bionic or Debian:Buster Environment&lt;br /&gt;
&lt;br /&gt;
This assumes you are suing nodejs v8.15.0 or greater or npm v6.4.1 or greater though may work on older.&lt;br /&gt;
&lt;br /&gt;
Check dependencies&lt;br /&gt;
```&lt;br /&gt;
node -v&lt;br /&gt;
npm -v&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Install dependencies&lt;br /&gt;
```&lt;br /&gt;
sudo apt update &amp;amp;&amp;amp; apt install nodejs npm git&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Install ganache-cli&lt;br /&gt;
```&lt;br /&gt;
sudo npm install -g ganache-cli&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Run ganache-cli&lt;br /&gt;
```&lt;br /&gt;
ganache-cli&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Run node console/repl&lt;br /&gt;
```&lt;br /&gt;
node&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Run some commands in node console/repl&lt;br /&gt;
```&lt;br /&gt;
var Web3 = require('web3');&lt;br /&gt;
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Using LXD&lt;br /&gt;
&lt;br /&gt;
If you're having issues getting ganache-cli working on my localhost environment on Ubuntu, use a LXD container.&lt;br /&gt;
&lt;br /&gt;
## Installing LXD&lt;br /&gt;
&lt;br /&gt;
Answer default to all questions.&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
sudo apt install lxd zfsutils-linux &amp;amp;&amp;amp; lxd init&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Open two terminals on your pc to interact with container and api&lt;br /&gt;
&lt;br /&gt;
Change to ganache-test-container to whatever name you want.&lt;br /&gt;
&lt;br /&gt;
### Terminal 1&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
lxc launch ubuntu:bionic ganache-test-container&lt;br /&gt;
lxc exec ganache-test-container /bin/bash&lt;br /&gt;
apt update &amp;amp;&amp;amp; apt install nodejs npm git&lt;br /&gt;
npm install -g ganache-cli&lt;br /&gt;
ganache-cli&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
## Terminal 2&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
PORT=8545 PUBLIC_IP=localhost CONTAINER_IP=$(lxc list | grep ganache-test-container  | awk -F\| '{print $4}'| awk '{print $1}'); sudo iptables -t nat -I PREROUTING -i lo -p TCP -d $PUBLIC_IP --dport $PORT -j DNAT --to-destination $CONTAINER_IP:$PORT -m comment --comment &amp;quot;ganache-cli&amp;quot;&lt;br /&gt;
```&lt;br /&gt;
You should now be able to connect on you localhost via localhost:8545&lt;br /&gt;
&lt;br /&gt;
# Using Docker&lt;br /&gt;
&lt;br /&gt;
# References&lt;br /&gt;
* https://github.com/trufflesuite/ganache-cli&lt;br /&gt;
* https://web3js.readthedocs.io/en/1.0/getting-started.html&lt;/div&gt;</summary>
		<author><name>imported&gt;Jeremy-busk</name></author>
	</entry>
</feed>