This project was implemented as part of a hackathon. The goal was to create a custom virtual machine / subnet which run on Avalanche. I created a chain which allows users to store arbitrary data (e.g. for files or other things). Validators of the subnet are able to earn rewards for validating.
For further reading:
This project currently is only local. I intend to deploy it to Fuji, but of course I forgot to sync the chain and now it's taking forever. Will update with more details if I put it live.
- You'll need to copy the binary out of
/bin
(or compile yourself using the build script) into youravalanchego/plugins
directory. - Add your node as a validator on the primary subnet
- Add your node as a validator on the subnet wtyFZF1UUyjyXeiVCP5Vd5dpQ6KPCmG24qW3agbSRdtVEh7Jb
Then, to validate on Fuji, we need to run avalanchego as follows:
avalanchego --network-id=fuji --whitelisted-subnets=wtyFZF1UUyjyXeiVCP5Vd5dpQ6KPCmG24qW3agbSRdtVEh7Jb --index-enabled
Unfortunately --index-enabled
requires resyncing the whole chain.
Will provide more info on this once I resync the chain with index-enabled haha.
SUBNET_ID=wtyFZF1UUyjyXeiVCP5Vd5dpQ6KPCmG24qW3agbSRdtVEh7Jb
BLOCKCHAIN_ID=6XHJC4cJVzSyF4iaA5TugsnWzn3LTY1Y5DwGwaTYYUrWuwQJ7
- Clone repo
- Install avash & avalanchego (v1.5.3). I have them in /avash & /avalanchego-v1.5.3 (relative to the root of this project). It might work if you put them elsewhere but no guarantees.
- Install the required tools (see Required Tools section below)
- Configure ~/.avash.yaml (see Avash Configuration section below)
- Set up environment variables (see Environment section below)
- Install the Python requirements:
pip install -r cli/requirements.txt
This won't work on windows probably, maybe on other OS. Mostly because of path separators but maybe there are other issues.
Ok so, this project is all over the place. Good luck, you'll need:
- Golang
- Python & pip (I'm running 3.7.x)
- NodeJS (I'm running v15.0.1, this isn't really a hard requirement, but it's used in one of the scripts)
Edit your ~/.avash.yaml
file. Make sure that you set avalancheLocation: <absolute_path_to_avalanche_go>
.
The following environment variables need to be set
AVALANCHEGO_DIR
: absolute path to Avalanche GoFILESTORAGEVM_DIR
: absolute path to the root directory of this project
- From the avash directory, ./avash
- In the avash CLI, type
runscript ../scripts/avash-start.lua
. This will only work if you installed avash into/avash
relative to the project root. Otherwise, replace the..
with the full path to the project root. - Wait for everything to boot. At the end you'll see
done, we are validating!
along with the blockchain id and the subnet id. - Leave this open
- Copy your
blockchain_id
- you'll need it to run the CLI
- From the project root, run
bash build.sh
- From the Avash shell, type
runscript ../scripts/avash-reload.lua
(this reboots the node validating the subnet)
From the /cli
directory, run python3 cli.py <blockchain_id>