Code Monkey home page Code Monkey logo

Comments (4)

huseyindeniz avatar huseyindeniz commented on June 21, 2024

Hi again, while waiting, I decided to use the underlying repos to achieve my goal and my goal is having a reproducible subnet dev env on my local machine. I'm also planning to write it as a tutorial for the community.
OS: Windows 10 with WSL2 (with WSL I can easily configure and run Ubuntu VM's as much as I need. I can also get snapshot of these VM's. So, If i break anything I can return back)
What I'd like to have: I'd like to prepare a configurable Ubuntu Subnet VM. And in my local Windows Machine I'd like to access this VM from hardhat and also from Metamask. By doing so, I can focus on development.
What I tried lastly on my Ubuntu VM:

  • Installed GO
  • Installed AvalancheGo from source
  • Installed Subnet-EVM from source (as a plugin for avalanchego)
  • Installed Subnet-CLI from source
  • Installed AvalancheNetworkRunner from source

After these steps, I'm able to run server with the following command (I can set the port here, so I assume I can start mutliple servers by setting their ports different. I didn't try it yet)
avalanche-network-runner server --log-level debug --port=":8080" --grpc-gateway-port=":8081"

At this step, to deploy subnet I use the following commands

`
export CHAIN_ID=99999
export GENESIS_ADDRESS="0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC"
cat < /tmp/subnet-evm.genesis.json
{
"config": {
"chainId": $CHAIN_ID,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"subnetEVMTimestamp": 0,
"feeConfig": {
"gasLimit": 20000000,
"minBaseFee": 1000000000,
"targetGas": 100000000,
"baseFeeChangeDenominator": 48,
"minBlockGasCost": 0,
"maxBlockGasCost": 10000000,
"targetBlockRate": 2,
"blockGasCostStep": 500000
}
},
"alloc": {
"${GENESIS_ADDRESS}": {
"balance": "0x52B7D2DCC80CD2E4000000"
}
},
"nonce": "0x0",
"timestamp": "0x0",
"extraData": "0x00",
"gasLimit": "0x1312D00",
"difficulty": "0x0",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
EOF
cat /tmp/subnet-evm.genesis.json

AVALANCHEGO_EXEC_PATH="~/avalanchego/build/avalanchego"
AVALANCHEGO_PLUGIN_PATH="~/avalanchego/build/plugins"

avalanche-network-runner control start
--log-level debug
--endpoint="0.0.0.0:8080"
--avalanchego-path ${AVALANCHEGO_EXEC_PATH}
--plugin-dir ${AVALANCHEGO_PLUGIN_PATH}
--custom-vms '{"subnetevm":"/tmp/subnet-evm.genesis.json"}'

`
And it's successfully starting. But everytime I run these commands, I get different rpc urls which I use in my hardhat config and metamask networks.

So, still I need to update my dev env daily. If someone can give me any idea or point me to the correct documentation, I'd be appreceated. As a non Go (not planning to be also) developer, it's really difficult to follow both docs and examples. Thanks.

from avalanche-cli.

huseyindeniz avatar huseyindeniz commented on June 21, 2024

It has been 16 days and you made too many changes during this period. Why is no one answering? @dasconnor @holisticode @yulin-dong @patrick-ogrady @michaelbnewman

from avalanche-cli.

holisticode avatar holisticode commented on June 21, 2024

Hi @huseyindeniz sorry for the delay and the silence. We are indeed making progress and many changes.

Snapshot support is already available. With snapshots, your state will be saved and thus will survive machine restarts. In the upcoming release we're adding the functionality to start from snapshots. Also, multiple subnets deploy will be available.

Please note we are still very early in this tool with 0.x releases. There is a lot of functionality missing, and at the same time things can change quickly. Thanks for being a user of the tool, all suggestions and feedback is welcome.

from avalanche-cli.

huseyindeniz avatar huseyindeniz commented on June 21, 2024

Hi @holisticode , thank you very much for the feedback. As I understand, I'll take a snapshot at the end of the day, and then I'll start with the snapshot on the next day. And multiple subnets will also be available in near future. It sounds good. Thanks again.

from avalanche-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.