<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alex Barnsley on Medium]]></title>
        <description><![CDATA[Stories by Alex Barnsley on Medium]]></description>
        <link>https://medium.com/@alexbarnsley?source=rss-6eadc24c600------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2nBHw_nW_IBuoRB4c683Ig.jpeg</url>
            <title>Stories by Alex Barnsley on Medium</title>
            <link>https://medium.com/@alexbarnsley?source=rss-6eadc24c600------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 10:40:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexbarnsley/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ARK Deployer v2 — Setup Guide]]></title>
            <link>https://medium.com/ark-io/ark-deployer-v2-setup-guide-55b96555d10e?source=rss-6eadc24c600------2</link>
            <guid isPermaLink="false">https://medium.com/p/55b96555d10e</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Alex Barnsley]]></dc:creator>
            <pubDate>Mon, 18 Mar 2019 19:24:29 GMT</pubDate>
            <atom:updated>2019-03-18T19:24:29.657Z</atom:updated>
            <content:encoded><![CDATA[<h3>ARK Deployer v2 — Setup Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqkyhgSoY4ygLNs0RqZ0TA.png" /></figure><p><strong><em>With the much-anticipated Deployer v2 arrival, we made sure to accompany the release with a full guide. This guide outlines the setup of a new Bridgechain, setting up a multi-node network, and also adding a new Bridgechain to the ARK Desktop Wallet.</em></strong></p><h4>Prerequisites</h4><ul><li>A fresh Ubuntu 18 machine (or VirtualBox with Vagrant).</li><li>Basic knowledge of system administration, command-line, and bash.</li></ul><blockquote>This guide is written based on a specific set of configurations that we have used. Yours will differ, more-so in terms of settings for your Bridgechain and IP addresses for your nodes.</blockquote><h3>Setting up a new Bridgechain</h3><p>You have 2 options to set up your own Bridgechain:</p><ul><li><strong>Install your new Bridgechain (with Vagrant)</strong> — follow this very small section for setting it up with Vagrant then skip to section: <strong><em>Adding the Bridgechain to your Desktop Wallet</em></strong>.</li><li><strong>Install your new Bridgechain (without Vagrant)</strong> — follow from this section onwards if you want to set up core manually and have a better understanding of the installation steps.</li></ul><h4>Install your new Bridgechain (with Vagrant)</h4><p>We have provided a Vagrant file which allows you to deploy your own Bridgechain and Explorer together with no configuration necessary. All IPs when referencing Core and Explorer from the Vagrant machine will use <strong>192.168.33.10</strong>.</p><blockquote><strong><em>Note: This requires Vagrant version 2+ to be installed from </em></strong><a href="https://www.vagrantup.com/downloads.html"><strong><em>here</em></strong></a><strong><em>, and also VirtualBox from </em></strong><a href="https://www.virtualbox.org/wiki/Downloads"><strong><em>here</em></strong></a><strong><em>.</em></strong></blockquote><p><strong>Download ARK Deployer</strong></p><pre>$ git clone <a href="https://github.com/ArkEcosystem/deployer.git">https://github.com/ArkEcosystem/deployer.git</a> ~/ark-deployer &amp;&amp; cd ~/ark-deployer</pre><p><strong>Initiating a Vagrant Machine<br></strong>Used to start a Vagrant machine. If the Vagrant machine already exists, it will resume as normal. If the Vagrant machine does not exist already, it will start it up and proceed to install Deployer, Core and Explorer.</p><pre>$ vagrant up</pre><p>As soon as the Vagrant process has finished installing, the machine will reboot. Once rebooted, Core and Explorer will start automatically and will be accessible at the following URLs:</p><ul><li><strong><em>Core Public API: </em></strong><a href="http://192.168.33.10:4103/api/v2/blocks">http://192.168.33.10:4103/api/v2/blocks</a></li><li><strong><em>Explorer: </em></strong><a href="http://192.168.33.10:4200/">http://192.168.33.10:4200/</a></li></ul><p><strong>Destroying a Vagrant Machine<br></strong>NOTE: This option is only necessary if you want to completely remove the Vagrant machine. Only run this if you plan on creating a new Vagrant Bridgechain later on since <strong>ALL Data will be lost</strong>.</p><pre>$ vagrant destroy</pre><p><strong>Tweaking Bridgechain Options (Advanced)</strong></p><p>Open up ~/ark-deployer/vagrant/config.json and you will see all the possible options that you can change. These are all used when deploying the Bridgechain with Vagrant and can be customized. Refer to the <a href="https://github.com/ArkEcosystem/deployer#core-installation"><strong>node options</strong></a><strong> </strong>and <a href="https://github.com/ArkEcosystem/deployer#explorer-installation"><strong>Explorer options</strong></a> before continuing to get an idea of the purpose of each option. Once you are happy with your config, go ahead and start the Vagrant environment as above. After a short while, your new chain will be set up and your Testnet will be automatically started.</p><blockquote><strong>Note</strong>: If you change config.json, you will need to destroy and re-initiate your vagrant set up.</blockquote><h4>Install your new Bridgechain (without Vagrant)</h4><p>In order to create a new Bridgechain without Vagrant, we need to start with a new Core node. This will initially be our auto-forging node, with which we can slowly add additional nodes in the future to begin growing the network. We will be running the Testnet for now, but production networks would run the Mainnet configuration.</p><blockquote>Note: Snippets starting with a <strong>$</strong> imply a command that needs to be run on your server. You do not copy the <strong>$</strong> itself.</blockquote><h4>Remote into your new server with SSH</h4><p>Make sure to remote in as a normal user with sudo access, not as root. You won’t be able to install the Bridgechain as a super-user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*IPkj8M23PnBu4VsP9wcWpw.png" /></figure><h4>Download and prepare ARK Deployer</h4><pre>$ sudo apt-get update &amp;&amp; sudo apt-get install -y git curl<br>$ git clone <a href="https://github.com/ArkEcosystem/deployer.git">https://github.com/ArkEcosystem/deployer.git</a> ~/ark-deployer &amp;&amp; cd ~/ark-deployer<br>$ source setup.sh</pre><p>Now that our machine is set up for our bridgechain, we can go ahead and get it installed. Run the below command to install a simple, modified, core instance:</p><pre>$ ./bridgechain.sh install-core --name MyBridgechain --database-name core_mybridgechain --token MYBRIDGECHAIN --symbol MB --explorer-ip 95.216.157.210 --autoinstall-deps</pre><blockquote><strong>Note:</strong> Insert your server or local IP here instead of 95.216.157.210.</blockquote><blockquote><strong>Note 2:</strong> There are many more options available when setting up your Bridgechain which can be found <a href="https://github.com/ArkEcosystem/deployer#core-installation"><strong>here</strong></a>. You can also use a<strong> </strong><a href="https://github.com/ArkEcosystem/deployer#json-config"><strong>JSON config file</strong></a> to specify your parameters.</blockquote><p>After about 10 minutes (can vary depending on the specification of the machine), the Deployer will finish installing Core.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riMSg3PKNWvKSo5tvXg5EQ.png" /><figcaption>Bridgechain successfully installed — you can see the Genesis Wallet details above.</figcaption></figure><p>When the install completes, you will see the above output. This is basically informing you of the information you will need in order to interact with your new networks.</p><h4>Start your new Bridgechain Testnet</h4><pre>$ ./bridgechain.sh start-core --network testnet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*_2Xr9YtTa2DarE5UKMWAQg.png" /><figcaption>Your Bridgechain Testnet has now been started.</figcaption></figure><h4>Checking Core is running</h4><p>Now that our new Testnet is running, we need to make sure it’s working correctly. Firstly, we can make sure there are no errors showing up in the logs. To do this, use the following command:</p><pre>$ ./bridgechain.sh logs-core</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImVblWIkYdUc7mnxOU6e3Q.png" /><figcaption>We can see here from both the forger log and the relay log, that blocks are being forged and processed on the local network.</figcaption></figure><p>Next, we can check to make sure the core processes are running using PM2. enter the below and it will list the currently running processes:</p><pre>$ pm2 list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kl28EdY9HffW3ImECDTMWA.png" /></figure><p>Finally, we can test the API, which should also give us confirmation that blocks are being forged. Head over to <a href="http://95.216.157.210:4103/api/v2/blocks">http://95.216.157.210:4103/api/v2/blocks</a>.</p><blockquote><strong>Note:</strong> Use your server or local IP here.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p8vRipTRgvXktld6obcPkA.png" /><figcaption>You will see that the block height is going up as expected, with the example above showing us we’re currently at height 44.</figcaption></figure><p>This is great confirmation that our testnet is working! However, it’s a bit of an eye-sore, so we should head to the next step.</p><h3>Setting up your Bridgechain Explorer</h3><p>The Explorer is a critical tool when viewing, managing or interacting with any Blockchain. In the case of ARK and ARK Bridgechains, it allows for checking up on the currently active delegates (as well as inactive), we can take a look at transactions being processed, and finally, we can see all the blocks which are being forged.</p><h4>Install Explorer</h4><p>Installation of the Explorer is just as simple as installing Core. Run the command below to get the process started:</p><pre>$ ./bridgechain.sh install-explorer --name MyBridgechain --token MYBRIDGECHAIN --core-ip 95.216.157.210 --explorer-ip 95.216.157.210 --skip-deps</pre><blockquote><strong>Note</strong>: Use your server or local IP here.</blockquote><blockquote><strong>Note 2:</strong> As with Core, there are many more options available when setting up your Explorer which can be found <a href="https://github.com/ArkEcosystem/deployer#explorer-installation"><strong>here</strong></a>. You can also use a <a href="https://github.com/ArkEcosystem/deployer#json-config"><strong>JSON config file</strong></a> here too in order to specify your parameters.</blockquote><h4>Start Explorer</h4><p>Now that we’ve set up our Explorer, we can start it. The start process can take a little time because it has to build based on the network option that is provided.</p><pre>$ ./bridgechain.sh start-explorer --network testnet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hBqKjs-jflqun_7raA4LXg.png" /><figcaption>Automatically shows a list of running processes once started.</figcaption></figure><p>Now that we know the Explorer is running, we can access it from our browser. Head over to <a href="http://95.216.157.210:4200/">http://&lt;your-ip-address&gt;:4200/</a> and take a look.</p><blockquote><strong>Note:</strong> Use your server or local IP here.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8tlX23ATH8zaPQ9hKI6KQ.png" /><figcaption>Explorer home, showing initial transactions from the Genesis Block.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPC6QYX0C8pzN8X9-8tMUQ.png" /><figcaption>Explorer Delegate Monitor, showing the forging status of each genesis delegate.</figcaption></figure><h3>Adding the Bridgechain to your Desktop Wallet</h3><p>Now that we have our Bridgechain Testnet setup and running with an Explorer, we want to get to know it a bit better. What better way to do that than with our beautiful <a href="https://github.com/ArkEcosystem/desktop-wallet/releases"><strong>Desktop Wallet</strong></a>.</p><h4>Adding the Network</h4><p>To begin, open up the Desktop Wallet, click on “<em>Settings</em>” (the gear icon) in the sidebar, and then click on “<em>Manage networks</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxGIviZgfWogv8jfjiJUjg.png" /></figure><p>From the Manage Networks page, click the “<em>Add a new network</em>” option at the top-right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*scJYHQKH_rYUXmdZoq3YGw.png" /></figure><p>In the “<em>New Network</em>” popup, fill in the details for your newly created Bridgechain. Make sure to use the Public API port, not the P2P port for the Seed Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81ZgUJQhrAPfeiyzSqG3QA.png" /></figure><p>Clicking on “<em>Fetch</em>” will proceed to a new form and populate all the data needed in order to access the new Bridgechain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9DyaNTX06ouvoyc9y-nGw.png" /></figure><p>Make any changes you may need (for beginners, leave it as is). Once you are happy, press the “<em>Save</em>” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*1xacMStDr-lSV4PhrgDJNQ.png" /><figcaption>Your new Bridgechain is now available in the list of networks.</figcaption></figure><h4>Creating a Profile</h4><p>Now as I’m sure the majority of the readers here are avid users of our Desktop Wallet, you no doubt know how to create a new profile already. However, in case you are in that small minority, we will go through the steps just to be sure.</p><p>Our first step is to click on the avatar icon at the bottom of the sidebar (<em>it could also be a circle with a letter in the middle depending on what you have</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*ru0N1-xbz_rsJGUhrVrKsQ.png" /><figcaption>The avatar icon in the sidebar.</figcaption></figure><p>From here we need to go ahead and go to the profile creation page. Click on the “<em>Add profile</em>” button at the top-left of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*ZIXZ-jPf-oRUTaTnp7BflA.png" /></figure><p>Now that we have arrived at our destination, we need to fill out or information. Go ahead and fill out step 1. When you’re happy, click “<em>Next</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*qf9FblOHKRULEw4g_IQ1OQ.png" /></figure><p>Step 2, choosing a network. This is the important part. Make sure you select the network we just created, otherwise we will be interacting on the wrong network. Once you’ve chosen, proceed to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*8WHFcJJubhn9r0LAPJiSPQ.png" /></figure><p>Finally, step 3, your profile’s appearance settings. Go ahead and configure your options, and press “<strong>Done</strong>” when you’re happy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*hTIaXBpt_NDVC4o5GFZ-VA.png" /></figure><p>We will now instantly switch to our new profile and be taken to the Dashboard page.</p><h4>Importing Genesis Wallet</h4><p>Now that we have a profile to interact with our network, we need a wallet to test with. For simplicity, we will use our Genesis Wallet.</p><p>From the Dashboard page, click on the “<em>Import Wallet</em>” button at the top-right. You will notice a similar page to the “<em>New Profile</em>” page. Choose to import by passphrase only, and enter the passphrase that was given to you once the Bridgechain finished installing (make sure to use the testnet passphrase).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*Hz9rr_6ei-XwKrwnhUsoWg.png" /></figure><p>Proceed through to Step 3 (you can choose to encrypt your wallet if you wish).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*Id_v8naIq_d5d8P7ywYL_A.png" /></figure><p>Name your wallet (E.g. Genesis Wallet) and click “<em>Done</em>”. If you chose to encrypt your wallet, you will receive a popup telling you it is being encrypted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IfJW80f29_YpOPVmsbMDHA.png" /></figure><p>As soon as we finish importing our wallet, we’ll be taken straight to the wallet page. You will notice straight away that we have the correct details because it’s showing both the balance and the pre-mine transaction in the transaction list.</p><p>Let’s give it a test. Hitting the “<em>Send</em>” button at the top-right, we’ll be presented with a new popup form. For now, we will just send a transaction to ourselves. Start typing “<em>Genesis</em>” into the recipient field and choose our wallet from the drop-down list. Enter an amount, and fill in the Smartbridge field (if you wish). Unless you chose to enable dynamic fees, we will stick with the default static fee here (may also differ if you changed your static fees).</p><p>Finally, fill in your passphrase (or encrypted password) and press “<em>Next</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DmH-GLJGNBKOiaOVcEVXng.png" /></figure><p>On the next screen, we will see confirmation of all our details. Assuming you are happy, press “<em>Send</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8t40WWaJ3ueztmpP5g3vQ.png" /></figure><p>Now, if we check the logs of our Testnet server we will see our transaction get picked up and forged!</p><pre>$ ./bridgechain.sh logs-core</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVPbo1WpYZ0SaPB9bus4Pw.png" /></figure><p>We can also take a look on Explorer and see our transaction successfully get processed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-1id7YrIDDU03WsB8dclg.png" /></figure><p>So this is good news! We have confirmed that not only have we successfully launched a Testnet and Explorer. We’ve also been able to add the new network to our desktop wallet and send a transaction to the network.</p><h3>Adding a Forging Delegate to the Network</h3><p>Now, it’s all great with getting this far. But we’re only using a single server to manage all of the delegates. We need to make sure we can add additional delegates to the network, outside of the genesis delegates. The best way to do this is to add a new server into the mix, which will be used for forging a completely separate delegate.</p><h4>Storing core on Git</h4><p>The easiest way to do this is to store the core changes in a Git repository. On your existing server, head to the root folder of your new Core installation and check Git’s current status for that folder:</p><pre>$ cd ~/core-bridgechain/<br>$ git status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*GUFJuhKnBoVnGweE9Tap7Q.png" /></figure><p>Assuming you didn’t use the --git-commit parameter, you will get output similar to the above. This is basically showing that we have made some changes to files that need to be updated. We need to do the following steps:</p><p><strong>Fork our ARK Core v2 on GitHub</strong></p><p>Go to <a href="https://github.com/ArkEcosystem/core"><strong><em>https://github.com/ArkEcosystem/core</em></strong></a><strong><em> </em></strong>and click on the “<em>Fork</em>” button at the top-right of the page (don’t forget to star it as well 😊).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*Ot1XvQpx2UeZt3kmLdFmOw.png" /><figcaption>“Fork” button in the top-right.</figcaption></figure><p>Then choose the repository/user where you want to create the fork.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*lBipSCLW1-3fbtmEZ6NzyQ.png" /></figure><p>This will begin creating the forked repository and will automatically refresh when finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*XujOXaPE7o2tgjJrDIkF9A.png" /></figure><p><strong>Change the Git Remote URL</strong></p><p>If you’ve not run Git on the server before, you will need to set up the commit user’s name and email address (ignore this if you already have these details):</p><pre>$ git config --global user.name &quot;ARK Deployer&quot;<br>$ git config --global user.email &quot;support@ark.io&quot;</pre><p>Now, with our newly created fork, we can update the “origin” of our codebase on the server.</p><p>On the home screen of the forked repository, on GitHub, there is a “Clone or download” button on the right, just above the list of files. Depending on whether you’re using SSH keys from your machine or not, you can opt to copy the SSH URL or the HTTPS URL (click the text “Use HTTPS” to switch).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*Y-u0GbL8f-Fsu0UnMBVQaA.png" /></figure><p>Now that you have the URL for the origin, run the below command on your server (replacing the URL with your own):</p><pre>$ git remote set-url origin <a href="/service/mailto:git@github.com">git@github.com</a>:alexbarnsley/core.git<br>$ git remote -v</pre><p>The second command will output the new origin URLs, just as a confirmation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*BVB7VSPISgbcl2rd3Gzb1w.png" /></figure><p>Before we continue, let’s make sure there were no new changes made between us installing and us forking the core repository. You can do this simply by pulling any changes down:</p><pre>$ git pull</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBHrk0EGBkrK065WeIO7QQ.png" /><figcaption>Pull changes from our forked repo.</figcaption></figure><p><strong>Commit &amp; push the changes</strong></p><p>Now, all we need to do is add all the files to the staging area, and commit them. To do this, we run:</p><pre>$ cd ~/core-bridgechain<br>$ git add .<br>$ git commit -m &quot;chore: new network config&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*4SOIKopZuWHk_z7IqT9UYw.png" /><figcaption>The output from our commit command.</figcaption></figure><p>Finally, push your changes to your new repository:</p><pre>$ git push</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*kdaGVahyXtedL_nfQ-lnqQ.png" /><figcaption>Output confirming that our changes have been pushed to our forked repository.</figcaption></figure><h4>Set up new nodes to run your delegate</h4><p>In order to have a functioning network with multiple nodes, we must have more than 2 nodes on the Testnet network. This value is much higher on Mainnet and Devnet, due to how critical these networks are. In order to continue, we must have a total of 3 nodes on our Testnet network because that is the minimum in order for it to continue forging. It is possible for the seed node to forge on its own because that is running in “test” mode, which allows forging on the same machine regardless of peers on the network.</p><p>So, what we will need to do at this point is set up our 2 new nodes. We’ll call these delegate-1 and relay-1. The easiest way to go about adding these new nodes to the network is to run the core Deployer process (from the very first step in this guide) but on the new servers. Go ahead and do that now until you have installed core on both, but don’t yet start core on either.</p><p><strong>Switching config details to our forked repository</strong></p><p>Now that we have 2 newly deployed nodes ready for our network, we need to update the codebase to use our forked repository which we set up in our previous step.</p><p>Change the origin to match the GitHub repo. As all GitHub forks are made public automatically, you can simply use the HTTPS URL unless you plan on making code changes directly on the new servers.</p><pre>$ cd ~/core-bridgechain<br>$ git remote set-url origin <a href="https://github.com/alexbarnsley/core.git">https://github.com/alexbarnsley/core.git</a><br>$ git fetch --all<br>$ git checkout packages<br>$ git pull</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*D-8U27SGyzm6lHMrGl7-MA.png" /></figure><p>Now we’ve updated our files, we need to rebuild Core. This is important to make sure the new config files are used:</p><pre>$ yarn setup</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*zYV9qwj-5kF_n1ldP1WTvA.png" /><figcaption>The successful output of Core setup.</figcaption></figure><h4>Register a delegate on the network</h4><p>Now that we are ready with the codebase, we need to register our delegate with the network.</p><p>In the Desktop Wallet, create a new wallet. You do this by going to the Wallet List (the wallet icon in the sidebar) and clicking “<em>Create wallet</em>”. Choose an address (refresh until you find one you like), and click “<em>Next</em>”. Write your passphrase down, and press “<em>Next</em>”. Fill in the 3 missing words and continue to the next step. Encrypt the wallet passphrase if you want to, and on the final step, choose a name.</p><p>Once you press “<em>Done</em>” to save your wallet, you will be taken to the wallet page. What we need to do first, however, is go back to the Genesis Wallet we set up earlier in this guide and send us some tokens so we can register our own delegate name. We’ve covered that also, so head to the Genesis Wallet and click “<em>Send</em>”. Make sure you select the new delegate wallet as the recipient:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*9M7JQi72cjyZs-OtAVTttw.png" /></figure><p>The number of tokens shouldn’t matter too much, but we will just send over 5000 for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dz1OIdDm0lQK6ZKhsuNLPA.png" /><figcaption>New delegate wallet after receiving tokens from our genesis wallet.</figcaption></figure><p>Now we need to register the delegate name. Click on the button with 3 vertical dots, next to the “<em>Send</em>” button on the wallet page. You will now see a new series of additional buttons. Click on “<em>Register delegate</em>” to open the form for delegate registrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7X6VNgyM1sRMqNEJD8emaA.png" /></figure><p>Enter a username and your passphrase (or encrypted password), and click “Next”. We left the transaction fee because we’re still using static fees (unless you set up your Bridgechain differently).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XOwLii9ePRaaIOoHy2y5qg.png" /></figure><p>Confirm all the details on the transaction confirmation window, and press “<em>Send</em>” once you’re happy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NAdL7AOXsuuoSRjSGLVYjg.png" /></figure><p>Now if you head over to your Explorer, the most recent transaction for a delegate registration will be showing there. You can click the wallet name (in my case, “alexbarnsley”) to view the wallet. At the top of the wallet, there will be an area specifically visible for registered delegates on the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HoAu-iwzK5LurplKXOLIlg.png" /></figure><h4>Set up relay server &amp; delegate server for forging</h4><p>Now that we have a delegate ready for forging, we can now set up Core. We will use the built-in Core CLI to manage the new nodes.</p><p>We will start by publishing our node’s config. This will copy across the necessary config files to a standard config path ~/.config/MyBridgechain:</p><pre>$ cd ~/core-bridgechain<br>$ ./packages/core/bin/run config:publish --token=MyBridgechain</pre><p>This will then ask which network we want to use — choose “testnet” from the options (you can also pass in --network=testnet to the command to skip the confirmation)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmWliZnEOgDB8952G587eg.png" /></figure><p>Confirm your choice and the details will be saved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1MJYJKTLwRjh80uRiXZUvw.png" /></figure><p>Now that we have configured our Core, we need to update the peers for our 2 new nodes, otherwise, they will never talk to each other. Open up the new peers.json file here ~/.config/MyBridgechain-core/testnet/peers.json and add in all the peers on the network, so it looks like (Don’t forget to change the IPs to your own!):</p><pre>{<br>  &quot;list&quot;: [<br>    {<br>      &quot;ip&quot;: &quot;95.216.157.210&quot;,<br>      &quot;port&quot;: 4102<br>    },<br>    {<br>      &quot;ip&quot;: &quot;95.216.166.203&quot;,<br>      &quot;port&quot;: 4102<br>    },<br>    {<br>      &quot;ip&quot;: &quot;195.201.90.217&quot;,<br>      &quot;port&quot;: 4102<br>    }<br>  ],<br>  &quot;sources&quot;: []<br>}</pre><p>The next step in our configuration is to clear out the delegates.json file ~/.config/MyBridgechain-core/testnet/delegates.json. With the delegate forging node, delegate-1, we need to add our new delegate passphrase. Leave the list empty for relay-1. It should end up looking like the following for delegate-1:</p><pre>{<br>  &quot;secrets&quot;: [<br>    &quot;your passphrase&quot;<br>  ]<br>}</pre><p>And should look like the following for relay-1:</p><pre>{<br>  &quot;secrets&quot;: []<br>}</pre><p>Now we need to start the forger on delegate-1. Run the command:</p><pre>$ ./packages/core/bin/run forger:start</pre><p>Once started, we will need to start our relay on both delegate-1 and relay-1:</p><pre>$ ./packages/core/bin/run relay:start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AqXD6cnaLfJy8F4oqF4Ypg.png" /></figure><p>Once the 2 new nodes are running, it can take a few minutes for the relays to kick in and catch up with the seed relay we have set up. Once it has, it will start receiving blocks and then broadcasting them again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guvKwP7p3Cy2lH3g7Tg_rA.png" /></figure><p>Because none of the genesis delegates have any vote weight, it is possible for your newly created delegate to appear in the list of forgers due to how the forging order works.</p><h4>Voting for your own delegate</h4><p>This is the crucial part. To make sure we remain within the active forger list, we need to vote for our own delegate. We will do this from within the desktop wallet.</p><p>Open up your desktop wallet and go to the delegate wallet we created earlier. From here, click on the “<em>Delegates</em>” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FB7coJjN8cTsBKFTtbnfAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkLG3JwrWQRVj8JpPKNi_w.png" /><figcaption>Find your delegate (sorting by Username can help)</figcaption></figure><p>Find our new delegate in the list, and click on it to view the details. Then click on the “<em>Vote</em>” button at the bottom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*IVa9wXm_ALICUeWVzKmQXA.png" /></figure><p>Once you’ve entered your passphrase or encryption password, you’ll be presented with the usual confirmation window. Press “<em>Send</em>” once you’re happy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*AZV9j-ZWD4PJvty51WgYTQ.png" /></figure><p>As soon as the Vote transaction is applied and the current forging round ends, the delegate will go up to Rank 1 due to the genesis delegates having no vote weight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJoeCIcokyFfEffL7HB0hg.png" /></figure><p>After a short while, you will be able to see blocks get processed. This will be reflected both in Explorer and in the logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fAHmUbqD9Hjxxnfc7ivSDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8g4oxV07BdWAQvG5YqLmkQ.png" /></figure><h3>Conclusion</h3><p>Well, there you have it. Your very own Testnet network with your own forging delegate running on an independent node. The same process can be done with Mainnet and Devnet, however, you will need to add many more peers to the network to ensure blocks are forged and the network continues to move forward. This is also important to avoid scenarios such as “split brain” chains, where multiple forks can become the correct chain at the same time.</p><h3>Your Next Steps</h3><p>Get your Mainnet peers set up and ready to secure the network (do the same with Devnet if you need one). It is best to also move your genesis delegate passphrases at the same time. For example, add 51 relay nodes to the network, and split up the 51 delegate passphrases into the new nodes. This removes the single-point failure that could result in the entire network going down if the single forging node stops working (the node you used to set up the Bridgechain).</p><p>You also need to secure the pre-mine tokens in the Genesis Wallet. In the majority of networks, these tokens are critical for the lifetime of the network so losing them could be a major problem for your networks.</p><h3>JSON Config File</h3><p>There is also a sample JSON config file provided for Deployer. This config file provides all possible options making it easy to determine what can be changed when deploying your own chain. A basic example JSON file:</p><pre>{<br>    &quot;coreIp&quot;: &quot;0.0.0.0&quot;,<br>    &quot;p2pPort&quot;: 4102,<br>    &quot;apiPort&quot;: 4103,<br>    &quot;explorerIp&quot;: &quot;127.0.0.1&quot;,<br>    &quot;explorerPort&quot;: 4200<br>}</pre><p>This can simply be used with the following command:</p><pre>$ ./bridgechain.sh install-core --config /path/to/config.json</pre><p>You can read more about the JSON config file <a href="https://github.com/ArkEcosystem/deployer#json-config">here</a>, and find the sample config file <a href="https://github.com/ArkEcosystem/deployer/config.sample.json">here</a>.</p><h3>FAQ</h3><ol><li><strong>I lost my Genesis Passphrase. Where can I find it?</strong><br>Assuming you still have access to your original deployment server, you will be able to find the genesis wallet passphrase in ~/.bridgechain/NETWORK/NETWORK_NAME/genesisWallet.json, replacing NETWORK with the network name (mainnet, devnet or testnet), and replacing NETWORK_NAME with the name used to deploy (E.g. “MyBridgechain”).</li><li><strong>Will Deployer work on XYZ Operating System?</strong><br>We recommend running ARK Core on Ubuntu 18 and upwards. It may be possible on other operating systems, but it is more specifically tested on this particular version.</li><li><strong>Can I change the fees for my Bridgechain?</strong><br>Absolutely! You can change the fees just like with many other options. It does get a little complicated when dealing with Dynamic Fees, which is functionality that comes with Core v2, but you can see specific options for Static Fees <a href="https://github.com/ArkEcosystem/deployer#static-fees">here</a>, and Dynamic Fees <a href="https://github.com/ArkEcosystem/deployer#dynamic-fees-more-information">here</a> to get a better understanding.</li><li><strong>What is a Seed Node?</strong><br>A Seed Node is used as a master node. It is a node that is used as a basis for peers to connect with, to then become “attached” to the Network.</li></ol><blockquote><strong>You can use our Github to report issues or provide some feedback for improvements: </strong><a href="https://github.com/arkecosystem/deployer/issues"><strong>https://github.com/arkecosystem/deployer/issues</strong></a></blockquote><p><strong><em>Follow us on social media ( </em></strong><a href="https://twitter.com/ArkEcosystem"><strong><em>Twitter</em></strong></a><strong><em> | </em></strong><a href="https://www.facebook.com/ArkEcosystem/"><strong><em>Facebook</em></strong></a><strong><em> | </em></strong><a href="https://www.reddit.com/r/arkecosystem"><strong><em>Reddit</em></strong></a><strong><em> ), join our community ( </em></strong><a href="https://ark.io/slack"><strong><em>Slack</em></strong></a><strong><em> | </em></strong><a href="https://discord.ark.io/"><strong><em>Discord</em></strong></a><strong><em> ) and stay tuned to our blog on </em></strong><a href="https://blog.ark.io/"><strong><em>Medium</em></strong></a><strong><em> and on </em></strong><a href="https://steemit.com/@arkecosystem"><strong><em>Steemit</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55b96555d10e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ark-io/ark-deployer-v2-setup-guide-55b96555d10e">ARK Deployer v2 — Setup Guide</a> was originally published in <a href="https://medium.com/ark-io">ARK.io | Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ark Deployer — Setup Guide]]></title>
            <link>https://medium.com/ark-io/ark-deployer-setup-guide-c10825ebb0e4?source=rss-6eadc24c600------2</link>
            <guid isPermaLink="false">https://medium.com/p/c10825ebb0e4</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Alex Barnsley]]></dc:creator>
            <pubDate>Fri, 16 Feb 2018 13:56:17 GMT</pubDate>
            <atom:updated>2018-02-26T08:01:33.898Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DK6i-skLl0U_RM7r3Q6FpA.png" /></figure><p><strong>This guide is to help you get setup with your own ARK bridgechain. It will focus on launching your own ARK clone bridgechain, auto-forging setup, adding your own delegate nodes and making it accessible via the ARK wallet.</strong></p><h4>Prerequisites</h4><ul><li>A fresh Ubuntu 16.04 machine.</li><li>Basic knowledge of system administration, command-line and bash.</li></ul><p>This guide is written based on a specific set of configurations that we have used. Yours will differ, more-so in terms of settings for your bridgechain and IP addresses for your nodes.</p><h3>Setting up your Bridgechain Node</h3><p>The nodes are a core part of the network. They are what forge the blocks, validate transactions, provide API access to the data contained within the network, and ultimately what keeps everything running and secure.</p><h4>Remote into your machine using SSH</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*RgS_DVYaCDVs9fZ1." /></figure><h4>Download ARK Deployer</h4><pre>cd ~ &amp;&amp; git clone <a href="https://github.com/ArkEcosystem/ark-deployer.git">https://github.com/ArkEcosystem/ark-deployer.git</a> &amp;&amp; cd ark-deployer</pre><p><strong><em>Note: this is a one line command so copy / paste whole part.</em></strong></p><h4>Install NodeJS and NPM</h4><pre>curl -o- <a href="https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh">https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh</a> | bash</pre><pre>source ~/.profile<br>nvm install 8.9.1<br>sudo apt-get update &amp;&amp; sudo apt-get install -y jq</pre><p><strong><em>Note: curl command ends with bash command so just copy / paste the whole line.</em></strong></p><h4>Install &amp; Setup Your Bridgechain</h4><pre>./bridgechain.sh install-node --name MyTest --database ark_mytest --token MYTEST --symbol MT --node-ip 51.141.3.209 --explorer-ip 51.141.3.209 --autoinstall-deps</pre><p><strong><em>Note: Use your Public IP here and the whole command is one line, so copy / paste the whole part.</em></strong></p><p>There are many more options available when installing the node, which can be found <a href="https://github.com/ArkEcosystem/ark-deployer#optional-parameters">here</a>. You can also use a JSON config file, which you can learn about <a href="https://github.com/ArkEcosystem/ark-deployer#json-config">here</a>. Any changes to fees or the epoch time of the network currently prevent the Desktop Wallet from working with your chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KTg0C2VzbMzEVfI2aHLTQ.png" /></figure><p>Once installed you will see output similar to this. Passphrase is the genesis passphrase which contains all pre-mined tokens. You will need this in order to distribute tokens to other wallets.</p><h4>Start the Bridgechain</h4><pre>./bridgechain.sh start-node --name MyTest</pre><p><strong><em>Note: --name is important as it relates to the config files for your chain</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EUQTUZOgt5MkDbTLb_l8Uw.png" /><figcaption>Bridgechain started and auto-forging begins.</figcaption></figure><h3>Setting up your Bridgechain Explorer</h3><p>The explorer is used to view information on your bridgechain. It provides details about the delegates that are active and on standby. It also provides information about all the addresses, transactions and blocks that are available. In summary, everything you need to know about your bridgechain can be found in the explorer.</p><h4>Install Explorer (Not Azure)</h4><pre>./bridgechain.sh install-explorer --name MyTest --token MYTEST --node-ip 51.141.3.209 --explorer-ip 51.141.3.209 --skip-deps</pre><p><strong><em>Note: this is a one line command so copy / paste whole part.</em></strong></p><h4>Install Explorer (Azure)</h4><p>You will need to choose your Private IP for the explorer. You can run ipconfig to find it.</p><pre>./bridgechain.sh install-explorer --name MyTest --token MYTEST --node-ip 51.141.3.209 --explorer-ip 10.0.0.4 --skip-deps</pre><p><strong><em>Note: this is a one line command so copy / paste whole part.</em></strong></p><h4>Start Explorer (in the background)</h4><pre>./bridgechain.sh start-explorer</pre><h4>Start Explorer (in the foreground)</h4><pre>cd ~/ark-explorer &amp;&amp; npm run bridgechain</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UWgLw51OoE3ut7kYss9mA.png" /><figcaption>Explorer running in the foreground.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ud5yeXDYu8GyCfBN." /></figure><p>Once the explorer is running, you can give it a test by navigating to it through your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SPpFWWMHIDDRAziK." /><figcaption>Delegate monitor for your bridgechain.</figcaption></figure><h3>Adding the Bridgechain to your Desktop Wallet</h3><p>Having a bridgechain is great, but you may want to interact with it and send out some of your genesis tokens. This will be required when forging with new delegate nodes (instead of auto-forging).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*b63E8-kdIVwfykW57L95Ew.png" /></figure><p>From your desktop wallet, go to Settings (the gear icon at the top-right) and choose “Manage Networks”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C4DFAUI9sNY1Ez0sT_mw8Q.png" /></figure><p>Go to the “New” tab, give your network a name, input the URL of your bridgechain node (including “http://” and leaving the “/” off the end), and then enable “Force”. The Force option means the desktop wallet will always connect to this peer when dealing with the Network, and won’t deal with any Peers. Once done, click on the “Create” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qNM91WwCUzzTT_LeW9z6Aw.png" /></figure><p>You are then presented with all the details for your Network. Click on the “Save” button here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*JlzNIwGnz0dM8WU1Nx0EnQ.png" /></figure><p>From the Networks (Wi-Fi Icon at the top-right), change to your newly created Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfrKbojYCvuOb4raJdDlXw.png" /></figure><p>Now import your genesis passhprase which you was given when installing your node and click “Import”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tF841VF5zdfBlyN6IjZArQ.png" /></figure><p>You will notice your wallet now has the pre-mined tokens already there and available. You can send those tokens to a new wallet straight away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bJ0DkDQiN4xUV0mXIfLww.png" /></figure><p>Generate a new wallet, and send some tokens from your genesis wallet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_C7YMVPzsDRu3fzLFYvZRA.png" /></figure><p>You will notice the genesis wallet is no longer a cold wallet (a cold wallet has no public key), and our transaction sent correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVyigv-4qq7GE40d9L7SlQ.png" /><figcaption>And we received it in our second wallet 👌</figcaption></figure><h3>Adding a Forging Delegate to the Network</h3><p>Using the desktop wallet and our new address that we just set up, we will register as a delegate and set up a new node so we are forging external to our seed node. This section requires some command-line experience.</p><h4>Register as a Delegate</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9rEsLZGEWWi05PfWRjCVA.png" /></figure><p>In the wallet you want to register as a delegate, click on the Menu Icon (3 vertical dots at the top-right).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ebMic4YdjKjgMw0pagLuw.png" /></figure><p>Then choose the “Register Delegate” option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FMw__XrPcXpNc2EWJhQMQ.png" /></figure><p>Enter your desired delegate name, and input your passphrase. You can then submit that transaction to the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uEMWHCgx83FMJOWW9rLcaw.png" /></figure><p>Reload your desktop wallet and you will see your wallet is now a delegate.</p><h4>Voting for your new Delegate</h4><p>Because we’re in an auto-forging state, we don’t need to vote for ourselves. That being said, it’s worth doing anyway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*wh4ACJceimL_P1zdrcIDdQ.png" /></figure><p>In the new Delegate Wallet, go to the Votes tab and click on the “Vote” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9jFkTn8GmCbC_8xKEOgYw.png" /></figure><p>Find yourself in the delegate list and enter your passphrase. You can then press “Next” and send the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nAZNKQUCBTByxll0eQHhbg.png" /></figure><p>You will then see information about yourself in the Votes tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2dxET2d97Ivvq0iE6O_O-g.png" /></figure><p>You will also see your Delegate showing in the Explorer Delegate Monitor.</p><h4>Setup a New Forging Node</h4><p>You will need a new machine ready for us to setup. To make it easier, we will use ARKCommander to setup all dependencies then overwrite with our bridgechain configuration.</p><p><strong>Download and run ARKCommander</strong></p><pre>wget <a href="http://ark.io/ARKcommander.sh">http://ark.io/ARKcommander.sh</a> &amp;&amp; bash ARKcommander.sh</pre><p><strong>Enter your user password to gain root privileges if/when asked.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*NCEYOjqn06qKC1iqDB9F7w.png" /></figure><p>Your system will then update ready for a node. This can take a while but if you find there’s no response, you can restart this process and try again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*jEMJcOV9AN-0mY5T9RtHWQ.png" /></figure><p>Once finished, reboot your machine with sudo reboot</p><p><strong>SSH back into your delegate machine and run ARKcommander</strong></p><pre>bash ARKcommander.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*Uro4lbPqzlmI8z3AWG9w3A.png" /></figure><p>Once started, press “1” and Enter to install Ark Node. This ensures we have all the dependencies we need for the node installed. Once finished, input “Y” to setup logrotate and press Enter to continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*Us_h-MBje9q2dH57kbx7yg.png" /></figure><p>Input an empty secret if asked, and “Y” then Enter to apply config. Press Enter again to go back to the main menu. Then input “0” and press Enter a final time to Exit the ARKCommander.</p><p>There will now be the MainNet Node setup in ~/ark-node.</p><p><strong>Remove the current ark-node</strong></p><pre>rm -rf ~/ark-node/</pre><p><strong>Copy Node files over SSH (this can take a while)</strong></p><pre>scp -r bridgechain@51.141.3.209:~/ark-bridgechain ~/ark-node</pre><p><strong><em>Note: You will have to change the username and IP to the auto-forging node you’re copying from. You will also have to change the path you’re copying from if you chose to install the bridgechain somewhere different.</em></strong></p><p><strong>Navigate to the Node folder</strong></p><pre>cd ~/ark-node</pre><p><strong>Update the config file in an editor of your choice</strong></p><pre>vi ~/ark-node/config.MyTest.json</pre><ul><li>Change port to <strong>4101</strong></li><li>Change db.database to <strong>ark_bridgechain</strong></li><li>Check the peers.list already has the IP for your Seed node (see below image)</li><li>Change forging.secret to [&quot;YOUR PASSPHRASE&quot;]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*84hnNrWbLUjXZ44PWpl6jA.png" /><figcaption>List of Peers for Delegate Node (only using Seed Node).</figcaption></figure><p><strong>Remove packaged files (which were installed on seed node)</strong></p><pre>rm -rf package-lock.json node_modules/</pre><p><strong>Re-install local dependencies for the Node</strong></p><pre>npm install libpq<br>npm install secp256k1<br>npm install bindings<br>npm install</pre><p><strong>Create Postgres Database for our Bridgechain to use</strong></p><pre>createdb ark_bridgechain</pre><p><strong>Run the Node (in the Background)</strong></p><pre>forever start app.js --genesis genesisBlock.MyTest.json --config config.MyTest.json</pre><p><strong>Run the Node (in the foreground)</strong></p><pre>node app.js --genesis genesisBlock.MyTest.json --config config.MyTest.json</pre><p><strong><em>Note: This is a 1 line command so copy / paste the whole section.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xW8zNYk-QGAQahs1Q3Ctjg.png" /><figcaption>You will begin to start the sync between nodes.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FsVDG1LhFB-qv9_bGrk7dg.png" /><figcaption>The delegate node has now started forging blocks.</figcaption></figure><p><strong>Peers API show the auto-forging machine and the Delegate Node</strong></p><p>You can access this by going to the /api/peers endpoint. E.g. <a href="http://51.141.3.209:4100/api/peers">http://51.141.3.209:4100/api/peers</a> (seed node) or <a href="http://51.143.157.13:4101/api/peers">http://51.143.157.13:4101/api/peers</a> (delegate node)</p><pre>{<br>  &quot;success&quot;: true,<br>  &quot;peers&quot;: [<br>    {<br>      &quot;ip&quot;: &quot;51.143.157.13&quot;,<br>      &quot;port&quot;: 4101,<br>      &quot;version&quot;: &quot;0.0.1&quot;,<br>      &quot;errors&quot;: 0,<br>      &quot;os&quot;: &quot;linux4.13.0-1009-azure&quot;,<br>      &quot;height&quot;: 2676,<br>      &quot;status&quot;: &quot;OK&quot;,<br>      &quot;delay&quot;: 5<br>    },<br>    {<br>      &quot;ip&quot;: &quot;51.141.3.209&quot;,<br>      &quot;port&quot;: 4100,<br>      &quot;version&quot;: &quot;0.0.1&quot;,<br>      &quot;errors&quot;: 0,<br>      &quot;os&quot;: &quot;linux4.13.0-1007-azure&quot;,<br>      &quot;height&quot;: 2676,<br>      &quot;status&quot;: &quot;OK&quot;,<br>      &quot;delay&quot;: 14<br>    }<br>  ]<br>}</pre><h4><strong>Summary</strong></h4><p>To conclude, we have just set up our first forging delegate node. This means we can start adding more nodes to the network, and gradually move away from the auto-forging setup that we have. Due to the performance of the machines we used in this case, it is very possible for the delegate node to stop syncing, or to struggle to keep up-to-date. In reality, the network needs a lot of relay nodes to ensure other nodes can continue to receive blocks.</p><h4>Your Next Steps</h4><ol><li>Move all pre-mined tokens into a new wallet of which only you know the passphrase for (or use a Ledger hardware wallet inside the Desktop Wallet).</li><li>Commit the new config and genesis files, and put them in a forked GitHub Repository. You can omit the new files in the ~/ark-bridgechain/tasks folder.</li><li>Add more relay nodes to the network just as we just have (skipping the delegate step).</li><li>Consolidate all relay node IP &amp; ports and add them to the ~/ark-bridgechain/config.MyTest.json file (making sure to commit and update on all nodes). This means the network will start to grow and will build over time, meaning they will stay synced up.</li><li>Move all delegate forging nodes to their own machines.</li></ol><h3>JSON Config File</h3><p>You can also use a JSON config file to setup both the node and the explorer. You can see more information regarding this <a href="https://github.com/ArkEcosystem/ark-deployer#json-config">here</a>.</p><h3>Easy Vagrant Setup</h3><p>We have also provided a Vagrantfile which allows you to deploy your own Bridgechain and Explorer together with no configuration necessary.</p><p><strong><em>Note: This requires Vagrant version 2+ to be installed from </em></strong><a href="https://www.vagrantup.com/downloads.html"><strong><em>here</em></strong></a><strong><em>.</em></strong></p><h4>Download ARK Deployer</h4><pre>cd ~ &amp;&amp; git clone <a href="https://github.com/ArkEcosystem/ark-deployer.git">https://github.com/ArkEcosystem/ark-deployer.git</a> &amp;&amp; cd ark-deployer</pre><p><strong><em>Note: This is a 1 line command so copy / paste the whole section.</em></strong></p><h4>Initiating a Vagrant Machine</h4><pre>vagrant up</pre><h4>Destroying a Vagrant Machine</h4><pre>vagrant destroy</pre><h4>Tweaking Bridgechain Options (Advanced)</h4><p>Open up ~/ark-deployer/vagrant/config.json and you will see all the possible options that you can change. These are all used when deploying the bridgechain on Vagrant and can be customised. Refer to the <a href="https://github.com/ArkEcosystem/ark-deployer#optional-parameters">node options</a> and <a href="https://github.com/ArkEcosystem/ark-deployer#optional-parameters-1">explorer options</a> before continuing to get an idea of what each do. Once you are happy with your settings, go ahead and start the Vagrant environment as above.</p><h3>Ark’s Next Steps</h3><p>We will be updating deployer to work with Ark Core v2 once it is in the testing phase. Aside from other improvements to ark-deployer (which will also be updated in this guide if needs be), we will also be building a Push Button deployment interface which will give a friendly user experience, and do all the things discussed in this guide for you, just at the click of a few buttons.</p><h3>FAQ</h3><ol><li><strong>Why do I need to “Force” my Network in the Desktop Wallet?</strong><br>When your bridgechain node is auto-forging, it uses loopback addresses (127.0.0.x) to connect to itself and act as a forging node. If the Force option isn’t enabled, the Desktop Wallet will try to connect to the loopback addresses as they show as peers when querying the /api/peers endpoint. Forcing a connection means you connect directly with your bridgechain seed node, instead of having to launch a range of relay nodes to serve as peers.</li><li><strong>I lost my Genesis Passphrase. Where can I find it?</strong><br>Take a look in ~/ark-bridgechain/tasks/demo/genesisPassphrase.MyTest.json. You will find it in there (unless you removed it).</li><li><strong>Will Deployer work on XYZ Operating System?</strong><br>We recommend only running the Ark Node on Ubuntu 16.04. It may be possible on other Operating systems, but it is more specifically tested/used on this Operating System.</li><li><strong>Can I change the fees for my bridgechain?</strong><br>Yes you can which can be found under <a href="https://github.com/ArkEcosystem/ark-deployer#optional-parameters">node options</a>, however this causes issues with the Desktop Wallet (and anything that uses the ark-js package).</li><li><strong>What is a Seed Node?</strong><br>A Seed Node is used as a master node. Something that is used as a basis for Nodes to connect with, to then become “attached” to the Network.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c10825ebb0e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ark-io/ark-deployer-setup-guide-c10825ebb0e4">Ark Deployer — Setup Guide</a> was originally published in <a href="https://medium.com/ark-io">ARK.io | Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>