<?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 Raymond Mogg on Medium]]></title>
        <description><![CDATA[Stories by Raymond Mogg on Medium]]></description>
        <link>https://medium.com/@raymogg?source=rss-186ea6952d2d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sR84bp4DtG4grSztQUjFpw.png</url>
            <title>Stories by Raymond Mogg on Medium</title>
            <link>https://medium.com/@raymogg?source=rss-186ea6952d2d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 23:33:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raymogg/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[A Guide to Using the Tracer Perpetual Pools SDK]]></title>
            <link>https://medium.com/@raymogg/the-guide-to-using-tracers-perpetual-pools-sdk-ad90142386be?source=rss-186ea6952d2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad90142386be</guid>
            <dc:creator><![CDATA[Raymond Mogg]]></dc:creator>
            <pubDate>Tue, 14 Dec 2021 03:31:57 GMT</pubDate>
            <atom:updated>2021-12-14T04:46:27.838Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*niHRBKpOD0lw3ACS" /></figure><p>The recent release of the <a href="https://github.com/tracer-protocol/pools-js">Tracer Perpetual Pools SDK</a> means that traders and market makers can now build on top of the protocol without wasting time finding contract addresses, locating ABIs, or figuring out how to run certain calculations on data from the contracts.</p><p>This Software Development Kit (SDK) provides a lot of nice helper functions that not only allow you to read complex pieces of data from the contracts, but also allow you to programmatically mint and burn Tracer’s leveraged tokens on-chain.</p><p>Currently, the Perpetual Pool’s SDK is built in TypeScript and only supports use from within TS/JS projects. If you are a developer interested in helping to build-out a Python SDK, check out Tracer’s current project listing <a href="https://tracerdao.notion.site/5aff3e5d696e4839bfab0e75848f8fec?v=dbe772a9bf3e405db1b267a78ba77d16">here</a>.</p><h3>The Application</h3><p>We’ll use the SDK to build a simple NodeJS script that tells us the expected state of each pool after the next rebalance.</p><p>You might use this data to setup an arbitrage or ‘skew-farming’ bot, or in a more advanced way as part of a larger application for the automated management of Tracer positions.</p><p>To view the final project, check out <a href="https://github.com/raymogg/tracer-sdk-example">https://github.com/raymogg/tracer-sdk-example</a>.</p><h3>Pre Requisites</h3><p>Before we begin, it’s assumed you have the following installed:</p><p>NodeJS — <a href="https://nodejs.org/en/download/">https://nodejs.org/en/download/</a></p><p>NPM (default with NodeJS) or Yarn — <a href="https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable">https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable</a></p><h3>Project Setup</h3><p>First let’s set up our base node project. Navigate to an empty directory and run npm init</p><p>Now, let’s install some base dependencies. First we need the Perpetual Pools JS SDK:</p><p>yarn add @tracer-protocol/pools-js or npm install @tracer-protocol/pools-js</p><p>We also need to install ethers as this allows us to interact with the Ethereum blockchain itself</p><p>yarn add ethers or npm install ethers</p><p>We now have everything we need to begin reading the next state of the perpetual pools.</p><p>Finally, create an index.js file in the root of your project. This will serve as our main entry point.</p><h3>Reading in State</h3><p>The first thing we need to do before we can start reading in state is import everything we need.</p><pre>import { Pool, poolList } from &#39;<a href="http://twitter.com/tracer">@tracer</a>-protocol/pools-js&#39;;<br>import ethers from &#39;ethers&#39;;<br>const provider = new ethers.providers.JsonRpcProvider(&quot;<a href="https://arb1.arbitrum.io/rpc">https://arb1.arbitrum.io/rpc</a>&quot;);</pre><p>The first import allows us to access many helper functions that the SDK provides for interacting with pools. EthersJS and the provider that is setup in line 3 allow us to connect to the blockchain itself. This provider will be consumed by the SDK later on to allow easy read and write access to the deployed contracts</p><p>To start off, we want to begin by selecting what pools we want to target. This can be done by looking at the poolList object that we imported at the start. The poolList is a mapping from network ID to available pools on that network. Since we want to interact with Arbitrum mainnet (which has network ID 42161), lets have a look at Logging the poolList[&quot;42161&quot;]</p><p>You’ll notice this gives us an array of objects which contain the contract address for each pool, as well as some helpful info about the pool itself. To start using the actual Pool helper class, we need to instantiate an object using each pool address.</p><pre>[<br>  {<br>    name: &#39;1-BTC/USDC&#39;,<br>    address: &#39;0x146808f54DB24Be2902CA9f595AD8f27f56B2E76&#39;,<br>    leverage: 1,<br>    updateInterval: 3600,<br>    frontRunningInterval: 300,<br>    keeper: &#39;0x759E817F0C40B11C775d1071d466B5ff5c6ce28e&#39;,<br>    committer: { address: &#39;0x539Bf88D729B65F8eC25896cFc7a5f44bbf1816b&#39; },<br>    longToken: {<br>      name: &#39;1-LONG-BTC/USD&#39;,<br>      address: &#39;0x1616bF7bbd60E57f961E83A602B6b9Abb6E6CAFc&#39;,<br>      symbol: &#39;1L-BTC/USD&#39;,<br>      decimals: 6<br>    },<br>    shortToken: {<br>      name: &#39;1-SHORT-BTC/USD&#39;,<br>      address: &#39;0x052814194f459aF30EdB6a506eABFc85a4D99501&#39;,<br>      symbol: &#39;1S-BTC/USD&#39;,<br>      decimals: 6<br>    },<br>    quoteToken: {<br>      name: &#39;USDC&#39;,<br>      symbol: &#39;USDC&#39;,<br>      decimals: 6,<br>      address: &#39;0xff970a61a04b1ca14834a43f5de4533ebddb5cc8&#39;<br>    }<br>  },<br> ...<br>]</pre><p>First, let’s turn our array of Pools data into simply an array of all their addresses. We will then covert each address into the actual Pool object, which will allow us to easily read the current state from the chain.</p><pre>// get the address for each pool from the data lookup<br>let addresses = poolList[&quot;42161&quot;].map((pool) =&gt; {<br>    return pool.address;<br>});</pre><pre>// create a pool object for each pool<br>let promises = addresses.map((address) =&gt; {<br>    return Pool.Create({<br>        address: address,<br>        provider,<br>    });<br>});</pre><pre>// wait for all pools to be setup<br>const pools = await Promise.all(promises);</pre><p>In order for the above async code to run within NodeJS, we will need to wrap this all inside an async function.</p><pre>// make everything async<br>(async () =&gt; {<br>    // get the address for each pool from the data lookup<br>    let addresses = poolList[&quot;42161&quot;].map((pool) =&gt; {<br>        return pool.address;<br>    });</pre><pre>    // create a pool object for each pool<br>    let promises = addresses.map((address) =&gt; {<br>        return Pool.Create({<br>            address: address,<br>            provider,<br>        });<br>    });</pre><pre>    // wait for all pools to be setup<br>    const pools = await Promise.all(promises);<br>})();</pre><p>We now have all the setup code ready to start reading in some data. If you check out the <a href="https://github.com/tracer-protocol/pools-js/blob/master/src/entities/pool.ts">pools-js codebase</a>, you will see each Poolobject gives us access to some interesting helper functions. The one of particular interest to us is <a href="https://github.com/tracer-protocol/pools-js/blob/53bd4858d653a8030e578735d7bfc4fcc367c60f/src/entities/pool.ts#L279">the </a><a href="https://github.com/tracer-protocol/pools-js/blob/53bd4858d653a8030e578735d7bfc4fcc367c60f/src/entities/pool.ts#L279">getNextPoolState function</a>. This function will return a lot of data about the new state of the pool if an update was to occur right now at the current oracle price.</p><p>Let’s pull in the long balance, short balance and expected skew for each pool, then log that info.</p><pre>pools.forEach((pool) =&gt; {<br>    let nextState = pool.getNextPoolState()<br>    // log the pool name and state<br>    console.log(pool.name)<br>    console.log(`Long Balance: ${nextState.expectedLongBalance}`)<br>    console.log(`Short Balance: ${nextState.expectedShortBalance}`)<br>    console.log(`Skew: ${nextState.expectedSkew}\n`)<br>  })</pre><p>We now are able to programmatically view the state of all perpetual pools deployed. Putting it all together, we have:</p><pre>const { Pool, poolList } = require(&quot;<a href="http://twitter.com/tracer">@tracer</a>-protocol/pools-js&quot;);<br>const ethers = require(&quot;ethers&quot;);<br>const provider = new ethers.providers.JsonRpcProvider(<br>    &quot;<a href="https://arb1.arbitrum.io/rpc">https://arb1.arbitrum.io/rpc</a>&quot;<br>);</pre><pre>(async () =&gt; {<br>    // get the address for each pool from the data lookup<br>    let addresses = poolList[&quot;42161&quot;].map((pool) =&gt; {<br>        return pool.address;<br>    });</pre><pre>    // create a pool object for each pool using the pools-js SDK<br>    let promises = addresses.map((address) =&gt; {<br>        return Pool.Create({<br>            address: address,<br>            provider,<br>        });<br>    });</pre><pre>    // wait for all pools to be initialised<br>    const pools = await Promise.all(promises);</pre><pre>    // get info about each pool if it were to be updated at the    current price<br>    pools.forEach((pool) =&gt; {<br>        let nextState = pool.getNextPoolState()<br>        // log the pool name and state<br>        console.log(pool.name)<br>        console.log(`Long Balance: ${nextState.expectedLongBalance}`)<br>        console.log(`Short Balance: ${nextState.expectedShortBalance}`)<br>        console.log(`Skew: ${nextState.expectedSkew}\n`)<br>    })<br>})();</pre><p>To run this all together, simply use node index.js. Your output should look similar to below:</p><pre>1-BTC/USD<br>Long Balance: 6322460.19829002276021155341103478<br>Short Balance: 6612880.89144497723978844658896522<br>Skew: 0.95608257612341558421<br>...</pre><p>We now have a basic NodeJS script that can read the state of the pools. This is simply the beginning of what you can do with the pools-js package.</p><p>For the full code produced in this tutorial, <a href="https://github.com/raymogg/tracer-sdk-example">check out the repo</a>.</p><p>I hope you found this guide useful. If you have any questions, or would like to contribute to Tracer DAO, <a href="https://discord.com/invite/tracerdao">find us in the Discord</a>. Join the #shooters squadron to hang out with Tracer’s smart contract developers building the derivative infrastructure of the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad90142386be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chainlink External Initiators]]></title>
            <link>https://medium.com/@raymogg/chainlink-external-initiators-e8c49ff885b3?source=rss-186ea6952d2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8c49ff885b3</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[external-initiator]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[chain-link]]></category>
            <dc:creator><![CDATA[Raymond Mogg]]></dc:creator>
            <pubDate>Mon, 16 Mar 2020 01:38:06 GMT</pubDate>
            <atom:updated>2020-03-16T01:55:05.991Z</atom:updated>
            <content:encoded><![CDATA[<p>For the <a href="https://blog.chain.link/showcasing-the-winning-projects-from-the-ethdenver-2020-hackathon/">ETHDenver hackathon</a> this year, the SDL team utilised an external initiator to interact with their solidity contracts. This successful implementation granted the team first place in the Chainlink bounties for the hackathon event. So what are External Initiators, how do they work and how can they be setup?</p><p><em>Note</em>: external initiators are currently an experimental Chainlink feature. For node operators to use them, an environmental variable must be added to their node configuration:</p><pre>FEATURE_EXTERNAL_INITIATORS=true</pre><h3>What are external initiators?</h3><p>External initiators are a way for an external event to trigger a job run on a Chainlink node. One such example which was used by SDL in the ETHDenver hackathon, was having an IoT sensor trigger a run on the chainlink node when certain conditions (such as the temperature dropping below X degrees) were met. As one can imagine, this kind of ‘IF X, THEN Y’ functionality opens up endless opportunities for dynamic smart contract applications that bridge the gap between real-world data and on-chain events.</p><h3>How do they work?</h3><p>There are a few components involved in creating an external initiator. At a high level, the overall architecture can be visualised as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCuCDfFf-yiNunI8y_Wtxg.jpeg" /></figure><p>The steps involved for a job run to trigger is as follows:</p><ol><li>Remote initiator polls / subscribes to a real world trigger (whether this be sensors, an external API, etc)</li><li>Based on some arbitrary logic (for example checking whether the sensor data polled has dropped below some threshold point), the remote initiator decides if the job run should be triggered or not.</li><li>The remote initiator notifies the Chainlink Node to run the job.</li><li><em>Optional</em>: The Chainlink Node may request some data from the remote initiator as part of the job run, or supply it as part of the initiation request payload.</li></ol><p>All requests between the Chainlink Node and remote initiator require an access key and secret key which is setup by the node operator as part of the setup process.</p><h3>Creating your own external initiator</h3><h4>Setting it up on the Node</h4><p>Run:</p><pre>chainlink initiators create &lt;name&gt; &lt;url (optional)&gt;</pre><p>This will create an external initiator on the node itself. URL is the URL where the task spec will be posted to from the node. This is necessary so that the remote initiator knows the Job ID to initiate and the criteria (defined in the task spec params) that has been defined to initiate the job.</p><p>For example if you are going to run a local initiator service for testing purposes this could be localhost:3002/jobs. Take note of the values shown here (such as the X-Chainlink-EA-AccessKey and X-Chainlink-EA-Secret) as these will be needed later.</p><h4>The remote initiator service</h4><p>The next component to consider when building out the external initiator is the remote initiator service. SDL have created a sample NodeJS server template <a href="https://github.com/securedatalinks/example-external-initiator-service">here</a>, and there is also a very good template service provided by the Fiews team <a href="https://github.com/boxhock/min-external-initiator">here</a>. The functionality that must be implemented includes:</p><ul><li>Listen for jobs to be created on the Chainlink node using this external initiator on the URL endpoint defined previously as part of the initiator setup. For our example we will run our initiator service on port 3002 and use the /jobs endpoint to an external event to trigger a job run on a Chainlink node. When this endpoint is called by the Chainlink Node, it will pass in the job ID (as part of the request body) that is utilizing this remote initiator. You can then store this job ID and know that it must be called when the time to trigger jobs comes. Your remote initiator can support many jobs id’s.</li><li>Poll, subscribe to or create an endpoint for some other service. Your remote initiator service should be listening to some event or have an endpoint that can be called by another service with some parameters, and when some set conditions are met, it should notify the chainlink node that it is time to run the job. To trigger the job run, a POST request must be sent to the endpoint on the node /v2/specs/JOB_ID/runs. Where JOB_ID is replaced by the job you want to trigger. As part of this request you must also pass in the X-Chainlink-EA-AccessKey and X-Chainlink-EA-Secret setup as part of the creation of the external initiator on the node itself. This means that in order to support multiple nodes, you need a secret, a key and at least one job id for every node that is using this service. These keys prevent other parties attempting to call the node and run a job should they know the job id the external initiator service is attempting to use.</li><li><em>Optional</em>: Create an endpoint that is run as part of the job run. For our use case, we not only wanted the remote initiator service to tell the node when to run, but also during the run we wanted the node to pull some data from the service (the actual temperature recorded that caused the job to trigger). For this you can simply define another endpoint that will be called as part of the job run from the node.</li></ul><h3>Decentralisation</h3><p>One issue with this current external initiator example as described above is the centralisation. In the example provided only a single node is considered, and it is connecting to a single instance of the external initiator service.</p><p>In the future, this needs to be extrapolated out to have multiple nodes running the remote initiator service. Our described remote initiator service already supports this more decentralised infrastructure. An example of this architecture utilising a more decentralised setup would be as follows (using a sensor trigger as an example):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3vnTPPdvGOaSVJn9V4yZoA.jpeg" /></figure><p>In this setup, each node would be running its own version of the external initiator service, having its own access key and secret to communicate between the service and the node. The external initiator service would ideally be pointing to multiple tamper proof IoT sensors owned by multiple stakeholders.</p><p>In order to be able to support this multiple node strategy, some in contract aggregation of responses may be required.</p><p>To keep up to date with Secure Data Links, follow our <a href="https://twitter.com/SecureDataLinks">Twitter</a> and checkout our <a href="https://www.securedatalinks.com/">website</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8c49ff885b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Chainlink Nodes on Kubernetes and the Google Cloud Platform]]></title>
            <link>https://medium.com/@raymogg/running-chainlink-nodes-on-kubernetes-and-the-google-cloud-platform-1fab922b3a1a?source=rss-186ea6952d2d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fab922b3a1a</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[google-cloud]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[chain-link]]></category>
            <category><![CDATA[secure-data-links]]></category>
            <dc:creator><![CDATA[Raymond Mogg]]></dc:creator>
            <pubDate>Fri, 18 Oct 2019 08:04:04 GMT</pubDate>
            <atom:updated>2019-10-20T23:21:22.048Z</atom:updated>
            <content:encoded><![CDATA[<p>In order to ensure our nodes have optimal uptime, the team at <a href="http://securedatalinks.com/">Secure Data Links</a> is currently utilising Kubernetes alongside Google Cloud Platform (GCP) to run our Chainlink oracle. In this article we’ll be walking you through the process of setting up infrastructure that mimics our own, allowing you to run your nodes with consistent uptime on GCP.</p><p>In this tutorial we use Kubernetes to setup two Chainlink nodes which connect to an external database all within GCP. Running the nodes with Kubernetes allows them to automatically restart should they crash, and since both the database and nodes are run internally on Google Cloud, all traffic is conveniently routed internally between them and never exposed to public networks.</p><h3>Pre Reqs</h3><p>We aim to make this tutorial as friendly as possible to all, with minimum pre-requisite knowledge required. However some knowledge of the unix command line is assumed.</p><p>We recommend running a Chainlink node locally following the official Chainlink guide (<a href="https://docs.chain.link/docs/running-a-chainlink-node">https://docs.chain.link/docs/running-a-chainlink-node</a>) just to get a feel for the process, however this isn’t completely necessary.</p><p>You will however need to install the following dependencies on whatever machine you are using</p><ul><li>Kubectl command line tool (<a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">https://kubernetes.io/docs/tasks/tools/install-kubectl/</a>)</li><li>Google cloud command line tool (<a href="https://cloud.google.com/sdk/docs/#install_the_latest_cloud_tools_version_cloudsdk_current_version">https://cloud.google.com/sdk/docs/#install_the_latest_cloud_tools_version_cloudsdk_current_version</a>)</li><li>A Google cloud account (you can sign up for one free and get $300 worth of free credit at <a href="https://cloud.google.com)/">https://cloud.google.com)</a></li><li>A Copy of our Chainlink Kubernetes deployment (<a href="https://github.com/securedatalinks/ChainlinkKubernetes">https://github.com/securedatalinks/ChainlinkKubernetes</a>)</li></ul><p>I would also recommend creating a new directory to work in, and pull the files from our ChainlinkKubernetes Github into this directory.</p><h3>Part 1 — Creating the Kubernetes Cluster and Postgres DB</h3><p>The first part of the process is to create a new Kubernetes cluster in GCP. To do this simply navigate to the Kubernetes Engine tab and hit create cluster. Then set up a standard cluster with 2vCPU’s and a single node, which should look as follows. Feel free to place the cluster in any region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rgQLHcUtFOAIzX2sRolesw.png" /><figcaption>Cluster Template</figcaption></figure><p>While your cluster is starting up, we can create a Postgres DB. Head to the SQL tab under storage, hit create instance and select Postgresql. Give the instance a name and a password (make sure you write down the password as you will need it later). Place the database in the same region as your Kubernetes cluster.</p><p>Congratulations, you now have a Kubernetes cluster and Postgres database running on GCP. Time to configure the database.</p><h3>Part 2 — Database Configuration</h3><p>Once your database is setup, you will be able to access it via the SQL tab. Once you click on your newly setup database, you should be presented with a screen similar to the one below. The first thing we are going to do is create a new table for our nodes data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzKpxlj9x0juUUh-NY2Nzg.png" /><figcaption>Database Dashboard</figcaption></figure><p>Head to the databases tab, hit create database and name your new database “chainlink”. This will hold all the data your node needs to operate.</p><p>Next we are going to configure a private IP. The private IP allows your Chainlink nodes to communicate with the database privately on the internal GCP network. This means you are not required to set up any firewall rules for our database.</p><p>Simply head to the connections tab, and change connectivity from public IP to private IP.</p><p>Once complete, you should be able to navigate back to the database’s homepage and see a private IP listed. From this we can now construct our database URL (that we will need later to configure our node). The database URL for our postgres database is as follows, where PASSWORD is replaced by the password you used to create the database in step 1, and IP is the private IP listed in the database dashboard.</p><pre>postgresql://postgres:PASSWORD@IP:5432/chainlink</pre><h3>Part 3 — Creating the Nodes</h3><p>We are now ready to start creating our Chainlink nodes through Kubernetes. The first step in this process is to configure kubectl to connect to your GCP Kubernetes cluster. Navigate to the Kubernetes Engine tab and select connect. You should now be able to copy the gcloud container command listed under “command line access” as seen below. By running this in any unix terminal, kubectl will be configured to access your GCP cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UdOnTJJej06xVlNT8PNCdg.png" /><figcaption>Connecting to the cluster</figcaption></figure><p>The next steps are setting up some variables needed by your Chainlink node. The first of these are the api file and the password file. These files are needed to allow the Chainlink node to startup with a given api user name, password, and node password. To setup these files, run the following commands and provide your own email, and passwords. Ensure your passwords are strong.</p><pre>echo &quot;user@example.com&quot; &gt; .api</pre><pre>echo &quot;password&quot; &gt; .api</pre><pre>echo &quot;my_wallet_password&quot; &gt; .password</pre><p>You should now have a directory that looks similar to this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0F4Bq1OCupqj1StQVlF9A.png" /><figcaption>Directory Setup</figcaption></figure><p>Now you need to turn these files into secrets to be used by Kubernetes. This is made very simple with the kubectl command line, simply run:</p><pre>kubectl create secret generic api-env --from-file=.api</pre><pre>kubectl create secret generic password-env --from-file=.password</pre><p>This will create two new secrets within Kubernetes that can be used by your cluster later on. Next up you need to create a configMap to hold your environment variables for the Chainlink node. In both of the below examples, ensure you replace the DATABASE_URL with your database URL that we constructed above, and replace the ETH_URL with the URL of your Ethereum web-sockets endpoint.</p><p><strong>Ropsten Example</strong></p><pre>kubectl create configmap node-env --from-literal ROOT=/chainlink --from-literal LOG_LEVEL=debug --from-literal ETH_CHAIN_ID=3 --from-literal MIN_OUTGOING_CONFIRMATIONS=2 --from-literal LINK_CONTRACT_ADDRESS=0x20fe562d797a42dcb3399062ae9546cd06f63280 --from-literal CHAINLINK_TLS_PORT=0 --from-literal SECURE_COOKIES=false --from-literal ALLOW_ORIGINS=* --from-literal ETH_URL=&lt;INSERT-ETH-WSS&gt; --from-literal DATABASE_URL=&lt;INSERT-DATBASE-URL&gt; --from-literal DATABASE_TIMEOUT=0</pre><p><strong>Mainnet Example</strong></p><pre>kubectl create configmap node-env --from-literal ROOT=/chainlink --from-literal LOG_LEVEL=debug --from-literal ETH_CHAIN_ID=1 --from-literal CHAINLINK_TLS_PORT=0 --from-literal SECURE_COOKIES=false --from-literal ALLOW_ORIGINS=* --from-literal ETH_URL=&lt;INSERT-ETH-WSS&gt; --from-literal DATABASE_URL=&lt;INSERT-DATBASE-URL&gt; --from-literal DATABASE_TIMEOUT=0</pre><p>Running the following should now list one configMap named node-env</p><pre>kubectl get configMaps</pre><p>While the following command should show two secrets called api-env and password-env</p><pre>kubectl get secrets</pre><p>We are now ready to launch our deployment. Simply run</p><pre>kubectl apply -f deploy.yaml</pre><p>and Kubernetes will start up our two Chainlink nodes. You should now be able to run the following command and get a similar output to below. If so, you now successfully have two Chainlink nodes up and running with the help of Kubernetes.</p><pre>kubectl get all </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zs66rDBMGM164F9yCMgB5Q.png" /></figure><p>To check that the nodes are operating as they should be, you may run</p><pre>kubectl logs &lt;NAME&gt;</pre><p>where name is replaced by the name of either of your deployed pods. One pod should output a locking message as this is our redundant node, while the other node should output some basic setup lines and then the block headers it is currently receiving (similar to below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3QfKzxZ2t9Xh4HQy5GeKkg.png" /><figcaption>Sample log output</figcaption></figure><h3>Part 4 — Operator GUI Access</h3><p>Now that you have two nodes running, you need some way of accessing the operator GUI so you can add jobs to our nodes. There are two main ways of doing this. You can either use port forwarding, or add a load balancer to your cluster. As per the Chainlink guide, port forwarding is the preferred option as it does not expose the Operator GUI to the public internet, however should you want/need to do this, the option is there through the use of a node balancer.</p><p><strong>Method 1 — Port Forwarding (Recommended)</strong></p><p>To port forward from your pod to localhost, first identify which pod is currently running the Chainlink node. This can be done by running</p><pre>kubectl logs &lt;POD-NAME&gt; --tail 10</pre><p>The node that is currently running should have logs showing it receiving block headers from your Ethereum client. This is the pod we will want to port forward from. Next, simply run</p><pre>kubectl port-forward &lt;POD-NAME&gt; 6688:6688</pre><p>You will now be able to access the operator GUI at localhost:6688</p><p><strong>Method 2 — Load Balancer (Not Recommended)</strong></p><p>Another method for accessing the operator GUI is to simply create a new Kubernetes load balancer service, which will expose our cluster to a public IP, allowing us to get access to the nodes.</p><p>To do this, navigate to the Kubernetes Engine panel, click connect next to the cluster you setup in this tutorial, and then hit open workloads dashboard. You should now see a large list of Kubernetes workloads, and one should be titled chainlink-deployment. Click on that to access our deployments page.</p><p>Scroll down until you see exposing services and click expose. Next, you want to set both the port and target port to 6688, and ensure the type is set to load balancer as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sj0HJKjPn5GDIqbXZBFz7w.png" /><figcaption>Service to expose nodes</figcaption></figure><p>Clicking expose should then start up the service. Once the service is started, on the service page you will see a public IP. This is where you can now access your newly deployed node.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fab922b3a1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>