<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>benchodroff.com</title>
	<atom:link href="https://benchodroff.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://benchodroff.com/</link>
	<description>Small Connections</description>
	<lastBuildDate>Tue, 25 Feb 2025 04:26:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/benchodroff.com/wp-content/uploads/2017/02/cropped-4521-scrm-icon.png?fit=32%2C32&#038;ssl=1</url>
	<title>benchodroff.com</title>
	<link>https://benchodroff.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">122086095</site>	<item>
		<title>Ethereum CLWP Success: Protecting over $120 Million USD in Validator Assets</title>
		<link>https://benchodroff.com/2024/06/17/ethereum-clwp-success-protecting-over-120-million-usd-in-validator-assets/</link>
					<comments>https://benchodroff.com/2024/06/17/ethereum-clwp-success-protecting-over-120-million-usd-in-validator-assets/#respond</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Mon, 17 Jun 2024 05:47:58 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clwp]]></category>
		<category><![CDATA[cybersecurity]]></category>
		<category><![CDATA[ethereum]]></category>
		<guid isPermaLink="false">https://www.benchodroff.com/?p=2105</guid>

					<description><![CDATA[<p>In 2013, I ventured into the world of blockchain, and one phrase has always stuck with me: &#8220;Not your keys, not your coins.&#8221; But what if a mistake happens and your private key is compromised? This situation is more common than many admit. While it often results in the loss of assets, it can be [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2024/06/17/ethereum-clwp-success-protecting-over-120-million-usd-in-validator-assets/">Ethereum CLWP Success: Protecting over $120 Million USD in Validator Assets</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In 2013, I ventured into the world of blockchain, and one phrase has always stuck with me: &#8220;Not your keys, not your coins.&#8221; But what if a mistake happens and your private key is compromised? This situation is more common than many admit. While it often results in the loss of assets, it can be at best an expensive life lesson and teachable moment. However, with a bit of luck and a lot of help, it is still possible to rescue over $120 million USD like I did by during the Ethereum Shapella hardfork on April 12, 2023 by creating EIP-4736 &#8220;CLWP&#8221; Consensus Layer Withdrawal Protection.&nbsp;</p>



<span id="more-2105"></span>



<h2 class="wp-block-heading">The Ethereum Proof of Stake Shift</h2>



<p>Ethereum began to shift to Proof of Stake (PoS) in 2020. Moving away from Proof of Work (PoW) mining allowed Ethereum users to earn yields on their ETH by setting up a small server for staking. However, while staking was possible, withdrawals were initially not possible, with no clear timeline for when this would be supported. Driven by my desire to learn, I decided to set up a validator knowing it would be years before I could withdraw.</p>
<p>Setting up an Ethereum validator is daunting, even for the tech-savvy. It involves open-source code, Linux hardening, generating a cryptographic seed phrase, and sending 32 ETH per validator to a smart contract. The process is now well-documented and understood, but I made several mistakes along the way.</p>



<h2 class="wp-block-heading">Mistakes and Compromises</h2>



<p class="wp-block-paragraph">Catastrophes often result from multiple failures, and a lack of appropriate risk management. My first mistake was not informing my wife about my grand staking experiment using a material portion of our Ethereum. My second mistake was copying the newly created Ethereum validator seed phrase into my electronic notes during setup. I normally would never make this mistake with a private key material as I always inscribe my seed phrases on metal and store them in offline secure locations with a hardware wallet, but I am human and this validator setup process was new. These validator setup notes were backed up on a USB key, which were then backed up on a NAS that was compromised. Needless to say, there were many failures in this chain of events that will never happen again. </p>



<p>In December 2021, I received a suspicious email from an unknown contact. As I read their email, my worst fears were confirmed: my validator seed phrase was compromised, and the sender demanded a &#8220;reward.&#8221; I told my wife about the situation.</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="895" height="246" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2024/06/eth2compromise-1024x281.jpg?resize=895%2C246&#038;ssl=1" alt="" class="wp-image-2152" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromise.jpg?resize=1024%2C281&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromise.jpg?resize=300%2C82&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromise.jpg?resize=768%2C211&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromise.jpg?w=1528&amp;ssl=1 1528w" sizes="(max-width: 895px) 100vw, 895px" /><figcaption class="wp-element-caption">Welcome to the race</figcaption></figure>



<h2 class="wp-block-heading">Navigating the Reward</h2>



<p>Together, we decided to pay the &#8220;reward&#8221; to the greyhat, hoping they would honor the agreement to delete the validator seed phrase. While many experts advise against paying ransoms, I was grateful for the early notification, as it gave me a chance to fight back. A year later, as predicted, the greyhat returned, demanding even more &#8220;reward&#8221;. This time, I ignored their messages as I already had a plan in mind for my unique situation.</p>
<p> </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img data-recalc-dims="1" decoding="async" width="895" height="385" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2024/06/eth2compromiseagain-1024x441.jpg?resize=895%2C385&#038;ssl=1" alt="" class="wp-image-2153" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromiseagain.jpg?resize=1024%2C441&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromiseagain.jpg?resize=300%2C129&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromiseagain.jpg?resize=768%2C331&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/eth2compromiseagain.jpg?w=1468&amp;ssl=1 1468w" sizes="(max-width: 895px) 100vw, 895px" /><figcaption class="wp-element-caption">不回答! Do not answer!</figcaption></figure>
</div>


<h2 class="wp-block-heading">A Unique Situation</h2>



<p class="wp-block-paragraph">At that time in 2021, Ethereum did not allow withdrawals. This meant that neither I, the greyhat, nor any other potential attackers who had compromised my validator seed phrase could access the funds. This was an unusual situation. Typically, once a seed phrase is compromised, assets are quickly drained from the wallet by the attacker. On the blockchain, ownership is psuedo-anonymous. Despite knowing my seed phrase was compromised, no one could act on it.</p>



<p class="wp-block-paragraph">I realized I could prove my validator ownership by signing a message with my deposit address, which was still securely inscribed on metal in a safe and certain that my attacker had no access to. However, the Proof of Stake consensus on the blockchain could not consider this evidence. To outpace the attacker, I needed more people to help broadcast my message before an attacker could.</p>



<h2 class="wp-block-heading">The Birth of Consensus Layer Withdrawal Protection (CLWP)</h2>



<p class="wp-block-paragraph">I researched the Ethereum Proof of Stake network and <a href="https://ethresear.ch/t/preparing-withdrawals-for-compromised-validator-or-withdrawal-keys-fao-zilm/10453/1">discovered others who had their validator seed phrases compromised</a>. I collaborated with researchers, like Jim McDonald, who were intrigued by using the deposit address to prove validator ownership. Unfortunately, the Ethereum withdrawal specifications in draft did not accommodate this method.</p>



<p class="wp-block-paragraph">We found another way: social consensus. By convincing a broader community of the evidence and incentivizing their behavior, we developed the Consensus Layer Withdrawal Protection (CLWP). Documented in <a href="https://eips.ethereum.org/EIPS/eip-4736">EIP-4736</a>, CLWP proposed creating a list of verifiable messages to broadcast via Ethereum consensus nodes at the Shanghai Capella hard fork. The goal was to propagate CLWP messages faster than an attacker, <a href="https://github.com/benjaminchodroff/ConsensusLayerWithdrawalProtection">leveraging a volunteer network &#8220;sneakernet&#8221; using submissions via a GitHub repository</a> and low latency bots, with <a href="https://curate.kleros.io/tcr/1/0x479083b5343aB89bb39608e3176D750c8A6957B5">social arbitration moderation using Kleros curated lists</a>. None of this social consensus changed Ethereum on-chain consensus, nor could guarantee success against an attacker. Volunteers were incentivized through altruism or self preservation of their own compromised validator by statistically shifting success in favor of legitimate validator owners. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img data-recalc-dims="1" decoding="async" width="591" height="326" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2024/06/CLWP-Diagram.drawio.png?resize=591%2C326&#038;ssl=1" alt="" class="wp-image-2155" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/CLWP-Diagram.drawio.png?w=591&amp;ssl=1 591w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/CLWP-Diagram.drawio.png?resize=300%2C165&amp;ssl=1 300w" sizes="(max-width: 591px) 100vw, 591px" /><figcaption class="wp-element-caption">Social consensus can win against on-chain consensus</figcaption></figure>
</div>


<h2 class="wp-block-heading">The Outcome</h2>



<p class="wp-block-paragraph">With the help of many brilliant engineers and volunteers, we prepared for this sprint, documenting the evolving withdrawal specifications and <a href="https://clwp.xyz/">convincing Ethereum client teams and users to adopt our ideas</a>. The result? On 4/12/2023 at the Ethereum Shanghai Capella &#8220;Shapella&#8221; hardfork, the CLWP project helped 2,133 validators protect more than 68,256 ETH in principal and additional rewards, valued over $120 million USD (and worth much more now). Every single validator, including mine, was successfully protected. </p>



<p class="wp-block-paragraph">In a twist, my validators were not protected by CLWP. Instead, due to a race condition timing attack bug discovered in the last days by an Ethereum Researcher, my validators were rescued by a secret sniping bot that was designed to outperform the CLWP protocol. Even the Ethereum consensus layer is a <a href="https://www.paradigm.xyz/2020/08/ethereum-is-a-dark-forest">dark forest</a>. </p>



<p class="wp-block-paragraph">This journey taught me invaluable lessons, allowed me to assist others, and introduced me to some of the most brilliant minds in the cryptocurrency community. I hope my story inspires others to keep their seed phrases secure offline and view mistakes as opportunities for growth and learning.</p>



<h2 class="wp-block-heading">Thank you</h2>



<p class="wp-block-paragraph">I cannot thank enough all the people who helped me. Special thanks to Tobes for running <a href="https://x.com/EthCLWP">@EthCLWP</a> and website, <a href="https://x.com/jgm">@jgm</a> for his expert knowledge in ethdo and Ethereum withdrawals, <a href="https://x.com/offchainglobal">@offchainglobal</a> for organizing volunteers, <a href="https://x.com/superphiz">@superphiz</a> for getting the word out in the community, <a href="https://x.com/ethStaker">@ethStaker</a>, <a href="https://ethereum-magicians.org/">ETH Magicians</a>, <a href="https://blog.ethereum.org/category/research-and-development">Ethereum Foundation R&amp;D</a> for helping us connect to the best minds in the industry, <a href="https://x.com/KlerosCurate">@KlerosCurate</a> for assisting us with moderating social consensus, <a href="https://x.com/Allnodes">@Allnodes</a> and <a href="https://x.com/LidoFinance">@LidoFinance</a> for broadcasting CLWP, <a href="https://x.com/poojaranjan19">@poojaranjan19</a> at <a href="https://www.ethereumcatherders.com/">Eth Cat Herders</a> for helping get the EIP through the process, <a href="https://www.flashbots.net/">Flashbots</a>, all of the Consensus client teams <a href="https://x.com/sigp_io">@sigp_io</a> <a href="https://x.com/lodestar_eth">@lodestar_eth</a> <a href="https://x.com/prylabs">@prylabs</a> <a href="https://x.com/Teku_Consensys">@Teku_ConsenSys</a> for supporting CLWP, and the <a href="https://github.com/benjaminchodroff/ConsensusLayerWithdrawalProtection">hundreds of people who volunteered to submit their validators withdrawal address and broadcast the messages</a>. </p>



<p class="wp-block-paragraph">To the greyhat who notified me that I was compromised: thank you. I hope one day to get a drink together. The world is more friendly than it seems when good people work together. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img data-recalc-dims="1" decoding="async" width="895" height="241" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2024/06/web3hostile-1024x276.jpg?resize=895%2C241&#038;ssl=1" alt="" class="wp-image-2162" style="width:748px;height:auto" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/web3hostile.jpg?resize=1024%2C276&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/web3hostile.jpg?resize=300%2C81&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/web3hostile.jpg?resize=768%2C207&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2024/06/web3hostile.jpg?w=1514&amp;ssl=1 1514w" sizes="(max-width: 895px) 100vw, 895px" /><figcaption class="wp-element-caption">The world <em>is</em> more friendly than it seems</figcaption></figure>
</div>


<figure class="wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" class="youtube-player" width="895" height="504" src="https://www.youtube.com/embed/C8rxSljl2PM?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;start=18&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
</div><figcaption class="wp-element-caption">PeeP an EIP: EIP-4736 Consensus Layer Withdrawal Protection</figcaption></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" class="youtube-player" width="895" height="504" src="https://www.youtube.com/embed/EWkGyorgpAg?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
</div><figcaption class="wp-element-caption">CLWP Presentation</figcaption></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://benchodroff.com/2024/06/17/ethereum-clwp-success-protecting-over-120-million-usd-in-validator-assets/">Ethereum CLWP Success: Protecting over $120 Million USD in Validator Assets</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2024/06/17/ethereum-clwp-success-protecting-over-120-million-usd-in-validator-assets/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2105</post-id>	</item>
		<item>
		<title>Foreign Permanent Resident Identification in Mainland China</title>
		<link>https://benchodroff.com/2022/07/02/foreign-permanent-resident-identification-in-mainland-china/</link>
					<comments>https://benchodroff.com/2022/07/02/foreign-permanent-resident-identification-in-mainland-china/#respond</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Sat, 02 Jul 2022 07:30:28 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[foreigner]]></category>
		<category><![CDATA[green card]]></category>
		<category><![CDATA[guangzhou]]></category>
		<category><![CDATA[identification]]></category>
		<category><![CDATA[permanent resident]]></category>
		<category><![CDATA[visa]]></category>
		<guid isPermaLink="false">https://www.benchodroff.com/?p=2078</guid>

					<description><![CDATA[<p>Applying for a mainland China green card, officially called a Foreign Permanent Resident Identification Card, is a very complicated process partly because very few foreigners have ever attempted to document their experience. Each province has its own specific rules and handling, but overall the process is set by the central government for processing once approved [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2022/07/02/foreign-permanent-resident-identification-in-mainland-china/">Foreign Permanent Resident Identification in Mainland China</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Applying for a mainland China green card, officially called a Foreign Permanent Resident Identification Card, is a very complicated process partly because very few foreigners have ever attempted to document their experience. Each province has its own specific rules and handling, but overall the process is set by the central government for processing once approved by the locality and province. As of the <a href="http://www.xinhuanet.com/english/2021-05/11/c_139938889.htm" target="_blank" rel="noreferrer noopener">2020 census results</a>, there were a reported 1.4 million people in the Chinese mainland from Hong Kong, Taiwan, Macau, or Foreigners &#8211; representing about 0.1% of the total 1.4B population. By my own estimates, more than half of these individuals left from 2020-2021 due to COVID-19, and another half of the remaining in 2022 due to the lockdown events in Shanghai. Perhaps less than half of the remaining individuals are eligible for PR, and even less than half that have submitted an application. I would estimate that less than 0.005% of the total mainland China population have ever received a green card. Here are some details that may help others trying to understand what this card is, why you may want to apply, how to apply, and expectations on the challenges involved.</p>



<span id="more-2078"></span>



<h2 class="wp-block-heading">What is it?</h2>



<p class="wp-block-paragraph">Unlike a USA Permanent Residence (PR) &#8220;Green Card&#8221; (GC) which is seen as a step towards citizenship through naturalization, China has no immigration process and this document instead provides a permissive form of a visa and a form of identification while inside China. However, you are and will forever still be a citizen of your existing country. As such, obtaining China PR status may provide additional benefits, visa simplification, and convenient proof of identity. Foreigners normally have a choice of &#8220;tax residency in China&#8221; depending on how long they stay each year in China. Obtaining a PR will force you to be declared a tax resident, but if you already stay in China at least 183 days/year, you already have this obligation. </p>



<p class="wp-block-paragraph">Similar to other countires, a China PR card is not truly permanent as the name suggests. It expires after a maximum of ten years (can be reissued), or five years if a child, and can be rescinded if you are deported or do not spend at least 3/12 months and 1/5 years in China without prior permission. It does not provide residence registration. You will still need to register a temporary address with the local police with your passport regardless if you purchase a house or rent a home. You still sometimes need to use your passport for identification. </p>



<p class="wp-block-paragraph"><strong>So why on earth would any person bother getting a &#8220;Foreign&#8221; (Sorry HK/TW/MO) &#8220;Permanent&#8221; (Nope) &#8220;Resident&#8221; (AI cameras not working?) &#8220;Identification&#8221; (No State ID?) when none of the words provide the full registration and capabilities they suggest</strong>. Maybe you just enjoy a challenge, but there are some benefits. </p>



<h2 class="wp-block-heading">Why get one?</h2>



<p class="wp-block-paragraph">China PR provides many upside abilities such as:</p>



<ul class="wp-block-list">
<li>Work and change jobs without an employer sponsoring a visa. A spousal visa does not provide this ability.</li>



<li>Multiple entry into China for up to 10 years. A normal work visa is limited to your employment contracts which often are capped at 3 years and are tied to your employer. </li>



<li>Entry into China even if a crisis often cancels other visa types. (COVID-19&#8230;. WW3-22, Zombies-23)</li>



<li>Automated checkin at many airport, train, hotel and other terminals/IT systems (not all do)</li>



<li>Open accounts (Bank, Cellphone, Wechat, Alipay, others)&nbsp; (not all do)</li>



<li>Travel around China without a passport (police registration may still require a passport for ID number)</li>



<li>Open to pay into housing and social security benefits&nbsp;</li>
</ul>



<p class="wp-block-paragraph">For myself personally, it made sense to apply because I needed to ensure I could stay with my family if I ever lost my job, a crisis canceling visas, peace of mind of traveling in China with a Chinese issued ID to avoid a passport loss/theft/ or a requested seizure in Xinjiang (yes, that happens). It would be great if the Chinese IT systems also start allowing to do microloan payments for vending machines, bikes and cellphone battery rentals, or Taobao/JD for handling purchase from abroad, but I think those use cases are still not fully supported. </p>



<p class="wp-block-paragraph">For my son, it made sense to have a China PR because it will allow him to remain in China without requiring a multiple entry visa. Even during the COVID19 pandemic, he technically was required to do visa runs to another country, even though he is a child of a Chinese citizen. This caused a lot of hassle in having to go to deal with the unfriendly Exit Entry Build officers to obtain visas, sometimes for only a 30 day extension. Having a PR ID avoids this situation. </p>



<h2 class="wp-block-heading">How to apply?</h2>



<p class="wp-block-paragraph">Each province has its own exact rules, paperwork, and process. There are multiple categories in which you can attempt to apply. I applied in Guangzhou in 2022. </p>



<p class="wp-block-paragraph">Here is the 2022 form you will have to fill out, but you should go to the Exit Entry Building and obtain the latest version as it will likely update periodically. </p>



<div data-wp-interactive="core/file" class="wp-block-file"><object data-wp-bind--hidden="!state.hasPdfPreview" hidden class="wp-block-file__embed" data="https://www.benchodroff.com/wp-content/uploads/2022/07/Application-for-Permanent-Residence-in-China-2020.small_.pdf" type="application/pdf" style="width:100%;height:600px" aria-label="Embed of Application-for-Permanent-Residence-in-China-2020.small_."></object><a id="wp-block-file--media-2b5ab525-4968-4189-affb-9132342216ef" href="https://www.benchodroff.com/wp-content/uploads/2022/07/Application-for-Permanent-Residence-in-China-2020.small_.pdf">Application-for-Permanent-Residence-in-China-2020.small_</a><a href="https://www.benchodroff.com/wp-content/uploads/2022/07/Application-for-Permanent-Residence-in-China-2020.small_.pdf" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-2b5ab525-4968-4189-affb-9132342216ef">Download</a></div>



<p class="wp-block-paragraph">You must provide three identically completed applications in original form, as copies are not accepted of the application form itself. You must show the officer the original of the supporting evidence, and three photocopies for the submission &#8211; one for each application. I believe one application goes to the city (Guangzhou), another to the province (Guangdong), and another to the central government. Each is approved in order, and will take up to six months to complete from time of successful submission. The submission and all evidence is not provided online, so expect to have a mountain of printed paperwork. </p>



<p class="wp-block-paragraph">The exact documents required will depend on the type of category you choose. Certain categories, such as the High Talent category, will have their own applications and approvals at company, local, province, and central government levels. As such, you can expect even the pre-conditions to take <em>considerable</em> time and cost to complete. I tried to ask the PSB for a digital copy of a book they gave me on the application process, but they said they did not have one because of &#8220;maybe national security concerns.&#8221; Here is a copy of the book I took with my cellphone (apologies) as there appears to be no restrictions on the material. There is an exact Chinese version of the book at the end, which should be used in case the English is confusing, as the Chinese provides the exact regulations. </p>



<div data-wp-interactive="core/file" class="wp-block-file"><object data-wp-bind--hidden="!state.hasPdfPreview" hidden class="wp-block-file__embed" data="https://www.benchodroff.com/wp-content/uploads/2023/12/Service-Manual-for-Foreign-Personnel-2019-1.pdf" type="application/pdf" style="width:100%;height:600px" aria-label="Embed of Service Manual for Foreign Personnel 2019."></object><a id="wp-block-file--media-314d1446-7663-4264-9d4e-c5545caa6eef" href="https://www.benchodroff.com/wp-content/uploads/2023/12/Service-Manual-for-Foreign-Personnel-2019-1.pdf">Service Manual for Foreign Personnel 2019</a><a href="https://www.benchodroff.com/wp-content/uploads/2023/12/Service-Manual-for-Foreign-Personnel-2019-1.pdf" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-314d1446-7663-4264-9d4e-c5545caa6eef">Download</a></div>



<p class="wp-block-paragraph">End to end, from time of starting the process to completion it took me about 10 months. I already had many of the documents fully ready previously due to other visa applications. My China PR ID approval process took nearly exactly six months, as they advertised. Once you apply successfully, you will receive a submission confirmation paper with the application number. They assigned me a very courteous officer to handle the process, and was able to keep in touch via WeChat to check on the status. </p>



<p class="wp-block-paragraph">Once ready, my case officer notified me to come to the office with my original passport used during the application and the confirmation piece of paper. You must personally physically show up at the office to pick up the PR ID Card, unless it is for a child, in which case one of the parents can pick it up without them present as long as they have the child&#8217;s original passport used and original submission confirmation paper. They won&#8217;t mail it under any circumstance, even if involuntarily locked down in another province for an undetermined amount of time. </p>



<h2 class="wp-block-heading">How much does it cost? </h2>



<p class="wp-block-paragraph">As of 2022, the submission is 1500 RMB non-refundable payment that must be paid at a local bank. If you are approved, you will also have to pay 300 RMB at the counter using WeChat once they issue the card. </p>



<p class="wp-block-paragraph">Gathering the supporting evidence is the real cost and complexity. If the document is from a foreign country, it must be apostille for use outside of the country by first the state of issuance&#8217;s Department of State (Examples: If a birth certificate is from Illinois, it must be apostille by Illinois. If the FBI Background Check report, it must be apostille at the federal level &#8211; US Department of State). </p>



<p class="wp-block-paragraph">Once apostille allows the document to be used abroad, you then submit the document to the China Consulate in your country for approval for use in China, and then mailed back to yourself. Always use a mail service that can provide a tracking number and never rely on any domestic postal service anywhere. If the document is not in Chinese, you must then use an official Chinese notary to translate and notarize this document. As you can imagine, this can add up to a lot of cost &#8211; easily a few hundred to thousand RMB per document due to apostille, consulate, shipping, translation, notary, and copying costs. Each document only needs one original which you must show to the officer and then can retain, but you should have three copies made to be submit with each of the three original applications. </p>



<p class="wp-block-paragraph">I personally completed the process by myself (some help from my wife, thank you), while residing in China, with limited ability to speak and write Chinese. While it is possible to hire an agency to ensure all the steps are completed, I hope the documents and advice I have provided may help others complete the work themselves. Best of luck. </p>
<p>The post <a href="https://benchodroff.com/2022/07/02/foreign-permanent-resident-identification-in-mainland-china/">Foreign Permanent Resident Identification in Mainland China</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2022/07/02/foreign-permanent-resident-identification-in-mainland-china/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2078</post-id>	</item>
		<item>
		<title>NFT Stickers using NFC and POAP</title>
		<link>https://benchodroff.com/2022/06/30/nft-stickers-using-nfc-and-poap/</link>
					<comments>https://benchodroff.com/2022/06/30/nft-stickers-using-nfc-and-poap/#comments</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Thu, 30 Jun 2022 15:17:35 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.benchodroff.com/?p=2061</guid>

					<description><![CDATA[<p>Non-fungible tokens have taken the web3 world by storm with rags to riches stories. However, did you know NFTs don&#8217;t have to be used for speculative trading of digital artwork? Anything can be tokenized, and POAP &#8220;Proof of Attendance Protocol&#8221; allows tracking attendees at any event use the power of blockchain to provide an immutable [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2022/06/30/nft-stickers-using-nfc-and-poap/">NFT Stickers using NFC and POAP</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Non-fungible tokens have taken the web3 world by storm with rags to riches stories. However, did you know NFTs don&#8217;t have to be used for speculative trading of digital artwork? Anything can be tokenized, and <a href="https://poap.xyz/" target="_blank" rel="noreferrer noopener">POAP</a> &#8220;Proof of Attendance Protocol&#8221; allows tracking attendees at any event use the power of blockchain to provide an immutable record of who showed up by issuing each a free NFT. POAP is completely free to create events, and free to issue NFTs. I wanted to take the POAP NFT and give it a digital twin in the real world &#8211; something physical you could give out as a prize for attending that corresponded exactly with the digital NFT: a NFC sticker. </p>



<span id="more-2061"></span>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/www.androidauthority.com/wp-content/uploads/2013/09/NFC-tag-induction-circuit.jpg?resize=323%2C201&#038;ssl=1" alt="" width="323" height="201"/><figcaption>NFC ntag213 25mm Sticker</figcaption></figure></div>



<p class="wp-block-paragraph">NFC, or Near-Field Communication, tags are low cost, low bandwidth, small range, and are already supported by both iPhone and Android phones. Your phone likely already has this feature, but many are unaware of using it with these tags. The tags themselves come in multiple formats, but the ntag213 is a 25mm circle no thicker than a normal sticker that can store a small amount of data &#8211; such as a URL. Programming these tags can be done with any standard iPhone or Android phones using free software. Reading the tag requires no software to be installed on the phone, and the tag requires no battery as it uses the radio signals from your cellphone to power the incredibly tiny chips in the sticker. </p>



<div class="wp-block-image"><figure class="aligncenter size-medium"><img data-recalc-dims="1" decoding="async" width="300" height="225" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/06/offchainpoapsticker-1-300x225.jpg?resize=300%2C225&#038;ssl=1" alt="OffChain POAP NFC Stickers" class="wp-image-2064"/><figcaption>OffChain NFC Sticker POAP NFT</figcaption></figure></div>



<p class="wp-block-paragraph">Normally, to claim a POAP NFT, you are given a claim code or QR code to scan or type into the <a href="https://poap.xyz/" target="_blank" rel="noreferrer noopener">POAP app</a>. However, we can take the list of claim URLs and write them to NFC ntag213 stickers to make a cost effective and very unique digital twin experience. Simply tapping the iPhone or Android against a regular looking sticker magically loads the URL to mint the NFT to the user&#8217;s web3 wallet. </p>



<p class="wp-block-paragraph">I ordered 1000 ntag213 25mm stickers from Taobao for only 0.35 RMB each. I then ordered 1000 vinyl 25mm stickers for 108RMB. In total, that is only $0.07 USD per sticker in material costs. Sadly, I have yet to find a vendor that &#8220;does it all&#8221; to print a vinyl sticker, attach it on the NFC tag, and program it with the unique URL. As such, I had to manually peel 1000 stickers and attach them to the tags. After attaching each sticker, you will then need to write the URL contents. I found a free application &#8220;<a href="http://NFC TagWriter by NXP on the App Storehttps://apps.apple.com › app › nfc-tagwriter-by-nxp">NXP TagWriter</a>&#8221; which claims to have CSV support, but in reality it doesn&#8217;t work on iPhone (but perhaps csv imports work on Android?). Luckily, they did have a dataset export/import feature which can import a json-like file. I made a small python POAP URL to json file converter by using the ndef python library to hex encode and format the tag data contents. </p>



<script src="https://gist.github.com/benjaminchodroff/f851b42e2c0cd23e824fae0eb89a1f83.js"></script>



<div class="wp-block-image"><figure class="aligncenter size-medium"><img data-recalc-dims="1" decoding="async" width="139" height="300" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter-139x300.jpg?resize=139%2C300&#038;ssl=1" alt="NXP TagWriter" class="wp-image-2065" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter.jpg?resize=139%2C300&amp;ssl=1 139w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter.jpg?resize=473%2C1024&amp;ssl=1 473w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter.jpg?resize=768%2C1661&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter.jpg?resize=710%2C1536&amp;ssl=1 710w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter.jpg?resize=947%2C2048&amp;ssl=1 947w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/06/nxp_tagwriter.jpg?w=1120&amp;ssl=1 1120w" sizes="(max-width: 139px) 100vw, 139px" /><figcaption>NXP TagWriter Write Multiple</figcaption></figure></div>



<p class="wp-block-paragraph">Upload the resulting json file to your iPhone or Android, import it with NXP TagWriter, and then multi-write the tags one by one. Now, hand the tags out at your next event. Most people were… amazed. They couldn&#8217;t believe that a sticker could be scanned by a phone, or that NFTs can be free. I hope this guide helps others recreate the POAP NFT via NFC sticker experience. </p>
<p>The post <a href="https://benchodroff.com/2022/06/30/nft-stickers-using-nfc-and-poap/">NFT Stickers using NFC and POAP</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2022/06/30/nft-stickers-using-nfc-and-poap/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2061</post-id>	</item>
		<item>
		<title>OpenCanary honeypot on Synology NAS</title>
		<link>https://benchodroff.com/2022/03/02/opencanary-honeypot-on-synology-nas/</link>
					<comments>https://benchodroff.com/2022/03/02/opencanary-honeypot-on-synology-nas/#comments</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Wed, 02 Mar 2022 10:45:07 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.benchodroff.com/?p=2041</guid>

					<description><![CDATA[<p>Coal miners used to carry a canary in a cage when digging as the bird would sing, unless dangerous gasses collected in the mine which would weaken the bird and alert the miners of the imminent danger. The same concept has existed in computer security for a long time as honeypots naturally attract hackers and [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2022/03/02/opencanary-honeypot-on-synology-nas/">OpenCanary honeypot on Synology NAS</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Coal miners used to carry a canary in a cage when digging as the bird would sing, unless dangerous gasses collected in the mine which would weaken the bird and alert the miners of the imminent danger. The same concept has existed in computer security for a long time as honeypots naturally attract hackers and allow a network security engineer to use them to alert of the issue. A Synology NAS full of identification or financial documents is a target for hackers that should be fully secured on your intranet and always isolated from the public internet. However, what if your internal network is unknowingly compromised (malware, IoT device, etc.) and hackers start to try to launch attacks against your secure NAS? Reviewing the log files for all possible service attacks may be quite challenging and, by the time you notice the issue, may be too late to take action. A canary honeypot can help immediately alert you that a serious problem may exist within your security perimeter.</p>



<span id="more-2041"></span>



<p class="wp-block-paragraph">For this project, I used the &#8220;thinkst/opencanary&#8221; docker container on my Synology NAS. It creates a variety of psuedo-real services that log to a central file that can be easily monitored. Any bot, script kiddie, or even advanced persistent threat scanning the network may get curious, access this honeypot, and trigger the canary to issue an early warning alert. Thinkst also has an enterprise version and I&#8217;m willing to bet it&#8217;s worth the money because the free version is amazing for a self-hosted enthusiast, but their paid version looks turnkey.</p>



<p class="wp-block-paragraph">The Synology NAS makes hosting docker containers easy. This particular container is going to require a bit more setup because it will be attempting to run services on ports that conflict with Synology&#8217;s own internal service ports, such as a tcp/80 webserver. We can use a docker &#8220;macvlan&#8221; network driver to create a special network interface that creates a unique IP address separate from your Synology NAS IP address.</p>



<p class="wp-block-paragraph">The full instructions on <a href="https://www.wundertech.net/how-to-use-docker-on-a-synology-nas/#2_Macvlan_Bridge_Network_Interface">how to set up Macvlan in Synology can be found here</a> and I suggest reading these first.</p>



<p class="wp-block-paragraph">However, the commands I used are specific to my Synology setup (I use bond0 instead of eth0 because I have bonded my ethernet ports together, and I picked 192.168.50.200/32 as an unused ip address that my router DHCP will not assign). You must SSH to the Synology NAS to issue this command because it is currently not possible to create a macvlan network through the GUI:</p>



<p class="wp-block-paragraph"><code>docker network create -d macvlan -o parent=bond0 --subnet=192.168.50.0/24 --gateway=192.168.50.1 --ip-range=192.168.50.200/32 canary_network</code></p>



<p class="wp-block-paragraph">I next created a docker bridge &#8220;canary_bridge&#8221; network through the Synology GUI. This allows my Synology to communicate with the OpenCanary container using 192.168.10.2/32 IP address.</p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" width="895" height="522" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?resize=895%2C522&#038;ssl=1" alt="canary_bridge" class="wp-image-2028" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?w=1926&amp;ssl=1 1926w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?resize=300%2C175&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?resize=1024%2C598&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?resize=768%2C448&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?resize=1536%2C896&amp;ssl=1 1536w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_bridge.jpg?w=1790&amp;ssl=1 1790w" sizes="(max-width: 895px) 100vw, 895px" /></figure>



<p class="wp-block-paragraph">Finally, I downloaded the image &#8220;neomediatech/opencanary:latest&#8221; (it appears to be the best supported version of thinkst/opencanary in dockerhub), and launched it on both the &#8220;canary_network&#8221; and &#8220;canary_bridge&#8221; networks using the advanced settings during the launch. This ensures both my NAS and rest of the network can see this container. As the container is using macvlan, you do not need to map any ports in docker &#8212; everything on the container is magically directly visible to the network. Leave the &#8220;port settings&#8221; page blank. <span style="text-decoration: underline;">Never expose this container directly to the public internet &#8220;for fun&#8221;, as the canary services it runs are not secure and don&#8217;t trust a docker container to isolate from a hacker.</span></p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" width="895" height="776" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/03/canary_advancednetwork.jpg?resize=895%2C776&#038;ssl=1" alt="canary_advancednetwork" class="wp-image-2029" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_advancednetwork.jpg?w=1264&amp;ssl=1 1264w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_advancednetwork.jpg?resize=300%2C260&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_advancednetwork.jpg?resize=1024%2C888&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_advancednetwork.jpg?resize=768%2C666&amp;ssl=1 768w" sizes="(max-width: 895px) 100vw, 895px" /></figure>



<p class="wp-block-paragraph">In the volume settings, you can specify a /data directory for the log file, and optionally provide a custom opencanary.conf file mapped to /root/.opencanary.conf. <a href="https://github.com/thinkst/opencanary/blob/master/data/.opencanary.conf">The example opencanary.conf template file can be found on the github repository &#8211; enable more of the services</a>.</p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" width="895" height="755" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/03/canary_volume.jpg?resize=895%2C755&#038;ssl=1" alt="canary_volume" class="wp-image-2033" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_volume.jpg?w=1278&amp;ssl=1 1278w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_volume.jpg?resize=300%2C253&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_volume.jpg?resize=1024%2C864&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_volume.jpg?resize=768%2C648&amp;ssl=1 768w" sizes="(max-width: 895px) 100vw, 895px" /></figure>



<p class="wp-block-paragraph">Once launched, you could port scan the IP address of the OpenCanary from another machine and see the services running (or use 192.168.10.1 if running the scan from the Synology):</p>



<p class="wp-block-paragraph"><code>nmap -F 192.168.50.200</code></p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" width="606" height="324" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/03/canary_ports.jpg?resize=606%2C324&#038;ssl=1" alt="canary_ports" class="wp-image-2030" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_ports.jpg?w=606&amp;ssl=1 606w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_ports.jpg?resize=300%2C160&amp;ssl=1 300w" sizes="(max-width: 606px) 100vw, 606px" /></figure>



<p class="wp-block-paragraph">When you access port 80 webserver, you will get a very convincing fake Synology NAS login page:</p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" width="895" height="473" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/03/canary_login.jpg?resize=895%2C473&#038;ssl=1" alt="canary_login" class="wp-image-2031" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_login.jpg?w=1778&amp;ssl=1 1778w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_login.jpg?resize=300%2C159&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_login.jpg?resize=1024%2C541&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_login.jpg?resize=768%2C406&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary_login.jpg?resize=1536%2C812&amp;ssl=1 1536w" sizes="(max-width: 895px) 100vw, 895px" /></figure>



<p class="wp-block-paragraph">When a hacker attempts to login against these fake services, each attempt is logged. As nobody should ever need to login to these fake services, you can now use any log file alerting tool. You can also use the built in PyLogger SMTP service to relay these log messages to your email. Sadly, the SMTP log service has issues with TLS connections so you may need to fiddle with the settings&#8230; it took me a bit to get it all working. </p>



<figure class="wp-block-image"><img data-recalc-dims="1" decoding="async" width="895" height="177" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/03/canary-log.jpg?resize=895%2C177&#038;ssl=1" alt="canary log" class="wp-image-2032" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary-log.jpg?w=1438&amp;ssl=1 1438w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary-log.jpg?resize=300%2C59&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary-log.jpg?resize=1024%2C202&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/03/canary-log.jpg?resize=768%2C152&amp;ssl=1 768w" sizes="(max-width: 895px) 100vw, 895px" /></figure>



<p class="wp-block-paragraph">Now you all know my secrets but hopefully this idea helps protect someone else.</p>
<p>The post <a href="https://benchodroff.com/2022/03/02/opencanary-honeypot-on-synology-nas/">OpenCanary honeypot on Synology NAS</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2022/03/02/opencanary-honeypot-on-synology-nas/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2041</post-id>	</item>
		<item>
		<title>Helium blockchain in China using a Panther X1 and Wireguard VPN</title>
		<link>https://benchodroff.com/2022/01/15/helium-blockchain-in-china-using-a-panther-x1-and-wireguard-vpn/</link>
					<comments>https://benchodroff.com/2022/01/15/helium-blockchain-in-china-using-a-panther-x1-and-wireguard-vpn/#comments</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Sat, 15 Jan 2022 06:33:04 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.benchodroff.com/?p=1962</guid>

					<description><![CDATA[<p>Helium is a blockchain which creates a decentralized LoRaWAN global wireless network for IoT devices that rewards users based on Proof of Coverage. I came across the idea years before, but was concerned that they only allowed a single device to provide the LoRaWAN coverage! Helium has now opened up to support many approved device [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2022/01/15/helium-blockchain-in-china-using-a-panther-x1-and-wireguard-vpn/">Helium blockchain in China using a Panther X1 and Wireguard VPN</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Helium is a blockchain which creates a decentralized <a href="https://lora-alliance.org/" target="_blank" rel="noopener">LoRaWAN</a> global wireless network for IoT devices that rewards users based on Proof of Coverage. I came across the idea years before, but was concerned that they only allowed a single device to provide the LoRaWAN coverage! Helium has now opened up to support many approved device manufactures. I decided to purchase a Panther X1 unit to try it out. While using a blockchain in China for personal purposes (not as a company) is not illegal, China has heavily censored many blockchain related services.</p>
<p><span id="more-1962"></span></p>
<p>The Helium relies on libp2p. China&#8217;s Great Firewall (GFW) has very effective mechanisms that recognize libp2p domestically and inject connection resets during the SSL handshake. While you could put a commercial VPN in front of your Helium device, most of these solutions won&#8217;t allow opening a port. Helium is supposed to work around this problem by providing a relay service, but this relay mechanism is also being disrupted inside China. This will cause your node to remain fully synchronized but never participate in Proof of Coverage (witness/beacons). If you want to decentralize in China, you need to build your own bridge out of China to participate. I implemented a bridge to a Virtual Private Server (VPS) in the cloud outside of China by using a self hosted Wireguard VPN and client. Each Helium device would require its own VPS (or more specifically, its own unique external to China IP address with port 44158 opened, because relays are broken). Here are the steps to take to reproduce my setup.</p>
<p>The Panther X1 is internally a Raspberry Pi 4B with a LoRaWAN adapter. The Raspberry Pi is locked down but allows SSH connections. In order to install a VPN client on this device and troubleshoot it effectively, we will need to break into the device. Luckily, the Panther X1 isn&#8217;t that secure (note: the Panther X2 implements additional security).</p>
<p>Open the device up, remove the four rubber pads from the device, remove the four screws in the case, remove all the screws holding down the LoRaWAN adapter, and <span style="text-decoration: underline;">gently</span> pull up on the adapter towards the antennas. You will find it separates from the pins on the Raspberry Pi board.</p>
<p><img data-recalc-dims="1" decoding="async" class="alignleft size-full wp-image-1966" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2022/01/IMG_8254-1.jpg?resize=895%2C671" alt="" width="895" height="671" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/01/IMG_8254-1.jpg?w=1000&amp;ssl=1 1000w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/01/IMG_8254-1.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2022/01/IMG_8254-1.jpg?resize=768%2C576&amp;ssl=1 768w" sizes="(max-width: 895px) 100vw, 895px" /></p>
<p>Once the LoRaWAN adapter is disconnected (you may keep the antennas connected, just move the board aside), remove all the screws for the Raspberry Pi. On the underside you will find a micro SD Card. Remove this card, and install it into a USB micro SD card reader on a Linux computer (on older MacOS you can use exFuse, and there may be a similar program for Windows &#8211; let me know in the comments). Find the device such as &#8220;/dev/sdb2&#8221;. The letter may be different on your computer, but it is the second partition which is formatted ext4 that we want. </p>
<pre><code># Mount the device to a mountpoint that is available<br />sudo mount /dev/sdb2 /mnt</code><br /><code>vim /root/.ssh/authorized_keys</code><br /><code># Append your SSH public key to the list (if you don't know what a SSH public key is, you will need to google it to learn more)<br /># Once completed, unmount the device</code><br /><code>sudo umount /mnt</code></pre>
<p>Once we have modified this file, we can now reinstall the micro SD card back into the Raspberry Pi. Now is a great time to install heatsinks on the Raspberry Pi CPU, RAM, and bridge &#8212; as the device gets to 80C otherwise. Finally, reattach the LoRaWAN adapter &#8211; pay attention to ensure the pins line up correctly. Reinstall the screws for the case and rubber feet. You can boot your Panther X1 back up and find that your SSH root account now accepts logins using your private key.</p>
<p>To install wireguard server and client, I <a href="https://www.cyberciti.biz/faq/ubuntu-20-04-set-up-wireguard-vpn-server/" target="_blank" rel="noopener">followed this guide</a> with some modifications below:</p>
<h2>Wireguard VPN Server on VPS</h2>
<pre><code><strong>sudo apt update<br />sudo apt upgrade<br />reboot<br />sudo apt install wireguard vim fail2ban<br />sudo -i<br />cd /etc/wireguard/<br />umask 077; wg genkey | tee privatekey | wg pubkey &gt; publickey<br />cat privatekey<br />cat publickey<br />sudo vim /etc/wireguard/wg0.conf<br /># Replace PrivateKey with the server private key<br /># We will generate the Peer client PublicKey later... leave the section commented out for now</strong></code></pre>
<pre><span class="re0"><span class="br0">[</span>Interface<span class="br0">]</span></span> <br />## My VPN server private IP address (Don't change this unless required) <br /><span class="re1">Address</span> <span class="sy0">= 192.168.12.1/24</span>  <br /> <br />## My VPN server port ## <br /><span class="re1">ListenPort</span> <span class="sy0">= 41194</span>   <br /><br />## VPN server<span class="st0">'s private key i.e. /etc/wireguard/privatekey <br />PrivateKey = <span style="background-color: #ff0000;">REPLACE ME</span><br /><br />PostUp = /etc/wireguard/helper/add-nat-routing.sh</span><br /><span class="s1">PostDown = /etc/wireguard/helper/remove-nat-routing.sh</span><br /><span class="s1"><br /># (come back and uncomment this once you set up the client!)<br />#[Peer]</span><br /><span class="s1">## Client public key </span><br /><span class="s1"># PublicKey = <span style="background-color: #ff0000;">REPLACE ME</span></span><br />#<br /><span class="s1">## client VPN IP address (note<span class="Apple-converted-space"> </span>the /32 subnet) - (Don't change this unless required) ##</span><br /><span class="s1">#AllowedIPs = 192.168.12.2/32<br /></span></pre>
<pre class="de1"><span class="st0"><code><strong>sudo mkdir /etc/wireguard/helper</strong><br /><strong>sudo vim /etc/wireguard/helper/add-nat-routing.sh</strong></code></span></pre>
<pre class="p1"><span class="s1">#!/bin/bash</span><br /><span class="s1"># https://www.cyberciti.biz/faq/ubuntu-20-04-set-up-wireguard-vpn-server/</span><br /><span class="s2">IPT="/sbin/iptables"</span><br /><span class="s1">#IPT6="/sbin/ip6tables" <span class="Apple-converted-space">         </span></span><br /><span class="s1">IN_FACE="eth0" <span class="Apple-converted-space">                  </span># NIC connected to the internet</span><br /><span class="s2">WG_FACE="wg0"<span class="Apple-converted-space">                    </span># WG NIC</span><br /><span class="s1">SUB_NET="192.168.12.0/24"<span class="Apple-converted-space">        </span># WG IPv4 sub/net aka CIDR</span><br /><span class="s1">WG_PORT="41194"<span class="Apple-converted-space">                  </span># WG udp port</span><br /><span class="s1">HELIUM_PORT="44158"<span class="Apple-converted-space">              </span># Helium tcp port</span><br /><span class="s1">HELIUM_IP="192.168.12.2" <span class="Apple-converted-space">        </span># Helium VPN client IP address</span><br /><span class="s1">#SUB_NET_6="fd42:42:42:42::/112" # WG IPv6 sub/net</span><br /><br /><span class="s1">## IPv4 ##</span><br /><span class="s6">$IPT</span> <span class="s7">-t nat -I POSTROUTING 1</span> <span class="s7">-s</span> <span class="s6">$SUB_NET</span> <span class="s7">-o</span> <span class="s6">$IN_FACE</span> <span class="s7">-j MASQUERADE</span><br /><span class="s6">$IPT</span> <span class="s7">-I INPUT 1</span> <span class="s7">-i</span> <span class="s6">$WG_FACE</span> <span class="s7">-j ACCEPT</span><br /><span class="s6">$IPT</span> <span class="s7">-I FORWARD 1</span> <span class="s7">-i</span> <span class="s6">$IN_FACE</span> <span class="s7">-o</span> <span class="s6">$WG_FACE</span> <span class="s7">-j ACCEPT</span><br /><span class="s6">$IPT</span> <span class="s7">-I FORWARD 1</span> <span class="s7">-i</span> <span class="s6">$WG_FACE</span> <span class="s7">-o</span> <span class="s6">$IN_FACE</span> <span class="s7">-j ACCEPT</span><br /><span class="s6">$IPT</span> <span class="s7">-I INPUT 1</span> <span class="s7">-i</span> <span class="s6">$IN_FACE</span> <span class="s7">-p udp --dport</span> <span class="s6">$WG_PORT</span> <span class="s7">-j ACCEPT</span><br /><br /># outside the wall you can achieve anything<br /><span class="s1">$IPT</span> <span class="s7">-t nat -A PREROUTING -i</span> <span class="s1">$IN_FACE</span> <span class="s7">-p tcp --dport</span> <span class="s1">$HELIUM_PORT</span> <span class="s7">-j DNAT --to-destination</span> <span class="s1">$HELIUM_IP:$HELIUM_PORT</span><br /><br /><span class="s1">## IPv6 (Uncomment if ipv6 is required) ##</span><br /><span class="s1">## $IPT6 -t nat -I POSTROUTING 1 -s $SUB_NET_6 -o $IN_FACE -j MASQUERADE</span><br /><span class="s1">## $IPT6 -I INPUT 1 -i $WG_FACE -j ACCEPT</span><br /><span class="s1">## $IPT6 -I FORWARD 1 -i $IN_FACE -o $WG_FACE -j ACCEPT</span><br /><span class="s1">## $IPT6 -I FORWARD 1 -i $WG_FACE -o $IN_FACE -j ACCEPT</span></pre>
<pre class="de1"><strong><code><span class="st0">sudo vim </span></code><span class="st0"><code>/etc/wireguard/helper/remove-nat-routing.sh</code></span></strong></pre>
<pre class="p1"><span class="s1">#!/bin/bash</span><br /><span class="s2">IPT="/sbin/iptables"</span><br /><span class="s1">#IPT6="/sbin/ip6tables" <span class="Apple-converted-space">         </span></span><br /><span class="s1">IN_FACE="eth0" <span class="Apple-converted-space">                  </span># NIC connected to the internet</span><br /><span class="s2">WG_FACE="wg0"<span class="Apple-converted-space">                    </span># WG NIC </span><br /><span class="s1">SUB_NET="192.168.12.0/24"<span class="Apple-converted-space">        </span># WG IPv4 sub/net aka CIDR</span><br /><span class="s1">WG_PORT="41194"<span class="Apple-converted-space">                  </span># WG udp port</span><br /><span class="s1">HELIUM_PORT="44158"</span><br /><span class="s2">HELIUM_IP="192.168.12.2"</span><br /><span class="s1">#SUB_NET_6="fd42:42:42:42::/112" # WG IPv6 sub/net<br /></span><br /><span class="s1"># IPv4 rules #</span><br /><span class="s6">$IPT</span> <span class="s7">-t nat -D POSTROUTING -s</span> <span class="s6">$SUB_NET</span> <span class="s7">-o</span> <span class="s6">$IN_FACE</span> <span class="s7">-j MASQUERADE</span><br /><span class="s6">$IPT</span> <span class="s7">-D INPUT -i</span> <span class="s6">$WG_FACE</span> <span class="s7">-j ACCEPT</span><br /><span class="s6">$IPT</span> <span class="s7">-D FORWARD -i</span> <span class="s6">$IN_FACE</span> <span class="s7">-o</span> <span class="s6">$WG_FACE</span> <span class="s7">-j ACCEPT</span><br /><span class="s6">$IPT</span> <span class="s7">-D FORWARD -i</span> <span class="s6">$WG_FACE</span> <span class="s7">-o</span> <span class="s6">$IN_FACE</span> <span class="s7">-j ACCEPT</span><br /><span class="s6">$IPT</span> <span class="s7">-D INPUT -i</span> <span class="s6">$IN_FACE</span> <span class="s7">-p udp --dport</span> <span class="s6">$WG_PORT</span> <span class="s7">-j ACCEPT</span><br /><span class="s1">$IPT</span> <span class="s7">-t nat -D PREROUTING -i</span> <span class="s1">$IN_FACE</span> <span class="s7">-p tcp --dport</span> <span class="s1">$HELIUM_PORT</span> <span class="s7">-j DNAT --to-destination</span> <span class="s1">$HELIUM_IP:$HELIUM_PORT<br /></span><br /><span class="s1"># IPv6 rules (uncomment if ipv6 is required) #</span><br /><span class="s1">## $IPT6 -t nat -D POSTROUTING -s $SUB_NET_6 -o $IN_FACE -j MASQUERADE</span><br /><span class="s1">## $IPT6 -D INPUT -i $WG_FACE -j ACCEPT</span><br /><span class="s1">## $IPT6 -D FORWARD -i $IN_FACE -o $WG_FACE -j ACCEPT</span><br /><span class="s1">## $IPT6 -D FORWARD -i $WG_FACE -o $IN_FACE -j ACCEPT<br /></span></pre>
<pre><code><strong>sudo chmod +x /etc/wireguard/helper/*.sh<br />sudo ufw allow 41194/udp<br /># Allow the helium port to route traffic to wireguard client IP<br /><span class="s1">sudo ufw route allow proto tcp to 192.168.12.2 port 44158</span><br />sudo ufw allow ssh<br />sudo ufw enable</strong><br /><strong>sudo ufw status</strong><br /><strong>sudo systemctl enable wg-quick@wg0</strong><br /><strong>sudo systemctl start wg-quick@wg0<br />sudo systemctl status wg-quick@wg0<br />sudo wg<br /># Make sure you have opened 41194/udp in your cloud provider security group! <br /># Now, we need to update the server to allow relaying traffic<br />sudo vim /etc/sysctl.conf<br /># append the following to the end of that file:</strong></code></pre>
<pre><strong># Wireguard<br />net.ipv4.ip_forward = 1<br />net.ipv6.conf.all.forwarding=1<br /></strong></pre>
<pre><strong><code># reload the /etc/sysctl.conf file:<br />sysctl -p</code></strong></pre>
<h2>Wireguard Client on Panther X1</h2>
<pre><code><strong>sudo apt update<br />sudo apt upgrade<br />reboot<br />sudo apt install wireguard vim fail2ban<br />sudo -i<br />cd /etc/wireguard/<br />umask 077; wg genkey | tee privatekey | wg pubkey &gt; publickey<br />cat privatekey<br />cat publickey<br /># Go back to server /etc/wireguard/wg0.conf, fill in the public key into the [Peer] section<br /># Uncomment peer section, and then run on server: sudo systemctl restart wg-quick@wg0<br /><br /># Set up client on Panther <br /># Replace PrivateKey and PublicKey - pay attention to server vs client<br /># Replace Endpoint with your server's public IP address or DNS<br />sudo vim /etc/wireguard/wg0.conf</strong></code></pre>
<pre>[Interface]<br />## This Desktop/client<span class="st0">'s private key ##</span><br />PrivateKey = <span style="background-color: #ff0000;">REPLACE ME</span><br /><br />## Client ip address ##<br />Address = 192.168.12.2/24<br /><br />[Peer]<br />## Ubuntu 20.04 server public key ##<br />PublicKey = <span style="background-color: #ff0000;">REPLACE ME</span><br /><br />## set ACL ##<br />AllowedIPs = 0.0.0.0/0<br />## Your Ubuntu 20.04 LTS server's external address and port "156.283.123.9:41194" ##<br />Endpoint = <span style="background-color: #ff0000;">REPLACEME</span>:41194<br /><br />## Key connection alive ##<br />PersistentKeepalive = 15<code><strong><br />sudo systemctl enable wg-quick@wg0</strong><br /><strong>sudo systemctl start wg-quick@wg0<br />sudo systemctl status wg-quick@wg0<br />sudo wg<br />sudo vim /lib/systemd/system/wg-quick@.service</strong></code></pre>
<p>Modify the following lines to include network.target:</p>
<pre>After=network-online.target nss-lookup.target <span style="background-color: #ffff00;">network.target</span> <br />Wants=network-online.target nss-lookup.target <span style="background-color: #ffff00;">network.target</span></pre>
<p>Double check everything is working. I also experience occasional drops, so I have a watch script on the client which restarts the wireguard client if we lose connectivity, or starts it upon reboots. Don&#8217;t enable this until you are certain everything is working first. </p>
<p><strong>sudo vim /root/<span class="s1">wireguard_watch.sh</span></strong></p>
<pre>#!/bin/bash<br />/usr/bin/ping -c 1 192.168.12.1 &amp;&gt; /dev/null &amp;&amp; (/usr/bin/logger "INFO: Wireguard alive") || (/usr/bin/logger "ERROR: Wireguard dead, restarting wg-quick@wg0" ; /usr/bin/systemctl restart wg-quick@wg0)</pre>
<pre><code><strong>sudo chmod +x /root/wireguard_watch.sh<br />sudo crontab -e</strong></code></pre>
<pre>You will see an existing line in this file. Ignore it, and leave it alone. Add a new line which contains: <br />* * * * * /root/wireguard_watch.sh &gt; /dev/null</pre>
<p>I also installed the <a href="https://github.com/Panther-X/PantherDashboard">Panther X1 Dashboard</a>:</p>
<pre><strong><code>sudo -i<br />cd /root<br />git clone https://github.com/Panther-X/PantherDashboard.git</code></strong><br /><strong><code>cd PantherDashboard</code></strong><br /><strong><code>sudo sh install.sh</code></strong></pre>
<p>You can now access the dashboard at https://YourInternalPantherIPAddress using admin/admin as the login. </p>
<p>From SSH, you can also explore the setup and troubleshoot the logs:</p>
<pre><strong><code>tail -f /opt/miner_data/logs/console.log</code></strong></pre>
<pre><strong><code>sudo docker exec helium-miner miner info height<br />sudo docker exec helium-miner miner peer listen</code></strong></pre>
<p>We can see the miner info height returns the epoch and block height which you can compare with https://explorer.helium.com. You can use the miner peer listen to see what your IP address is &#8211; it should show your Wireguard external server IP address if successful. You can safely ignore the 172.xxx IP address, as it is just the docker container. </p>
<p>Outside the wall, we can achieve anything. Have fun!</p>
<p>The post <a href="https://benchodroff.com/2022/01/15/helium-blockchain-in-china-using-a-panther-x1-and-wireguard-vpn/">Helium blockchain in China using a Panther X1 and Wireguard VPN</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2022/01/15/helium-blockchain-in-china-using-a-panther-x1-and-wireguard-vpn/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1962</post-id>	</item>
		<item>
		<title>Validating Ethereum2 with Lighthouse in Docker</title>
		<link>https://benchodroff.com/2021/08/23/validating-ethereum2-with-lighthouse-in-docker/</link>
					<comments>https://benchodroff.com/2021/08/23/validating-ethereum2-with-lighthouse-in-docker/#comments</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Mon, 23 Aug 2021 05:15:45 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cryptocurrency]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[ethereum]]></category>
		<category><![CDATA[lighthouse]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[staking]]></category>
		<guid isPermaLink="false">https://www.benchodroff.com/?p=1912</guid>

					<description><![CDATA[<p>Ethereum is shifting from Proof of Work &#8220;mining&#8221; to a Proof of Stake &#8220;staking&#8221; blockchain. This stake requires 32 ETH per validator to validate directly, but there are many custodial pooling services that allows those who have less to still participate with little investment or effort. However, I enjoy participating directly. I learned quite a [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2021/08/23/validating-ethereum2-with-lighthouse-in-docker/">Validating Ethereum2 with Lighthouse in Docker</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Ethereum is shifting from Proof of Work &#8220;mining&#8221; to a Proof of Stake &#8220;staking&#8221; blockchain. This stake requires 32 ETH per validator to validate directly, but there are many custodial pooling services that allows those who have less to still participate with little investment or effort. However, I enjoy participating directly. I learned quite a lot in the process running my <a href="https://www.benchodroff.com/2018/01/31/building-six-gpu-ethereum-mining-rig/">Ethereum GPU mining rig</a> since 2017, and wished to do the same with staking. These are my quick notes how how I set up docker containers on Ubuntu Linux 20.04 LTS for Geth, Lighthouse beacon node, and a Lighthouse validator client. Using this setup, I am yielding about 6.5% APY this year on my ETH. As long as your computer is online more than 50% of the time, you will increase your Ethereum while helping participate in the decentralization that secures the network.</p>



<span id="more-1912"></span>



<p class="wp-block-paragraph">Unlike Ethereum 1.0 which required very expensive and power hungry graphics cards, Ethereum 2.0 uses relatively little hardware and energy. Even a modest modern computer with a reliable internet connection can do the job. The only significant requirement is a NVME SSD if you plan to run an Ethereum 1.0 client, as the I/O requirements are high. I can run the entire Ethereum 1.0 and 2.0 stack on an incredibly efficient Intel NUC 10 i7 computer which consumes only 50 watts, runs silent, and is incredibly tiny. The total build cost was under $1600 in early 2021. This is higher in cost than normal because of the global microchip shortage. I also use a consumer grade UPS battery backup on my router, modem, and computer to ensure reliable operation. While many choose to run their setups on cloud computing, I prefer to keep my validator at home for the fun of it and lower total cost of ownership. As my home is in mainland China, I did check to see whether running any type of cryptocurrency mining (which validating would still qualify as) at home for personal purposes was still allowed &#8211; and they claim there are no laws against it: <a href="http://www.12348.gov.cn/english.html#/english/englishDetail?info_id=cdc1985e-e0cf-4df7-8602-65161f940532" target="_blank" rel="noreferrer noopener">http://www.12348.gov.cn/english.html#/english/englishDetail?info_id=cdc1985e-e0cf-4df7-8602-65161f940532</a>. </p>



<p class="wp-block-paragraph">Assembling an Intel NUC takes only perhaps 30 minutes and is about the simplest computer you could build. I opted for an i7 to hopefully future proof some of the processing requirements. I included 32GB of RAM such that I could reliably run both a mainnet and testnet client simultaneously on the same hardware for testing purposes. You will only need less than 1TB of storage for the geth client, but I opted for 2TB to future proof the growth. My second computer is my old mining rig, but using two machines is not strictly required and arguably creates more complexity than benefits since you can only run a single validator. </p>


<div class="wp-block-image is-style-default">
<figure class="alignright size-full is-resized"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/www.benchodroff.com/wp-content/uploads/2021/08/intelnuc10i7.jpg?w=895" alt="Intel NUC 10 i7" class="wp-image-1913" style="width:250px;height:240px"/></figure>
</div>


<figure class="wp-block-table is-style-stripes"><table><thead><tr><th>Item</th><th>Amount</th><th>Price (RMB)</th><th>Total (RMB)</th></tr></thead><tbody><tr><td>Intel BXNUC10i7FNH i7 NUC</td><td>1</td><td>3899</td><td>3899</td></tr><tr><td>16GB RAM DDR4 2666</td><td>2</td><td>599</td><td>1198</td></tr><tr><td>Intel 480GB SSD S4600</td><td>1</td><td>579</td><td>579</td></tr><tr><td>WD 2TB NVME</td><td>1</td><td>4550</td><td>4550</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>Total (RMB)</td><td>10226</td></tr><tr><td></td><td></td><td>Total (USD)</td><td>$1598</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">I run a high availability configuration involving two physical servers for resiliency. As a validator node, you can only be active on a single machine, or your stake will get penalized severely by the network by being &#8220;slashed&#8221;. However, by using multiple servers, I am able to create redundancy on the Ethereum 1.0 geth client as well as the Ethereum 2.0 Lighthouse beacon node to help my single validator stay online. In addition, I have a third resiliency layer using a free account at <a href="https://infura.io/" target="_blank" rel="noreferrer noopener">https://infura.io</a> which has both Ethereum 1.0 and 2.0 beacon node clients configured as a final fallback option for my validator. Monitoring is performed using <a href="https://beaconcha.in/" target="_blank" rel="noreferrer noopener">https://beaconcha.in</a> as well as a using Telegraf, Influxdb, and Grafana for alerting. While there is a Prometheus monitoring option, I have not yet configured it or found it necessary.</p>



<ul class="wp-block-list">
<li>The Ethereum launchpad has all the resources you need to get started: <a href="https://launchpad.ethereum.org/en/overview" target="_blank" rel="noreferrer noopener">https://launchpad.ethereum.org/en/overview</a></li>



<li>The Lighthouse documentation explains many of the parameters I am using: <a href="https://lighthouse-book.sigmaprime.io/" target="_blank" rel="noreferrer noopener">https://lighthouse-book.sigmaprime.io/</a></li>



<li>I highly recommend joining the Ethstaker discord for questions: <a href="https://discord.gg/UmeDMD9a">https://discord.gg/uN2wyUYutM</a></li>



<li>Lighthouse also has their own discord too for technical help: <a href="https://discord.gg/RPS8GZyx3c ">https://discord.gg/RPS8GZyx3c </a></li>
</ul>



<p class="wp-block-paragraph">This is the gist of my setup. Of course, follow the documentation and more steps should be taken to harden your configuration. </p>



<pre class="wp-block-code"><code># Set up UFW firewall to allow traffic between all servers/docker involved
ufw allow from 192.168.50.13
ufw allow from 192.168.50.16
ufw allow from 172.17.0.0/24
ufw allow 22/tcp
ufw enable</code></pre>



<pre class="wp-block-code"><code># Install Docker on Ubuntu 20.04
apt update
apt install -y docker-ce

# Pull Lighthouse for Ethereum 2.0
docker pull sigp/lighthouse:latest

# Pull geth for Ethereum 1.0 geth client stable
docker pull ethereum/client-go:stable

# Dockupdater is a great way to automatically update docker 
docker pull dockupdater/dockupdater:latest</code></pre>



<p class="wp-block-paragraph">Below are the docker scripts I use with [VARIABLES] redacted to protect my exact configuration. I have set up each docker container to auto restart so that if the computer reboots, it will come back online. Of course, be very careful with your validator. You can only run one validator at a time or you will get slashed. NEVER store your validator keys on more than one host, or it is inevitable you <em>will</em> make a mistake and get slashed. Always keep an encrypted backup of your validator keys offsite. It&#8217;s a lot of ETH to stake. Make sure you test thoroughly all possible scenarios like computer reboots, power outages, geth or beacon node failures, and harden your Linux security.</p>



<p class="wp-block-paragraph">My docker containers are running as root as I could not find an easy way with docker-compose to run as an underprivileged user while automatically updating containers when new releases are made available. As a result, I have sacrificed some security for convenience by using dockupdater to automatically update the docker containers each time a new release is made available. Perhaps someone has a simple and better approach &#8211; please tell me.</p>



<p class="wp-block-paragraph">I would love to learn how to run a slasher. Perhaps that will be a future article! </p>



<pre class="wp-block-code"><code># Set up an Ethereum 1.0 Geth client
docker run --restart=always -d --stop-timeout 300 --name ethereum-node-mainnet -h ethereum-node-mainnet -v /opt/ethereum/mainnet/ethereum-mainnet:/root/.ethereum -p 28545:28545 ethereum/client-go:stable --http --http.addr 0.0.0.0 --http.port 28545 --http.api eth,net --http.corsdomain '*' --ipcdisable --gcmode full --syncmode snap --cache 2048 --metrics --metrics.influxdb --metrics.influxdb.endpoint "https://&#91;INFLUXDBHOST]:8443" --metrics.influxdb.username "&#91;USER]" --metrics.influxdb.password "&#91;INFLUX_PASSWORD]" --metrics.influxdb.database geth --metrics.influxdb.tags host="&#91;INFLUX_HOSTNAME]-mainnet" --txpool.accountslots 32 --txpool.globalslots 8192 --txpool.accountqueue 128 --txpool.globalqueue 2048 --txpool.journal ""

# Create an Ethereum 2.0 Lighthouse Beaconnode
docker run -d --restart=always --stop-timeout 300 --name lighthouse-bn-mainnet -h lighthouse-bn-mainnet -p 29000:9000 -p 25052:5052 -v /opt/ethereum/mainnet/lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet bn --target-peers 120 --staking --http --http-address 0.0.0.0 --metrics --eth1-endpoints http://&#91;HOSTIP_1]:28545,http://&#91;HOSTIP_2]:28545,https://mainnet.infura.io/v3/&#91;INFURA_AUTH] --monitoring-endpoint https://beaconcha.in/api/v1/client/metrics?apikey=&#91;BEACONCHAIN_KEY]&amp;machine=&#91;HOSTNAME]

# Create an Ethereum 2.0 Validator 
# Be careful to only run this on ONE host or you will get slashed
docker run -d --restart=always --stop-timeout 300 --name lighthouse-vc-mainnet -h lighthouse-vc-mainnet -p 25062:5062 -p 25064:5064 -v /opt/ethereum/mainnet/lighthouse:/root/.lighthouse -v /opt/ethereum/mainnet/validator_keys:/root/validator_keys sigp/lighthouse lighthouse --network mainnet vc --enable-doppelganger-protection --metrics --beacon-nodes http://&#91;HOSTIP_1]:25052,http://&#91;HOSTIP_2]:25052,https://&#91;INFURA_AUTH]@eth2-beacon-mainnet.infura.io --http --monitoring-endpoint https://beaconcha.in/api/v1/client/metrics?apikey=&#91;BEACONCHAIN_KEY]&amp;machine=&#91;HOSTNAME]</code></pre>



<p>I welcome any suggestions, questions, or please leave a comment if this helped you. </p>
<p>The post <a href="https://benchodroff.com/2021/08/23/validating-ethereum2-with-lighthouse-in-docker/">Validating Ethereum2 with Lighthouse in Docker</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2021/08/23/validating-ethereum2-with-lighthouse-in-docker/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1912</post-id>	</item>
		<item>
		<title>iPhone Apps for Foreigners Living in China</title>
		<link>https://benchodroff.com/2020/06/27/iphone-apps-for-foreigners-living-in-china/</link>
					<comments>https://benchodroff.com/2020/06/27/iphone-apps-for-foreigners-living-in-china/#respond</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Sat, 27 Jun 2020 06:43:23 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://benchodroff.com/?p=1850</guid>

					<description><![CDATA[<p>Living in China as a foreigner is a rewarding but challenging life. If you are not fluent in speaking and reading Chinese, it can be a real struggle. Thankfully, technology has made it easier. Here are some applications I use daily with my iPhone with a US App Store. Translation Google Translate The best for [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2020/06/27/iphone-apps-for-foreigners-living-in-china/">iPhone Apps for Foreigners Living in China</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Living in China as a foreigner is a rewarding but challenging life. If you are not fluent in speaking and reading Chinese, it can be a real struggle. Thankfully, technology has made it easier. Here are some applications I use daily with my iPhone with a US App Store.</p>



<span id="more-1850"></span>



<h2 class="wp-block-heading">Translation</h2>



<h3><a href="https://apps.apple.com/us/app/google-translate/id414706506" target="_blank" rel="noopener noreferrer">Google Translate</a></h3>
<p>The best for text translation. It supports an offline translation mode if you download the speech files. The key to getting a good English to Chinese translation is to use extremely short but complete sentences, avoid idioms, avoid jokes/sarcasm, and avoid any shorthand sentences. For example, do not translate &#8220;See you soon&#8221; (this common American shorthand incorrectly gets translated to &#8220;Zaijian&#8221; which means &#8220;Goodbye&#8221; ) but instead you should translate &#8220;I will see you soon.&#8221; (translates correctly as it is a correct sentence). The APP does not require a VPN to work, however, you should know that <a href="https://translate.google.com">https://translate.google.com</a> is blocked in China, but <a href="https://translate.google.cn">https://translate.google.cn</a> is allowed.&nbsp;</p>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/ca/app/microsoft-translator/id1018949559" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">Microsoft Translator</a></h3>



<p class="wp-block-paragraph">The best for image translation. The Microsoft Translator app does an amazing job on taking a picture or screenshot, recognizing Chinese characters, and overlaying the original image with an English translation. While Google Translate can also do this, Microsoft wins hands down on this feature. This is especially useful when using Chinese language only applications, such as Taobao, which often do not support copy and pasting the Chinese content or options. You can take a screenshot of the Chinese app on an iPhone by clicking the left and right buttons of your phone simultaneously, then going into Microsoft Translator, and loading the screenshot. While this is a very tedious process, it is extremely useful when you have no better option.</p>



<h2 class="wp-block-heading">Life</h2>



<h2 class="wp-block-heading"><a href="https://apps.apple.com/us/app/wechat/id414478124" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">WeChat</a></h2>



<p class="wp-block-paragraph">WeChat is effectively your entire social life in China. This app supports a very good interface in English. Whether you chat with your friends, pay for a meal out, using local built in WeChat apps, or catching up on friend &#8220;moments&#8221;, you simply cannot survive in China without using WeChat. However, in order to enable WeChat with payments, you must do &#8220;Real Name Verification&#8221; which means you must have a mainland China bank card. Foreign and domestic credit cards can be linked to WeChat but are not capable of performing the Real Name Verification. Sadly, if you are a tourist it is (now) typically not possible to enable WeChat payments because nearly all banks will refuse to open an account for a foreigner without China employment. </p>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/us/app/alipay-simplify-your-life/id333206289" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">Alipay</a></h3>



<p class="wp-block-paragraph">This APP is essential for many business payments and services. I find myself using WeChat more often than Alipay, but some places such as Taobao require Alipay. Overall, I don&#8217;t like Alipay with its sprawling and poorly designed capabilities that rarely support foreigners, but it&#8217;s an essential app. </p>



<h2>Shopping</h2>
<h1 class="product-header__title app-header__title"><a href="https://apps.apple.com/cn/app/%E4%BA%AC%E4%B8%9C-%E4%B8%80%E8%B5%B7%E7%83%AD%E7%88%B1-%E5%B0%B1%E7%8E%B0%E5%9C%A8/id414245413" target="_blank" rel="noopener noreferrer">JingDong &#8220;JD&#8221;</a></h1>
<p>If you are an Amazon-aholic, this is a very similar Chinese only experience. The quality of the items are very high with exceptional service and shipping speeds. You will need to find items that are sold directly by JD or JD logistics to ensure the highest quality and overnight delivery, but even small sellers tend to be more reputable than Taobao sellers. I am big fan and recommend the JD VIP club. I buy everything from 10kg bags of rice, shampoo, clothing, and electronics on here.&nbsp;</p>
<h3><a href="https://apps.apple.com/us/app/%E6%89%8B%E6%9C%BA%E6%B7%98%E5%AE%9D-%E6%B7%98%E5%88%B0%E4%BD%A0%E8%AF%B4%E5%A5%BD/id387682726" target="_blank" rel="noopener noreferrer">Taobao</a></h3>
<p>If it isn&#8217;t sold on Taobao, it probably isn&#8217;t available in China. While I prefer JD over Taobao due to quality and speed, I often shop Taobao if I want the best deal or a hard to find item. They key to being a smart shopper on Taobao is to look at who is selling the item. If it is a T-Mall item (which has its own app also owned by Alibaba), it is likely going to be very high quality. However, there are many individual shops that sell on Taobao. I would recommend checking to see how many items they have sold in the past. If it isn&#8217;t in the thousands, &#8220;buyer beware&#8221;. You want to buy from stores that have one or multiple &#8220;Diamond&#8221; pictures next to their store name which indicates they are a professional store with many previous sales. There are plenty of fakes and poor quality items, but using Taobao is still essential. I tend to buy odd items like a bottle of bourbon, cheap electronics, or even bulk purchases of aged Italian parmesan cheese.&nbsp;</p>



<h2 class="wp-block-heading">Travel</h2>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/us/app/%E7%99%BE%E5%BA%A6%E5%9C%B0%E5%9B%BE-%E8%B7%AF%E7%BA%BF%E8%A7%84%E5%88%92-%E5%87%BA%E8%A1%8C%E5%BF%85%E5%A4%87/id452186370" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">Baidu Maps</a></h3>



<p class="wp-block-paragraph">Baidu search is probably the worse search engine I&#8217;ve had to use but their maps are quite good for finding locations in China for driving, walking, and public transit routes. However, take all their navigation time estimates as flat out wrong in most circumstances.  </p>



<h3><a href="https://apps.apple.com/us/app/didi-greater-china/id554499054" target="_blank" rel="noopener noreferrer">Didi</a></h3>
<p>There is rarely a need to actually drive yourself given how easy and affordable Didi makes it. This is a similar application to Uber, but I&#8217;m very impressed that they their APP has native English support with a built in translations for chats done with the driver. Top tip: if you use the Chinese language, you can enable extra Chinese only features such as &#8220;Sharing a ride&#8221; (saves money when you ride with others) and &#8220;Change the destination&#8221;. Yeah, that&#8217;s right &#8211; if you accidentally need to change the destination while in the English language, you will need to reload the application in Chinese to do so. Good luck.&nbsp;</p>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/us/app/%E9%A3%9E%E7%8C%AA%E5%95%86%E5%AE%B6%E7%89%88/id1104151787">Fliggy</a></h3>



<p class="wp-block-paragraph">My favorite travel logistics service for mainland China. While the interface is slightly more complex than its competitor, Trip.com/CTrip, the benefits are that the prices tends to be cheaper and the integration to booking train tickets does not charge any 20RMB convenience charge &#8211; nice! </p>



<h2 class="wp-block-heading">Food</h2>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/cn/app/%E7%BE%8E%E5%9B%A2-%E5%90%83%E5%96%9D%E7%8E%A9%E4%B9%90-%E5%B0%BD%E5%9C%A8%E7%BE%8E%E5%9B%A2/id423084029" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">Meituan</a></h3>



<p class="wp-block-paragraph">Nearly every restaurant imaginable has food delivery in China. Yes, even a gourmet Beijing Duck or an impressive boiling hotpot dinner can be boxed up and delivered pipping hot within a short amount of time. The application interface is exclusively in English, so I often resort to using a combination of Google Translate and Microsoft Translator with screenshots to navigate this essential application. </p>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/us/app/%E5%A4%A7%E4%BC%97%E7%82%B9%E8%AF%84-%E5%8F%91%E7%8E%B0%E5%93%81%E8%B4%A8%E7%94%9F%E6%B4%BB/id351091731" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">DianPing</a></h3>



<p class="wp-block-paragraph">While related to Meituan, this app focuses on just reviews. This Chinese only app is the best way to search local restaurants, shops, and experience for finding the best of any city. I would compare it as very similar to &#8220;Yelp&#8221; with a hint of &#8220;Trip Advisor&#8221;. As you find your favorite restaurants, you can star the restaurant in the app to build a list of favorite places to recommend to your friends. </p>



<h3 class="wp-block-heading"><a href="https://apps.apple.com/us/app/%E4%BA%AC%E4%B8%9C%E5%88%B0%E5%AE%B6-%E4%B9%B0%E8%8F%9C%E8%B6%85%E5%B8%82%E7%94%9F%E9%B2%9C%E5%A4%96%E5%8D%96%E9%80%81%E8%8D%AF%E5%88%B0%E5%AE%B6/id954995415" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">JD Food Delivery</a></h3>



<p class="wp-block-paragraph">From foreigner supermarkets stocked with french Cheese, to your local wetmarket with 0.1RMB eggs, JD Delivery is the best grocery store delivery app. Each store charges a small (usually 6RMB) delivery fee, so it&#8217;s best to think of what you need to buy and group your order into a single stores purchase. As a foreigner, this makes purchasing groceries from wetmarkets so much easier because you can easily compare prices and search for exactly what you want. Deliveries are often done in less than an hour. </p>



<h2>VPN</h2>
<h3><a href="https://apps.apple.com/us/app/shadowrocket/id932747118" target="_blank" rel="noopener noreferrer">Shadowrocket</a></h3>
<p>If you a foreigner it&#8217;s quite likely you are going to need a VPN to survive in China. Using a VPN inside China is perfectly legal (but you can&#8217;t sell VPN without the right licenses). Shadowrocket supports both Shadowsocks (SSR) and v2Ray &#8212; two of the most effective VPN technologies for jumping the Great Firewall. While this application does cost money, I view the features over the free alternatives as &#8220;worth it.&#8221; If you require a pretty good free version, check out <a href="https://apps.apple.com/us/app/potatso-2/id1162704202">Potatso2</a>. This application does not provide the VPN service. For that, you can see my other blog post on <a href="https://benchodroff.com/2020/06/26/selecting-a-vpn-for-china/">how to pick a good commercial VPN provider for China</a>. </p>
<p> </p>
<p>The post <a href="https://benchodroff.com/2020/06/27/iphone-apps-for-foreigners-living-in-china/">iPhone Apps for Foreigners Living in China</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2020/06/27/iphone-apps-for-foreigners-living-in-china/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1850</post-id>	</item>
		<item>
		<title>Selecting a VPN for China</title>
		<link>https://benchodroff.com/2020/06/26/selecting-a-vpn-for-china/</link>
					<comments>https://benchodroff.com/2020/06/26/selecting-a-vpn-for-china/#respond</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Fri, 26 Jun 2020 16:20:37 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://benchodroff.com/?p=1835</guid>

					<description><![CDATA[<p>Selecting a VPN for China is not as simple as it used to be. Basic VPN solutions from the west won&#8217;t cut it and most don&#8217;t even work. Running your own VPN node such as Shadowsocks (SSR) or V2ray often can&#8217;t achieve 100Mbps+. Since late 2018, ensuring a self-hosted node stays reliable can be a [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2020/06/26/selecting-a-vpn-for-china/">Selecting a VPN for China</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Selecting a VPN for China is <a href="https://benchodroff.com/2018/01/31/shadowsocks-docker-bypassing-chinas-great-firewall/">not as simple as it used to be</a>. Basic VPN solutions from the west won&#8217;t cut it and most don&#8217;t even work. Running your own VPN node such as Shadowsocks (SSR) or V2ray often can&#8217;t achieve 100Mbps+. Since late 2018, ensuring a self-hosted node stays reliable can be a full time job of outrunning detection by the Great Firewall (GFW) which employs an army of censors and increasing artificial intelligence recognition. </p>



<span id="more-1835"></span>



<p class="wp-block-paragraph">While I could say what I use today (<a aria-label="undefined (opens in a new tab)" href="http://nexitallysafe.com" target="_blank" rel="noreferrer noopener">nexitallysafe.com</a>, <a aria-label="undefined (opens in a new tab)" href="http://wannaflix.com" target="_blank" rel="noreferrer noopener">wannaflix.com</a>, and two backup v2ray servers in Aliyun and AWS using CloudFlare relaying websockets) these will likely all be dead soon enough. I&#8217;m going to teach you to fish and point you to the self proclaimed non-experts at <a href="http://duyaoss.com">duyaoss.com</a> which regularly review the best providers and provide detailed technical analysis. Use Google Chrome to translate the site if you can&#8217;t read Chinese.</p>



<div class="wp-block-image"><figure class="aligncenter size-medium"><img data-recalc-dims="1" decoding="async" width="287" height="300" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2020/06/image-1.png?resize=287%2C300&#038;ssl=1" alt="" class="wp-image-1845"/><figcaption>2020/06/27 &#8211; Shanghai to Hong Kong, using Nexitally and China Telecom</figcaption></figure></div>



<h2 class="wp-block-heading">Commercial Review</h2>



<p style="text-align: left;">Not all internet service providers (ISP) will have the same performance with each VPN provider. The first way to getting reliable VPN speed is to use the right ISP where possible. For the best performance and least restrictions, I recommend China Unicom (few users) or China Telecom (very good). China Mobile should be avoided as their IPLC connection is terrible and they have too many users, but with the right VPN you can make the most of it. Let&#8217;s cut to the chase and see the reviews:</p>
<p><a href="https://www.duyaoss.com/archives/3/">VPN Testing Results using China Unicom (and intro &#8211; read this first!)</a></p>
<p><a href="https://www.duyaoss.com/archives/1/">VPN Testing Results using China Telecom</a></p>
<p><a href="https://www.duyaoss.com/archives/1031/">VPN Testing Results using China Mobile</a></p>



<h2 class="wp-block-heading">Run Your Own v2Ray</h2>



<p class="wp-block-paragraph">Running your own v2ray server outside China for use in China will never be as fast as the best commercial providers because you cannot buy a <a href="https://www.duyaoss.com/archives/2741/">relay node</a> unless you happen to be mainland Chinese citizen, have a legitimate Commercial Business license (hard), and can obtain an Internet Data Center license (IDC) in China (impossible).</p>



<p class="wp-block-paragraph">However, if you require a VPN which works even during a crackdown or want to have online privacy, I recommend running your own private v2ray servers and only using them in an emergency. How to setup a v2ray VPN is quite an advanced topic and you should use Google for better guides. However, you can see my v2ray configuration script here if it helps you: <a href="https://github.com/benjaminchodroff/v2ray-connect/">https://github.com/benjaminchodroff/v2ray-connect/</a></p>



<p class="wp-block-paragraph">I highly recommend setting up v2ray with WebSockets and relaying it through CloudFlare for free. This ensures that even if your server gets banned, you can still access it via a CloudFlare relay which, while capped to &lt;50Mbps, it is impossible for China to ban without China blocking much of the web. <a href="https://www.duyaoss.com/archives/57/">I recommend reading this for analysis of cloud providers that are commonly used</a> for hosting VPN nodes for use with users in China. </p>


<p>The post <a href="https://benchodroff.com/2020/06/26/selecting-a-vpn-for-china/">Selecting a VPN for China</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2020/06/26/selecting-a-vpn-for-china/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1835</post-id>	</item>
		<item>
		<title>Building a six GPU Ethereum Mining Rig</title>
		<link>https://benchodroff.com/2018/01/31/building-six-gpu-ethereum-mining-rig/</link>
					<comments>https://benchodroff.com/2018/01/31/building-six-gpu-ethereum-mining-rig/#respond</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Wed, 31 Jan 2018 10:05:39 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blockchain]]></category>
		<category><![CDATA[cryptocurrency]]></category>
		<category><![CDATA[ethereum]]></category>
		<category><![CDATA[mining]]></category>
		<category><![CDATA[proof of work]]></category>
		<guid isPermaLink="false">https://benchodroff.com/?p=315</guid>

					<description><![CDATA[<p>I have been working with blockchains since 2013 but always wanted to know more about how the mining process worked. Last year, I fell in love with Ethereum and was excited to learn the project uses a GPU friendly algorithm. I convinced my wife to allow me to spend some money to build a GPU [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2018/01/31/building-six-gpu-ethereum-mining-rig/">Building a six GPU Ethereum Mining Rig</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have been working with blockchains since 2013 but always wanted to know more about how the mining process worked. Last year, I fell in love with Ethereum and was excited to learn the project uses a GPU friendly algorithm. I convinced my wife to allow me to spend some money to build a GPU mining rig. At the time I built the rig, I calculated it would take over a year to break even in mining Ethereum. Luckily, the Ethereum project has taken off in a big way. The rig paid for itself in a few months, and continues to deliver. I had a lot of fun building the rig and learned a lot about how Ethereum works in the process. My rig does about 160 million hashes a second and dual mines Ethereum and Decred. Here are some details on the setup.<br />
<span id="more-315"></span></p>
<p><figure id="attachment_412" aria-describedby="caption-attachment-412" style="width: 640px" class="wp-caption aligncenter"><img data-recalc-dims="1" decoding="async" class="size-large wp-image-412" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/miningrig.jpg?resize=640%2C480&#038;ssl=1" alt="Mining Rig" width="640" height="480" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/miningrig.jpg?resize=1024%2C768&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/miningrig.jpg?resize=300%2C225&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/miningrig.jpg?resize=768%2C576&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/miningrig.jpg?w=1790&amp;ssl=1 1790w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/miningrig.jpg?w=2685&amp;ssl=1 2685w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption id="caption-attachment-412" class="wp-caption-text">6 GPUs ~160MH/s</figcaption></figure></p>
<p>My build was determined based on the lack of availability of GPU&#8217;s. I did not want to mix and match AMD and NVIDIA cards, but sadly this was the only available option. It would be much easier if I had six of the same GPU&#8217;s. If you are struggling to find a GPU I would recommend using the website <a href="http://nowinstock.com">nowinstock.com</a> and sign up to their google group.</p>
<p><iframe loading="lazy" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQNE81J1aOcaLKlNI5yTXNzoAsFzcdJ7y_sdG0Hz8-SPLRf5tae5WBbQWVDha8zJ2TRhcBi_dL0xfc4/pubhtml?gid=0&amp;single=true&amp;widget=true&amp;headers=false" width="100%" height="375px"></iframe></p>
<p>I used Ubuntu 16 LTS as the operating system. I started by using Etcher on my Mac to load the Ubuntu installation media on a USB stick. Once booted up, I installed Ubuntu on the SSD hard drive with no GPU&#8217;s running. While I could have used a USB stick as the main storage, I planned on needing the extra hard drive space for some other blockchain projects.</p>
<p>The biggest challenge was the motherboard. The MSI Z170A is notoriously a pain to work with and mine was no exception. Unfortunately, it was the only motherboard in stock that could support six GPUs. I updated the firmware on the motherboard bios because the included bios would not support six GPUs. I would strongly recommend using the integrated graphics and avoid connecting any GPUs or PCIe risers until your operating system is fully installed and ready to go. After the OS was loaded, I began the process of setting up the Ethereum mining software with a single GPU connected directly in the primary PCIe slot with no riser. I tried many versions of ethereum for mining but ultimately have settled on using Genfoil&#8217;s dual ethereum miner. You can find the download link and more discussion than you can ever read over here:<br />
<a href="https://bitcointalk.org/index.php?topic=1433925.0">https://bitcointalk.org/index.php?topic=1433925.0</a></p>
<p>Once you have a basic single GPU mining rig working, keep adding one card and riser at a time. It is important to monitor the performance of the mining speeds each time you add a GPU to ensure it is running correctly. After four GPUs, I had to adjust the settings of my motherboard to set an advanced settings &#8220;Above 4G Decoding &#8211; Enabled&#8221;. I did not end up using Gen1 for PEG0 or PEG1 &#8211; I left these set at auto. Setting it to Gen1, as other guides recommended worked, but would result in a ~50% loss in mining performance. Here is an example of the other guide:<br />
<a href="https://forum.z.cash/t/msi-z170-7-gpu-bios-setting-step-by-step/14473">https://forum.z.cash/t/msi-z170-7-gpu-bios-setting-step-by-step/14473</a></p>
<p>You will want to join a mining pool because ethereum is not profitable to solo mine. My personal favorite has been using <a href="http://nanopool.com">nanopool.com</a>, although I tried many others too. You will need to create an ethereum wallet, save the private key in a safe place, and use the public key as your wallet address. I highly recommend using <a href="http://myetherwallet.com">myetherwallet.com</a> for storing your ETH safely.</p>
<p><figure id="attachment_401" aria-describedby="caption-attachment-401" style="width: 640px" class="wp-caption aligncenter"><img data-recalc-dims="1" decoding="async" class="size-large wp-image-401" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/nanopool.png?resize=640%2C455&#038;ssl=1" alt="Nanopool" width="640" height="455" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/nanopool.png?resize=1024%2C728&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/nanopool.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/nanopool.png?resize=768%2C546&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/nanopool.png?w=1156&amp;ssl=1 1156w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption id="caption-attachment-401" class="wp-caption-text">Nanopool</figcaption></figure></p>
<p>I have dual mined SIACoin in the past but currently am dual mining Decred. You may want to check out the website <a href="http://whattomine.com">whattomine.com</a> to decide what coins you wish to mine based on the expected profitability.</p>
<p>It is very easy to spend a lot of time tuning and it is far too time consuming to explain all the options available, but I am happy to share my current settings:</p>
<p>My claymore startup script looks like this:<br />
<code><br />
export GPU_MAX_HEAP_SIZE=100<br />
export GPU_USE_SYNC_OBJECTS=1<br />
export GPU_MAX_ALLOC_PERCENT=100<br />
export GPU_SINGLE_ALLOC_PERCENT=100<br />
/opt/claymore10.6/ethdcrminer64 -tstop 90 -allpools 1 -mode 0 -r 1 -mpsw dummydummy -epool eth-us-east1.nanopool.org:9999 -ewal $ETH/$NAME/$EMAIL -epsw x -dpool dcr.suprnova.cc:3252 -dwal $NAME -dpsw $PASSWORD -ftime 10 &gt; /dev/null 2&gt;&amp;1 &amp;<br />
</code></p>
<p>I use the following script to tune my AMD and NVIDIA cards prior to launching:<br />
<code><br />
#!/bin/bash<br />
sudo su -c 'nvidia-smi -pm 1'<br />
# Set power limit to 200 watts per card<br />
sudo su -c 'nvidia-smi -pl 200'<br />
# Unrestrict all GPUs<br />
sudo su -c 'nvidia-smi -acp UNRESTRICTED'<br />
timeout 10 sudo su -c '/usr/sbin/gpucontrol 100 0 1210 0 &gt;&gt; /var/log/gpucontrol.log 2&gt;&amp;1'<br />
timeout 10 sudo su -c '/usr/sbin/gpucontrol 100 0 100 1 &gt;&gt; /var/log/gpucontrol.log 2&gt;&amp;1'<br />
timeout 10 sudo su -c '/usr/sbin/gpucontrol 100 0 100 2 &gt;&gt; /var/log/gpucontrol.log 2&gt;&amp;1'<br />
timeout 10 sudo su -c '/usr/sbin/gpucontrol 100 0 1210 3 &gt;&gt; /var/log/gpucontrol.log 2&gt;&amp;1'<br />
for i in `ls /sys/class/drm/card*/device/hwmon/hwmon*/pwm1`;do<br />
timeout 10 sudo su -c "echo 255 &gt; $i";<br />
done<br />
for i in `ls /sys/class/drm/card*/device/power_dpm_force_performance_level`; do<br />
timeout 10 sudo su -c "echo high &gt; $i";<br />
done</code></p>
<p>As you can see, this script is calling a &#8220;gpucontrol script&#8221;:<br />
<code>#!/bin/bash<br />
PERCENT=$1<br />
GRAPHICS=$2<br />
MEMORY=$3<br />
CARD=$4<br />
cp -f /home/benjaminchodroff/.Xauthority /root/<br />
if [ -z "$CARD" ];<br />
then<br />
NUMGPU="$(nvidia-smi -L | wc -l)";<br />
echo "Setting up ${NUMGPU} GPU(s)";<br />
n=0;<br />
while [ $n -lt $NUMGPU ];<br />
do<br />
DISPLAY=:0 nvidia-settings -a [gpu:${n}]/GPUFanControlState=1 -a [fan:${n}]/GPUTargetFanSpeed=$1 -a [gpu:${n}]/GPUPowerMizerMode=1 -a [gpu:${n}]/GPUMemoryTransferRateOffset[3]=$3 -a [gpu:${n}]/GPUGraphicsClockOffset[3]=$2;<br />
let n=n+1;<br />
done<br />
else<br />
n=$CARD;<br />
DISPLAY=:0 nvidia-settings -a [gpu:${n}]/GPUFanControlState=1 -a [fan:${n}]/GPUTargetFanSpeed=$1 -a [gpu:${n}]/GPUPowerMizerMode=1 -a [gpu:${n}]/GPUMemoryTransferRateOffset[3]=$3 -a [gpu:${n}]/GPUGraphicsClockOffset[3]=$2<br />
fi<br />
</code><br />
There are so many helpful guides that I read &#8211; more than I can ever remember. The following links may help so I&#8217;m providing them here:</p>
<p><a href="https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07">https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07</a><br />
<a href="https://www.meebey.net/posts/ethereum_gpu_mining_on_linux_howto/">https://www.meebey.net/posts/ethereum_gpu_mining_on_linux_howto/</a><br />
<a href="https://askubuntu.com/questions/902636/nvidia-smi-command-not-found-ubuntu-16-04">https://askubuntu.com/questions/902636/nvidia-smi-command-not-found-ubuntu-16-04</a><br />
<a href="https://askubuntu.com/questions/761136/ubuntu-16-04-nvidia-drivers-dont-work">https://askubuntu.com/questions/761136/ubuntu-16-04-nvidia-drivers-dont-work</a><br />
<a href="http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Install.aspx">http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Install.aspx</a></p>
<p>My rig is nothing fancy and certainly not bulletproof, but it allowed me to better understand blockchain mining for proof of work while making a few extra dollars.</p>
<p>The post <a href="https://benchodroff.com/2018/01/31/building-six-gpu-ethereum-mining-rig/">Building a six GPU Ethereum Mining Rig</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2018/01/31/building-six-gpu-ethereum-mining-rig/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">315</post-id>	</item>
		<item>
		<title>Shadowsocks in Docker for bypassing China&#8217;s Great Firewall</title>
		<link>https://benchodroff.com/2018/01/31/shadowsocks-docker-bypassing-chinas-great-firewall/</link>
					<comments>https://benchodroff.com/2018/01/31/shadowsocks-docker-bypassing-chinas-great-firewall/#comments</comments>
		
		<dc:creator><![CDATA[Benjamin Chodroff]]></dc:creator>
		<pubDate>Wed, 31 Jan 2018 08:49:08 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://benchodroff.com/?p=360</guid>

					<description><![CDATA[<p>If you have travelled in China, you likely know that many websites such as Google, Facebook, and Twitter are blocked on most internet connections. Typically I have purchased a VPN service to access blocked sites. Unfortunately, many VPN services are being detected and blocked by China&#8217;s &#8220;Great Firewall.” The best solution I have found is [&#8230;]</p>
<p>The post <a href="https://benchodroff.com/2018/01/31/shadowsocks-docker-bypassing-chinas-great-firewall/">Shadowsocks in Docker for bypassing China&#8217;s Great Firewall</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you have travelled in China, you likely know that many websites such as Google, Facebook, and Twitter are blocked on most internet connections. Typically I have purchased a VPN service to access blocked sites. Unfortunately, many VPN services are being detected and blocked by China&#8217;s &#8220;Great Firewall.” The best solution I have found is either to purchase a premium VPN solution, such as ExpressVPN which is specifically designed to work in China, or to use an open source solution called Shadowsocks hosted on a remote server. This tutorial provides a detailed setup of how to run Shadowsocks in a docker container deployed on a Synology NAS.</p>
<p><span id="more-360"></span>You could rent a cloud server from Digital Ocean or AWS, but because I already own a Synology NAS at home I decided to use it instead. If you own a Synology NAS, you may not be aware that it can run docker containers. Docker will allow you to tap into a repository community of images that have already been prebuilt for a wide variety of applications including Shadowsocks. I already loved my Synology NAS, but once I started using docker it became indispensable.</p>
<h2><strong>Synology NAS Configuration</strong></h2>
<p>If you have not installed Docker on your Synology NAS before you simply need to go into the Synology Package Center on the device, search for &#8220;Docker&#8221;, and click to install it.</p>
<p><figure id="attachment_364" aria-describedby="caption-attachment-364" style="width: 640px" class="wp-caption aligncenter"><img data-recalc-dims="1" decoding="async" class="wp-image-364 size-large" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_install.png?resize=640%2C128&#038;ssl=1" alt="Synology Docker Install" width="640" height="128" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_install.png?resize=1024%2C204&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_install.png?resize=300%2C60&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_install.png?resize=768%2C153&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_install.png?w=1790&amp;ssl=1 1790w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption id="caption-attachment-364" class="wp-caption-text">Synology Docker Install</figcaption></figure></p>
<p>Now you can open the Docker service on the Synology NAS and go to “Registry” to search for “shadowsocks.” The first result will be “mritd/shadowsocks.&#8221; Select this image, click Download, and when prompted download the latest.</p>
<p><figure id="attachment_365" aria-describedby="caption-attachment-365" style="width: 640px" class="wp-caption aligncenter"><img data-recalc-dims="1" decoding="async" class="wp-image-365 size-large" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_registrysearch.png?resize=640%2C264&#038;ssl=1" alt="Docker Registry Shadowsocks Search" width="640" height="264" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_registrysearch.png?resize=1024%2C423&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_registrysearch.png?resize=300%2C124&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_registrysearch.png?resize=768%2C318&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/docker_registrysearch.png?w=1790&amp;ssl=1 1790w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption id="caption-attachment-365" class="wp-caption-text">Docker Registry Shadowsocks Search</figcaption></figure></p>
<p>Once downloaded, you can deploy this image by going into the &#8220;Image&#8221; section, selecting the shadowsocks image, and clicking &#8220;Launch.&#8221; Set the following options in &#8220;Advanced Properties&#8221;:</p>
<ul>
<li>Enable auto-restart</li>
<li>Under &#8220;port settings&#8221;, create a port mapping the local port 6500 to the docker port 6500 for UDP traffic</li>
<li>Under &#8220;port settings&#8221;, create a port mapping the local port 6443 to the docker port 6443 for TCP traffic</li>
<li>Under &#8220;environment&#8221;, create or modify the following environment variables:
<ul>
<li>SS_MODULE: ss-server</li>
<li>KCP_FLAG: true</li>
<li>KCP_CONFIG: -t 127.0.0.1:6443 -l :6500</li>
<li>KCP_MODULE: kcpserver</li>
<li>SS_CONFIG: -s 0.0.0.0 -p 6443 -m aes-256-cfb -k test123</li>
</ul>
</li>
</ul>
<p><figure id="attachment_366" aria-describedby="caption-attachment-366" style="width: 640px" class="wp-caption aligncenter"><img data-recalc-dims="1" decoding="async" class="wp-image-366 size-large" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_ports_docker.png?resize=640%2C181&#038;ssl=1" alt="Shadowsocks Docker Ports" width="640" height="181" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_ports_docker.png?resize=1024%2C289&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_ports_docker.png?resize=300%2C85&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_ports_docker.png?resize=768%2C217&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_ports_docker.png?w=1260&amp;ssl=1 1260w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption id="caption-attachment-366" class="wp-caption-text">Shadowsocks Docker Ports</figcaption></figure></p>
<p><figure id="attachment_367" aria-describedby="caption-attachment-367" style="width: 640px" class="wp-caption aligncenter"><img data-recalc-dims="1" decoding="async" class="wp-image-367 size-large" src="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_environment_docker.png?resize=640%2C328&#038;ssl=1" alt="Shadowsocks Docker Environment" width="640" height="328" srcset="https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_environment_docker.png?resize=1024%2C524&amp;ssl=1 1024w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_environment_docker.png?resize=300%2C154&amp;ssl=1 300w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_environment_docker.png?resize=768%2C393&amp;ssl=1 768w, https://i0.wp.com/benchodroff.com/wp-content/uploads/2018/01/shadowsocks_environment_docker.png?w=1774&amp;ssl=1 1774w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption id="caption-attachment-367" class="wp-caption-text">Shadowsocks Docker Environment</figcaption></figure></p>
<p>These properties specify that we want to run shadowsocks in server mode &#8220;ss-server&#8221;. We are enabling the optional KCP tuning for UDP relay support running on TCP port 6443 and UDP port 6500 using the kcpserver module. We are starting shadowsocks to listen on all available ip addresses 0.0.0.0 for 6443/TCP with aes-256-cfb encryption and a password of &#8220;test123&#8221; (pick a better password). It is important to know that a single shadowsocks tcp/udp port combination can support as many simultaneous devices as you wish, but everyone who knows the password can connect to your home internet. Be careful who you share your password with!</p>
<p>Save, and start the image.</p>
<p>You will need to ensure your home router allows port forwarding for both the 6500/UDP and 6443/TCP port to the local IP address of your Synology NAS. If you have enabled a firewall on your Synology NAS under the Control Panel Security, you may also need to open these ports on the Synology too. Additionally, you will likely want to set up a dynamic DNS hostname service either on your home router or, better yet, use the built in dynamic DNS hostname mapping feature of the Synology NAS found in Control Panel, &#8220;External Access &#8211; DDNS&#8221;.</p>
<p>Now you need to configure your browser clients. I will provide examples for iOS and macOS, but clients for Linux and Windows also exist.</p>
<h2><strong>iOS Configuration</strong></h2>
<p>I use the &#8220;Potatso Lite&#8221; application for my iPhone iOS which you can find for free in the App Store. Once installed, add a server with the following information:</p>
<ul>
<li>Type: shadowsocks</li>
<li>Host: [the dynamic DNS hostname of your NAS]</li>
<li>Port: 6443</li>
<li>Password: test123 (or the password you set)</li>
<li>Encryption: aes-256-cfb</li>
<li>Remark: (leave blank)</li>
</ul>
<p>In advanced, enable “Forward UDP” &#8211; it turbocharges the performance using kcpserver.<br />
In the general settings, I recommend using the &#8220;smart routing&#8221; feature because it significantly improves performance (although at a tradeoff of allowing China to see local country traffic).</p>
<h2><strong>macOS Configuration</strong></h2>
<p>For my Mac laptop I use shadowsocksR which you can download for free here:<br />
<a href="https://github.com/qinyuhang/ShadowsocksX-NG-R/releases">https://github.com/qinyuhang/ShadowsocksX-NG-R/releases</a></p>
<p>This is a special China version of ShadowsocksR which is enhanced specifically for the great firewall. Once installed and running, it will automatically set up your Mac to have a proxy server which you can populate with your Synology NAS shadowsocks server. Add a server by navigating to &#8220;Server Preferences&#8221; and add the following details:</p>
<ul>
<li>Address: [the dynamic DNS hostname of your NAS]</li>
<li>Port: 6443</li>
<li>Password: test123 (or the password you set)</li>
<li>Encryption: aes-256-cfb</li>
<li>Remark: (leave blank)</li>
<li>Leave the rest of the settings unchanged</li>
</ul>
<p>Then add the following properties in the ShadowsocksR menu:</p>
<ul>
<li>&#8220;Auto Mode by PAC&#8221;</li>
<li>In &#8220;Advanced Preferences&#8221;, check the &#8220;Enable the Udp relay&#8221; feature for enhanced performance using kcpserver.</li>
</ul>
<p>How does this all work? Your browser is now configured to connect to a local proxy server (your shadowsocks client) which then connects to the shadowsocks server running in the docker container, which then relays the traffic to the destination. The shadowsocks server then sends the response back to your shadowsocks client using UDP and TCP, which your browser then receives via a standard proxy connection.</p>
<p>The solution is quite magical. The performance is vastly superior all the commercial VPN solutions I used. I can stream YouTube, post large photos to Instagram, and do just about anything as if I was at home.</p>
<p>The post <a href="https://benchodroff.com/2018/01/31/shadowsocks-docker-bypassing-chinas-great-firewall/">Shadowsocks in Docker for bypassing China&#8217;s Great Firewall</a> appeared first on <a href="https://benchodroff.com">benchodroff.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://benchodroff.com/2018/01/31/shadowsocks-docker-bypassing-chinas-great-firewall/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">360</post-id>	</item>
	</channel>
</rss>
