make it more fun
This commit is contained in:
@@ -68,7 +68,7 @@ services:
|
||||
- 8547
|
||||
- 8548
|
||||
command:
|
||||
- --init.empty
|
||||
- --init.url=https://snapshot.arbitrum.io/mainnet/nitro.tar
|
||||
- --node.caching.archive
|
||||
- --persistent.chain=/arbitrum-node/data/
|
||||
- --persistent.global-config=/arbitrum-node/
|
||||
@@ -96,9 +96,11 @@ services:
|
||||
user: root
|
||||
volumes:
|
||||
- 'arbitrum-classic:/root/.arbitrum/mainnet'
|
||||
- './arbitrum-classic-entrypoint.sh:/entrypoint.sh'
|
||||
expose:
|
||||
- 8547
|
||||
- 8548
|
||||
entrypoint: ["/bin/bash", "/entrypoint.sh"]
|
||||
command:
|
||||
- --l1.url=${ARBITRUM_L1_URL}
|
||||
- --l2.disable-upstream
|
||||
@@ -117,42 +119,77 @@ volumes:
|
||||
traefik_letsencrypt:
|
||||
```
|
||||
|
||||
Next you'd need the ip address of the machine that your indexer runs on. you can query it using curl by entering the following in the terminal.
|
||||
Also create this helper script tow download download a snapshot on first start. save it into a file named arbitrum-class-entrypoint.sh
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f /root/.arbitrum/mainnet/INITIALIZED ]; then
|
||||
echo "datadir is already initialized"
|
||||
else
|
||||
echo "lemme download the database quickly"
|
||||
rm -rf /root/.arbitrum/mainnet/db
|
||||
curl https://snapshot.arbitrum.io/mainnet/db.tar | tar -xv -C /root/.arbitrum/mainnet/ && touch /root/.arbitrum/mainnet/INITIALIZED
|
||||
fi
|
||||
|
||||
echo "LFG!!!"
|
||||
|
||||
/home/user/go/bin/arb-node $@
|
||||
|
||||
```
|
||||
|
||||
Next make our new file executable.
|
||||
|
||||
```
|
||||
chmod +x arbitrum-classic-entrypoint.sh
|
||||
|
||||
```
|
||||
|
||||
Well done!
|
||||
|
||||
Now you'd need the ip address of the machine that you are running on. Thewre is a ip filter in place which allows only whitelisted IPs to connect to your new RPC.
|
||||
You can query your global IP using curl by entering the following in the terminal.
|
||||
|
||||
curl ifconfig.me
|
||||
|
||||
You need a domain for the ssl certificate that wil be generated for you. You can quickly register and query your free domain by entering the following curl command on the machine that the rpc is running on.
|
||||
Note it down. You also need a domain for the ssl certificate that wil be generated for you. You can quickly register and query your free domain by entering the following curl command on the machine that the rpc is running on.
|
||||
|
||||
curl -X PUT bash-st.art
|
||||
|
||||
you also need a email address for the registration of the ssl certificates. you might not want your private email address to be that public. The last thing you need it a Ethereum RPC to sync L2 blocks from. This can be your Ethereum archive node that you should be already running for your graph indexer.
|
||||
Last bit to have handy is a email address that will not be chekced and no one ever would send an email there. In short: write nonsense. The very last bit to note is a ETH mainnet RPC that you shouldalready have to run your mainnet indexer. We need the URL of that RPC.
|
||||
|
||||
create a file .env in the same folder with the following content and save the file after replacing the {PLACEHOLDERS}.
|
||||
With this information at hand, create a file .env in the same folder with the following content and save the file after replacing ALL the {PLACEHOLDERS}.
|
||||
|
||||
EMAIL={YOUR_EMAIL}
|
||||
DOMAIN={YOUR_DOMAIN}
|
||||
WHITELIST={YOUR_INDEXER_MACHINE_IP}
|
||||
ARBITRUM_L1_URL={RPC_ENDPOINT_OF_ETHEREUM_L1_NODE}
|
||||
|
||||
The last step is to run the node using docker-compose. Enter the following on the command line.
|
||||
Finally run the node using docker-compose. Enter the following on the command line.
|
||||
|
||||
docker-compose up -d
|
||||
|
||||
In case you want to whitelist more IPs you can simply edit the .env file and run the above command again to pick up the changes.
|
||||
In case you want to whitelist more IPs you can simply edit the .env file, add more IPs comma separated and run the above command again to pick up the changes.
|
||||
|
||||
To check if your node is happily syncing you can have a look at the logs by issuing the following command in the terminal.
|
||||
|
||||
docker-compose logs -f arbitrum-nitro
|
||||
|
||||
It should start by downloading a snapshot for about 30 minutes.
|
||||
|
||||
To check the sync status of old blocks before the nitro update you can look at the logs of the classic node using the following command.
|
||||
|
||||
docker-compose logs -f arbitrum-classic
|
||||
|
||||
You'd probably see it downloading the snapshot on first run. This can take a while since we need to download 600 GB for around 2 hours. After that the node will digest the snashot for another 6 hours or so. be patient.
|
||||
|
||||
In the following please replace {DOMAIN} with your actual domain. Your rpc endpoint will be reachable under the url
|
||||
|
||||
https://{DOMAIN}/arbitrum-archive
|
||||
|
||||
Alternatively to the logs you can check the nodes status via rpc from the indexer machine using the following curl command.
|
||||
If you get error codes, e.g. FORBIDDEN check if you added rthe correct global IP of the machine you are on to the WHITELIST in the .env file.
|
||||
|
||||
Alternatively to the logs you can check the nodes status via rpc using the following curl command.
|
||||
|
||||
curl --data '{"method":"eth_synching","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST http://{DOMAIN}/arbitrum-archive
|
||||
|
||||
@@ -160,4 +197,7 @@ To trouble shoot it's also interesting to know which block your node is currentl
|
||||
|
||||
curl --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST http://{DOMAIN}/arbitrum-archive
|
||||
|
||||
The classic nodes rpc endpoint is not exposed in the setup as the nitro node acts as a relay for queries to the classic node.
|
||||
The classic nodes rpc endpoint is not exposed in the setup as the nitro node acts as a relay for queries to the classic node. You can change that easily if you feel the need for it.
|
||||
|
||||
|
||||
Happy Googling!
|
||||
|
||||
Reference in New Issue
Block a user