-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from movemntdev/indexer
feat: indexer
- Loading branch information
Showing
6 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash -e | ||
mkdir -p ./plugins | ||
|
||
# We will inherit the avalanchego binary from the environment. | ||
# But, we will set the plugin path to the plugin dir in this directory. | ||
export AVALANCHEGO_EXEC_PATH=$(which avalanchego) | ||
export AVALANCHEGO_PLUGIN_PATH=$(pwd)/plugins | ||
|
||
# Build the subnet | ||
cargo build -p subnet | ||
|
||
# export SUBNET_ID=$(subnet-cli create VMID ./target/debug/subnet) | ||
export SUBNET_ID=srEXiWaHZNDcVtfHLb38cFiwKVLJ8xnhDF5qpWbYdowxEiyid | ||
|
||
echo $SUBNET_ID | ||
# Copy the subnet binary to the plugin dir | ||
# cp ./target/debug/subnet ${AVALANCHEGO_PLUGIN_PATH}/${SUBNET_ID} | ||
# cp ./target/debug/subnet ${AVALANCHEGO_PLUGIN_PATH}/subnet | ||
|
||
# Start the avalanche-network-runner | ||
avalanche-network-runner server | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -e | ||
|
||
# Install subnet-cli | ||
VERSION=0.0.4 # Populate latest here | ||
|
||
GOARCH=$(go env GOARCH) | ||
GOOS=$(go env GOOS) | ||
DOWNLOAD_PATH=/tmp/subnet-cli.tar.gz | ||
DOWNLOAD_URL=https://github.com/ava-labs/subnet-cli/releases/download/v${VERSION}/subnet-cli_${VERSION}_linux_${GOARCH}.tar.gz | ||
if [[ ${GOOS} == "darwin" ]]; then | ||
DOWNLOAD_URL=https://github.com/ava-labs/subnet-cli/releases/download/v${VERSION}/subnet-cli_${VERSION}_darwin_${GOARCH}.tar.gz | ||
fi | ||
|
||
rm -f ${DOWNLOAD_PATH} | ||
rm -f /tmp/subnet-cli | ||
|
||
echo "downloading subnet-cli ${VERSION} at ${DOWNLOAD_URL}" | ||
curl -L ${DOWNLOAD_URL} -o ${DOWNLOAD_PATH} | ||
|
||
echo "extracting downloaded subnet-cli" | ||
tar xzvf ${DOWNLOAD_PATH} -C /tmp | ||
|
||
/tmp/subnet-cli -h | ||
|
||
cp /tmp/subnet-cli $HOME/bin/subnet-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -e | ||
export AVALANCHEGO_EXEC_PATH=$(which avalanchego) | ||
export AVALANCHEGO_PLUGIN_PATH=$(pwd)/plugins | ||
|
||
echo hello > /tmp/subnet.genesis.json | ||
|
||
avalanche-network-runner control start \ | ||
--log-level debug \ | ||
--endpoint="0.0.0.0:8080" \ | ||
--avalanchego-path="${AVALANCHEGO_EXEC_PATH}" | ||
# --blockchain-specs '[{"vm_name":"subnet","genesis":"/tmp/subnet.genesis.json","blockchain_alias":"movement"}]' \ | ||
|
||
# avalanche-network-runner control create-blockchains '[{"vm_name":"movement", "subnet_id": "srEXiWaHZNDcVtfHLb38cFiwKVLJ8xnhDF5qpWbYdowxEiyid"}]' \ | ||
# --log-level debug \ | ||
# --endpoint="0.0.0.0:8080" | ||
|
||
curl -X POST -k http://localhost:8081/v1/control/status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters