Skip to content

InfraDAO/migrate-hs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migrate HS Subgraph

Install IPFS

https://docs.ipfs.tech/install/command-line/#install-official-binary-distributions

ipfs init

Run IPFS daemon service

cat <<EOF | sudo tee /etc/systemd/system/ipfs.service
[Unit]
Description=InterPlanetary File System (IPFS) daemon
After=network.target

[Service]
User=root
ExecStart=/usr/local/bin/ipfs daemon
Restart=on-failure
Environment="IPFS_PATH=/root/.ipfs"

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl start ipfs.service && sudo systemctl enable ipfs.service

Create Subgraph Directory in ~/migrate-hs/contracts-dev/cli/subgraphs/Qmxxxxxxxxxx

sudo mkdir contracts-dev/cli/subgraphs/QmPfXMydP7R1XzCbDPgpJ7fh5h22HsNAxVb1RgA9XvwJaj # HS Deployment ID

Add metadata.json, version-metdata.json and png.

e.g. contracts-dev/cli/subgraphs/QmPfXMydP7R1XzCbDPgpJ7fh5h22HsNAxVb1RgA9XvwJaj

Pin Logo

cd contracts-dev/cli/subgraphs/QmPfXMydP7R1XzCbDPgpJ7fh5h22HsNAxVb1RgA9XvwJaj
curl -s -F "file=@./quickswap_polygon.png" "http://localhost:5001/api/v0/add" | jq -r '.Hash'
#Save the Output for next command

Pin Logo to IPFS Hash

curl -X --POST https://ipfs.network.thegraph.com/api/v0/pin/add?arg=/ipfs/Qmhash-output-from-above-command

Update metadata.json pointing to the newly pinned logo.

Pin files to IPFS

./pin_subgraph_files.sh QmPfXMydP7R1XzCbDPgpJ7fh5h22HsNAxVb1RgA9XvwJaj hs-network migrated-network

Build

cd ~/contracts-dev && yarn
yarn build

Edit .env

MNEMONIC="the quick brown fox jumped over the lazy dog" # Mneumonic to funded wallet
RPC_ENDPOINT=https://ethereum.publicnode.com # RPC endpoint
ADDRESS=0xdeadbeef12345678901234567890 # Address of wallet
DEPLOYMENT_ID=QmQN451jswE4LSSp7fLdQzP86XxY4Hc5UrrGRRp1Nuk2d1 # Deployment ID on HS

Run

cd ~/migrate-hs && chmod +x publish.sh && ./publish.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published