public static function postSocialRecord(SocialRecord $sr, $personalPrivateKey)
	{
		if(!$sr->verify())
			throw new \Exception("Error: Invalid Social Record");
		
		// create and sign JWT
		$signer = new Sha512();
		
		$personalPrivateKey = PrivateKey::formatPEM($personalPrivateKey);
		
		$token = (new Builder())
			->set('socialRecord', base64_encode($sr->getJSONString()))
			->sign($signer, $personalPrivateKey)
			->getToken();
		
		$ch = curl_init(Configuration::getPrimaryGSLSNode());
		if(Configuration::getCurlVerbose() >= 2) curl_setopt($ch, CURLOPT_VERBOSE, 1);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_TIMEOUT, Configuration::getGSLSTimeout());
		curl_setopt($ch, CURLOPT_HTTPHEADER, array(	'Content-type: application/json', 
													'Content-Length: ' . strlen((string) $token)));
		curl_setopt($ch, CURLOPT_POSTFIELDS, (string) $token);
		
		$result = curl_exec($ch);
		
		if(curl_errno($ch) != CURLE_OK)
		{
			$ch = curl_init(Configuration::getSecondaryGSLSNode());
			if(Configuration::getCurlVerbose() >= 2) curl_setopt($ch, CURLOPT_VERBOSE, 1);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_HTTPGET, 1);
			$result = curl_exec($ch);
			
			if(curl_errno($ch) != CURLE_OK)
			{
				throw new \Exception('Connection error: ' . curl_error($ch));
			}
		}
		
		$result = json_decode($result);
		curl_close($ch);
		
		if($result->responseCode != 200)
		{
			throw new \Exception("Error: " . $result->message);
		}
		else
		{
			return $result;
		}
	}