Swarm

SWARM .ETH 幫助

  • July 20, 2018

我得到了 3dhdwallpapers.eth 名稱並將內容解析設置為群體雜湊 4197442eceb1c1d4a0c7af21e17cb48e990a07ba2d6f72d7e9c09efd172279cc

我執行命令

publicResolver.setContent(namehash(‘3dhdwallpapers.eth’),‘0x4197442eceb1c1d4a0c7af21e17cb48e990a07ba2d6f72d7e9c09efd172279cc’,{來自:eth.accounts

$$ 0 $$, 氣體: 100000}); 現在在 etherscan 中 txn 很好 https://etherscan.io/tx/0x50f225487cc5cd1d34ecbf07eba83f64af8604d12b7c9db4914ed016ef10bcdb

當我檢查http://swarm-gateways.net/bzz:/3dhdwallpapers.eth/時出現錯誤 - 解析 3dhdwallpapers.eth 時出錯:‘3dhdwallpapers.eth’ 不是內容雜湊

為什麼0x4197442eceb1c1d4a0c7af21e17cb48e990a07ba2d6f72d7e9c09efd172279cc不是一個內容的時候,我可以看到在散列數據http://swarm-gateways.net/bzz:/4197442eceb1c1d4a0c7af21e17cb48e990a07ba2d6f72d7e9c09efd172279cc/

但 getContent(‘3dhdwallpapers.eth’) 給出“0x4197442eceb1c1d4a0c7af21e17cb48e990a07ba2d6f72d7e9c09efd172279cc”

那是 0x 給出問題嗎?但根據 http://swarm-guide.readthedocs.io/en/latest/usage.html我需要添加 0x 和雜湊。請幫忙。

                      • 更新 - - - - - - - - - - - -

好的,如果 swam 網關執行測試節點。我在我的主網上執行 swarm

新的有 9af7f4a3d9548f37b0c6e391fa8b1e23a6895e31d2eecc60c88dfd67a8c3eef4

它打開為http://80.241.221.232:8500/bzz:/9af7f4a3d9548f37b0c6e391fa8b1e23a6895e31d2eecc60c88dfd67a8c3eef4/

文件和我使用 publicResolver.setContent(namehash(‘3dhdwallpapers.eth’), ‘0x9af7f4a3d9548f37b0c6e391fa8b1e23a6895e31d2eecc60c88dfd67a8c3eef4’, {來自:eth.accounts

$$ 0 $$, 氣體: 100000}) txn 直通 - https://etherscan.io/tx/0xac2f357f5d5a78ceaec407da4fe51db33f31ec21c62d35d938c9e4c193c40c90

getContent(‘3dhdwallpapers.eth’) 給出正確的雜湊“0x9af7f4a3d9548f37b0c6e391fa8b1e23a6895e31d2eecc60c88dfd67a8c3eef4”

http://80.241.221.232:8500/bzz:/3dhdwallpapers.eth/中仍然出現錯誤, 因為“解析 3dhdwallpapers.eth 時出錯:給定地址沒有合約程式碼”

非常感謝這裡的任何幫助..

什麼工作正常?

當您第一次嘗試時,Swarm 尚未與主網上的 ENS 集成。現在,並且正確地查找最近發布的內容雜湊:0x9af7f4a3d9548f37b0c6e391fa8b1e23a6895e31d2eecc60c88dfd67a8c3eef4

http://swarm-gateways.net/bzz:/3dhdwallpapers.eth的網關正確地查找 ENS 名稱的雜湊,並使用該雜湊傳遞內容。

那麼為什麼我訪問連結時頁面是空白的?

如果您在頁面上查看原始碼,您將看到您上傳的索引 HTML 頁面的內容。該頁面正在嘗試並未能載入其他幾個腳本。

如何使我的 html 可以訪問其他文件?

遞歸上傳文件目錄。它應該包含您的 HTML 頁面,以及您想要的任何其他 JavaScript、CSS 等資產。上傳看起來像:

$ swarm --recursive --defaultpath wallpaper-root/index.html --bzzapi http://swarm-gateways.net/ up wallpaper-root/ 2> up.log
0x24691fdc32b6feb77babdd1d78d822a030198a5163edc9214e219a6666c544a7

這會創建一個清單,Swarm 使用它來查找您網站上文件的路徑。Swarm 將為您提供該清單的新雜湊,您可以將您的 ENS 名稱設置為指向它。

現在 Swarm 在主網上與 ENS 集成,http://swarm-gateways.net/bzz : /3dhdwallpapers.eth工作正常。

引用自:https://ethereum.stackexchange.com/questions/18292