架設AURORA採坑心得 - 數位貨幣

By Daniel
at 2022-01-31T01:05
at 2022-01-31T01:05
Table of Contents
我又來分享架設RPC了,這次介紹的是NEAR上的EVM相容鍊AURORA。
之前在群組有人介紹不用Fee覺得很神奇才衝進去的,一邊質押一邊觀察上面的Defi。因為
0Fee,不小心就發現一些套利空間,只好自己動手架一台RPC來加快交易了。
目前這個的公開RPC只有官方的https://mainnet.aurora.dev/(官方relay)上面限制多多,
大概講一下幾個重點。
1. 其實不是真的0Fee,AURORA運作原理是USER送tx到官方Relay,Relay再把tx轉乘NEAR
tx,Relay送NEAR tx其實要付NEAR gas fee的,目前迎賓活動官方代墊。
2. 因為官方代墊,所以不能頻繁在AURORA上送交易,不然會被Ban。
3. 因為官方代墊,不能送用太多gas的tx,大約一個tx 50萬gas左右,超過一樣被Ban
要解除上述限制只能自己架Relay,以下是大概教學。
OS:WIN 10,沒錯就是WIN10。
RAM:8G
SSD:1T
CPU:R5 3600
https://github.com/aurora-is-near/partner-relayer-deploy
上面網址是官方提供的docker安裝方式,因為是Docker,所以我就直接架在WIN10了。踩了
一些坑就順利架起來了。
首先要先安裝GIT BASH,請自行Google
然後安裝docker windows版,https://docs.docker.com/desktop/windows/install/
打開git bash切到要安裝的目錄
git clone https://github.com/aurora-is-near/partner-relayer-deploy
接下來就是坑點,如果照官文檔直接./setup.sh,你會遇到幾個錯誤:
node_key.json
validator_key.json
relayer.json
這三個key創造會失敗,但是不要緊張,因為這三個不重要。
前兩個key用不到,第三個run relay會自己創一次。
前2個用不到的原因是,你不用架NEAR的node,直接用官方的node就好,這個原始設定是
NEAR node跟AURORA一起架起來,問題是NEAR node超級慢,我的配備還會同步跟不上,根
本坑。
所以,直接橋接官方NEAR NODE就好,那設定檔就要修改成下面。
setup.sh 下面這一段幹掉。
if [ ! -f ./near/data/.version ]; then
echo Downloading near chain snapshot
finish=0
while [ ${finish} -eq 0 ]; do
echo Fetching... this can take some time...
curl -sSf
https://snapshots.deploy.aurora.dev/158c1b69348fda67682197791/"${network}"-near-"${latest}"/data.tar?lastfile=$(tail
-n1 "./near/data/.lastfile") | tar -xv -C ./near/data/ >>
./near/data/.lastfile 2> /dev/null
if [ -f ./near/data/.version ]; then
finish=1
fi
done
fi
執行後就開始下載AURORA relay的snapshot。等個一天應該就可以抓完了。
完成後目錄內會有docker-compose.yaml這個docker設定檔,修改成以下。
---
version: '3.8'
services:
database:
container_name: mainnet_database
image: nearaurora/database:mainnet
restart: unless-stopped
ports: - '127.0.0.1:15432:5432'
volumes: - ./database:/var/lib/postgresql/data
indexer:
container_name: mainnet_indexer
image: nearaurora/endpoint:mainnet
restart: unless-stopped
init: true
depends_on:
- database
environment:
- NEAR_ENV=mainnet
- NODE_ENV=mainnet
volumes:
- ./config:/srv/aurora/relayer/config
extra_hosts:
- host.docker.internal:host-gateway
entrypoint:
["sh", "-c", "util/indexer/indexer | node lib/indexer_backend.js"]
endpoint:
image: nearaurora/endpoint:mainnet
restart: unless-stopped
init: true
depends_on:
- database
environment:
- NEAR_ENV=mainnet
- NODE_ENV=mainnet
ports:
- '127.0.0.1:8545:8545'
volumes:
- ./config:/srv/aurora/relayer/config
entrypoint: ["node", "lib/index.js"]
volumes:
database:
這個檔案修改成橋接官方NEAR node
~/config/mainnet.yaml
---
port: 8545
database: postgres://aurora:aurora@database/aurora
network: mainnet
endpoint: https://archival-rpc.mainnet.near.org
engine: aurora
signer: XXXX.near #查看relayer.json,如果沒這個檔案,先run一次應該就會有了。
signerKeys:
- config/relayer.json
writable: false #如果要送交易就要改成true,relayer.json的帳號資訊要改成有啟用的
NEAR帳號,而且裡面要有NEAR當gas fee。
然後打開windows powershell切到安裝目錄執行$ docker-compose up就會run起來了。
rpc地址http://127.0.0.1:8545
大致上是這樣,good luck。
--
之前在群組有人介紹不用Fee覺得很神奇才衝進去的,一邊質押一邊觀察上面的Defi。因為
0Fee,不小心就發現一些套利空間,只好自己動手架一台RPC來加快交易了。
目前這個的公開RPC只有官方的https://mainnet.aurora.dev/(官方relay)上面限制多多,
大概講一下幾個重點。
1. 其實不是真的0Fee,AURORA運作原理是USER送tx到官方Relay,Relay再把tx轉乘NEAR
tx,Relay送NEAR tx其實要付NEAR gas fee的,目前迎賓活動官方代墊。
2. 因為官方代墊,所以不能頻繁在AURORA上送交易,不然會被Ban。
3. 因為官方代墊,不能送用太多gas的tx,大約一個tx 50萬gas左右,超過一樣被Ban
要解除上述限制只能自己架Relay,以下是大概教學。
OS:WIN 10,沒錯就是WIN10。
RAM:8G
SSD:1T
CPU:R5 3600
https://github.com/aurora-is-near/partner-relayer-deploy
上面網址是官方提供的docker安裝方式,因為是Docker,所以我就直接架在WIN10了。踩了
一些坑就順利架起來了。
首先要先安裝GIT BASH,請自行Google
然後安裝docker windows版,https://docs.docker.com/desktop/windows/install/
打開git bash切到要安裝的目錄
git clone https://github.com/aurora-is-near/partner-relayer-deploy
接下來就是坑點,如果照官文檔直接./setup.sh,你會遇到幾個錯誤:
node_key.json
validator_key.json
relayer.json
這三個key創造會失敗,但是不要緊張,因為這三個不重要。
前兩個key用不到,第三個run relay會自己創一次。
前2個用不到的原因是,你不用架NEAR的node,直接用官方的node就好,這個原始設定是
NEAR node跟AURORA一起架起來,問題是NEAR node超級慢,我的配備還會同步跟不上,根
本坑。
所以,直接橋接官方NEAR NODE就好,那設定檔就要修改成下面。
setup.sh 下面這一段幹掉。
if [ ! -f ./near/data/.version ]; then
echo Downloading near chain snapshot
finish=0
while [ ${finish} -eq 0 ]; do
echo Fetching... this can take some time...
curl -sSf
https://snapshots.deploy.aurora.dev/158c1b69348fda67682197791/"${network}"-near-"${latest}"/data.tar?lastfile=$(tail
-n1 "./near/data/.lastfile") | tar -xv -C ./near/data/ >>
./near/data/.lastfile 2> /dev/null
if [ -f ./near/data/.version ]; then
finish=1
fi
done
fi
執行後就開始下載AURORA relay的snapshot。等個一天應該就可以抓完了。
完成後目錄內會有docker-compose.yaml這個docker設定檔,修改成以下。
---
version: '3.8'
services:
database:
container_name: mainnet_database
image: nearaurora/database:mainnet
restart: unless-stopped
ports: - '127.0.0.1:15432:5432'
volumes: - ./database:/var/lib/postgresql/data
indexer:
container_name: mainnet_indexer
image: nearaurora/endpoint:mainnet
restart: unless-stopped
init: true
depends_on:
- database
environment:
- NEAR_ENV=mainnet
- NODE_ENV=mainnet
volumes:
- ./config:/srv/aurora/relayer/config
extra_hosts:
- host.docker.internal:host-gateway
entrypoint:
["sh", "-c", "util/indexer/indexer | node lib/indexer_backend.js"]
endpoint:
image: nearaurora/endpoint:mainnet
restart: unless-stopped
init: true
depends_on:
- database
environment:
- NEAR_ENV=mainnet
- NODE_ENV=mainnet
ports:
- '127.0.0.1:8545:8545'
volumes:
- ./config:/srv/aurora/relayer/config
entrypoint: ["node", "lib/index.js"]
volumes:
database:
這個檔案修改成橋接官方NEAR node
~/config/mainnet.yaml
---
port: 8545
database: postgres://aurora:aurora@database/aurora
network: mainnet
endpoint: https://archival-rpc.mainnet.near.org
engine: aurora
signer: XXXX.near #查看relayer.json,如果沒這個檔案,先run一次應該就會有了。
signerKeys:
- config/relayer.json
writable: false #如果要送交易就要改成true,relayer.json的帳號資訊要改成有啟用的
NEAR帳號,而且裡面要有NEAR當gas fee。
然後打開windows powershell切到安裝目錄執行$ docker-compose up就會run起來了。
rpc地址http://127.0.0.1:8545
大致上是這樣,good luck。
--
Tags:
數位貨幣
All Comments

