Nahmii 2.0 is a layer 2 for Ethereum built around the Nahmii Virtual Machine, nVM. This upgraded version of Nahmii provides generalised smart contract support and full composability between them. Nahmii leverages patent-pending state pool technology which gives unprecedented scalability. This makes Nahmii the only commercially viable scaling solution for Ethereum.
The current testnet iteration of Nahmii 2.0 works with both a private instance of Ethereum and a L2 network. It is thus required to connect to two RPC networks.
L2 testnet
- Network name: Nahmii 2.0 - Ropsten
- RPC URL: https://l2.testnet.nahmii.io/
- ChainID: 5553
- Symbol: ETH
- Block explorer URL: https://explorer.testnet.nahmii.io/
Navigate to the connect-nahmii-2 web app and press on the ADD NAHMII ROPSTEN
button. The app will request you to add the selected network. Approve the request. The network should be added to your Ethereum provider.
- Open the MetaMask browser extension.
- Click on the network name.
- When the networks window pops up, click on 'Custom RPC'.
- A new window will popup where you can fill in the connection details. Fill in the details provided above for the first network and click save.
- Do this again for the second network listed above.
Nahmii 2.0 provides a number of contracts on L1 to interact with the L2 and vica versa. The meta data of these contracts can be found here.
The main contract that is relevant for developers is the AddressManager. The AddressManager provides easy accesss to all the other contracts and exposes their addresses. For examples on how to interact with the Nahmii 2.0 L2 contracts, please see the provided examples.
To compile the correct bytecode to work with the Nahmii virtual machine, the hardhat-ovm dependency is required due to the differences between certain opcodes in the EVM and the NVM.
- Install the OVM hardhat plugin.
yarn add @eth-optimism/hardhat-ovm
- Edit
hardhat.config.js
to use the OVM package.
// hardhat.config.js
require("@nomiclabs/hardhat-waffle");
require('@eth-optimism/hardhat-ovm')
...
- In the same file, add
nahmii
to the list of networks: Note: Update the accounts fields to fit your personal setup.
...
module.exports = {
solidity: "0.7.6",
networks: {
nahmii: {
url: 'https://l2.testnet.nahmii.io/',
accounts: { mnemonic: 'test test test test test test test test test test test junk' },
gasPrice: 15000000,
ovm: true
}
}
};
- To test contracts on the live Nahmii L2, compile it with hardhat:
npx hardhat --network nahmii test
- To interact with the smart contracts manually, use the console. The JavaScript console can be ran with the following command:
npx hardhat --network nahmii console