By Oliver
at 2022-01-28T07:47
at 2022-01-28T07:47

By Carol
at 2022-02-01T14:22
at 2022-02-01T14:22

By Edith
at 2022-01-28T07:47
at 2022-01-28T07:47

By Isla
at 2022-02-01T14:22
at 2022-02-01T14:22

By Damian
at 2022-01-28T07:47
at 2022-01-28T07:47

By Jake
at 2022-02-01T14:22
at 2022-02-01T14:22

By Candice
at 2022-01-28T07:47
at 2022-01-28T07:47

By Victoria
at 2022-02-01T14:22
at 2022-02-01T14:22

By Edith
at 2022-01-28T07:47
at 2022-01-28T07:47

By Susan
at 2022-02-01T14:22
at 2022-02-01T14:22

By Ophelia
at 2022-01-28T07:47
at 2022-01-28T07:47

By Daph Bay
at 2022-02-01T14:22
at 2022-02-01T14:22

By Rachel
at 2022-01-28T07:47
at 2022-01-28T07:47

By Necoo
at 2022-02-01T14:22
at 2022-02-01T14:22

By Zanna
at 2022-01-28T07:47
at 2022-01-28T07:47

By George
at 2022-02-01T14:22
at 2022-02-01T14:22

By Anonymous
at 2022-01-28T07:47
at 2022-01-28T07:47
Related Posts
加密貨幣行情閒聊區-新年快樂

By Caitlin
at 2022-01-30T22:38
at 2022-01-30T22:38
metamask 的 fee GWEI

By Selena
at 2022-01-30T22:27
at 2022-01-30T22:27
Polygon 鏈的定位

By Zora
at 2022-01-30T20:43
at 2022-01-30T20:43
IronBank、Cream、麻吉FORK宇宙 給我進來

By Sierra Rose
at 2022-01-30T18:52
at 2022-01-30T18:52
Nano幣在幣安上被移除?

By Anonymous
at 2022-01-30T18:38
at 2022-01-30T18:38