TAGS

truffle-skale-network-box

CREATED

UPDATED

STARS

INSTALL

...

REPOSITORY
GitHub Download
Please wait: Fetching readme...

b'\n\n# SKALE Network Box\n\n![box-artwork](https://github.com/skalenetwork/skale-box/blob/master/truffle-skale.png?raw=true)\n \n- [Overview](#overview)\n- [Requirements](#requirements)\n- [Install](#installation)\n- [Setup](#setup)\n\t* [Get a SKALE Chain](#1-get-a-skale-chain)\n\t* [Get a Wallet](#2-get-a-wallet)\n \t* [Fund your Wallet with skETH](#fund-your-wallet-with-sketh)\n\t* [Update Truffle Config](#3-update-truffle-config)\n- [Deploy to the SKALE Network](#deploy-to-the-skale-network)\n- [Test](#testing)\n- [SKALE Network Resource Links](#resources)\n- [Support](#support)\n\n ## Overview\n\nWelcome to the SKALE Network Box! This Truffle SKALE Network box provides you with all the basics necessary to kick-start scaling your application with the SKALE Network. You can find out more information about getting started with SKALE within the [Developer Getting Started Guide](https://skale.network/docs/developers/getting-started/beginner).\n\nThis box comes with everything you need to start using smart contracts from a react app on the SKALE Network. \n\nThe SKALE Network is fully decentralized, and is supported by a validator community represented by over 48 validator orgs running over 150 nodes. Since the network is EVM compatible, all existing tools built for Ethereum will work directly within the SKALE Network as well. For example, the SKALE Network is fully compatible with the all Ethereum native wallets. Check out the SKALE Network Dev Portal for easy integration scripts fo connecting your favorite wallet, [here](https://skale.network/docs/developers/wallets/getting-started).\n\nFor example, connecting MetaMask to SKALE in a seamless way can be seen in this document:\n\nhttps://skale.network/docs/developers/wallets/metamask\n\n**All SKALE Chains contain the following features:**\n\n* Full EVM Support for Solidity Smart Contracts\n* Interchain Messaging for managing Tokens (ETH, ERC20, ERC721, etc.)\n* Decentralized Storage\n* Integration Support for All Ethereum Tools\n* Wallet Support for API and HSM Wallets\n\nLastly, the SKALE Network uses a [unique combination of several technologies](https://skale.network/blog/technical-highlights) to achieve scalability, security, interoperability, and progressive decentralization:\n\n| Technology | Impact |\n|--|--|\n| Pooled Validation Proof-of-Stake | [Scalable security model across validators and delegators](https://skale.network/blog/the-skale-network-why-randomness-rotation-and-incentives-are-critical-for-secure-scaling/) |\n|Hybrid Container Architecture | [Agile allocation of on-demand composable compute resources across the network](https://skale.network/blog/containerization-the-future-of-decentralized-infrastructure/) |\n| Threshold Cryptography | Supermajority signature signing with ABBA consensus supports Byzantine Fault Tolerance and resolves [data-availability](https://skale.network/blog/the-data-availability-problem/) issues |\n| Trusted-Execution Environment | [Fast block signing and multiple chain support using threshold cryptography](https://github.com/skalenetwork/SGXWallet) |\n| Asynchronous Binary Byzantine Agreement (ABBA) Consensus | [Mathematically provable, fast-finality, leaderless, and Byzantine Fault Tolerant](https://skale.network/blog/skale-consensus/) |\n| Ethereum Network | Public, open-source, and decentralized operation of the SKALE Network via SKALE Manager contracts |\n\n## Requirements\n\nThe SKALE Network box has the following requirements:\n\n- [Node.js](https://nodejs.org/) 12.x or later\n- [NPM](https://docs.npmjs.com/cli/) version 5.2 or later\n- Windows, Linux or MacOS\n\n## Installation\n\n```bash\n\n$ truffle unbox skalenetwork/truffle-skale-network-box\n$ npm install\n\n```\n\n## Setup\n\n### 1) Get a SKALE Chain\n\nThe SKALE Network is a multichain platform, and there are many ways to get access to the SKALE Network testing environments. To obtain your SKALE Chain endpoint and Chain ID, check out the [SKALE Network getting started guide](https://skale.network/docs/developers/getting-started/beginner).\n\n> Alternatively, for faster testing please feel free to use the available community SKALE Chains listed [here](https://forum.skale.network/t/skale-chain-sdk).\n\n### 2) Get a Wallet\nThe SKALE Network works with a variety of wallet solutions. If you already have a wallet and private key to use, you can skip this step and go to the next section: [Update Truffle Config](#update-truffle-config).\n\nYou can pick and setup your favorite wallet from the documentation [here](https://skale.network/docs/developers/wallets/getting-started).\n\nWe recommend starting with MetaMask, and obtaining a wallet address and private key to use for testing from the [MetaMask wallet](https://metamask.io/).\n\n#### Fund your Wallet with skETH\nSKALE Chains enable dApps to run gasless transactions. This provides an effective way to scale your dApp not only for speed but also to scale economically. However, SKALE Chains do require skETH to conduct transactions \xe2\x80\x93 this skETH is SKALE Chain "fake" ETH with no economic value, but provides a way for dApps to facilitate permissive access to SKALE Chains and protects against DDoS attacks.\n\nYou can learn more about skETH [here](https://skale.network/docs/developers/skale-chain-eth).\n\n> If you are using the community SKALE Chains, you can simply head over to the SKALE testnet faucet to obtain skETH for using your SKALE Chain. You will need both your SKALE Chain endpoint and your wallet address to obtain skETH from the faucet. \n\n### 3) Update Truffle Config\n\nYou can add the SKALE Chain endpoint and private key directly into the `truffle-config.js` file by replacing the following:\n\n```\nconst privateKey = process.env.PRIVATE_KEY;\nconst skale = process.env.SKALE_CHAIN;\n```\n\nFor example:\n```\nconst privateKey = "0x0000000000000000000000000000000000000000000000000000000000000000";\nconst skale = "https://this-is-my-skale-chain.com:1234";\n```\n\nA more secure way would be to leave the `truffle-config.js` as is, and create a `.env` file at the root directory of your project to hold onto your private key and SKALE Chain endpoint.\n\nYour `.env` file should look like:\n\n```\nSKALE_CHAIN=https://this-is-my-skale-chain.com:1234 \nPRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000\n```\n\nTo learn more about using environment variables within a `.env` file plese see:\n\nhttps://www.npmjs.com/package/dotenv\n\n#### Using a mnemonic\n\nIf you\'d prefer to use a mnemonic (vs a private key), you can just omit the `PRIVATE_KEY` entry in your `.env` file and include a `MNEMONIC` entry instead. Note that `HDWalletProvider` will use the first account that\'s generated from the mnemonic. For example:\n\n```\nSKALE_CHAIN=https://this-is-my-skale-chain.com:1234 \nMNEMONIC=test test test test test test test test test test test test\n```\n\n## Deploy to the SKALE Network\nYou can use Truffle to compile and migrate your smart contracts to the SKALE Network. The following command will compile and migrate the smart contract(s) to SKALE:\n\n```\ntruffle migrate --network skale --compile-all --config=truffle-config.skale.js\n```\n\n\nFor more information on available Truffle commands, please see the Truffle documentation here:\n\nhttps://www.trufflesuite.com/docs/truffle/reference/truffle-commands\n\n\n\n## Testing\nTruffle can run tests written in Solidity or JavaScript against your smart contracts. Note the command varies slightly if you\'re in or outside of the development console.\n\n ```\n // inside the truffle development console.\n test --network skale --config=truffle-config.skale.js\n\n // outside the truffle development console.\n truffle test --network skale --config=truffle-config.skale.js\n ```\n## Resources\n\n**SKALE Network Resources Links**\n- [Website](https://skale.network)\n- [Blog](https://skale.network/blog)\n- [Github](https://github.com/skalenetwork)\n- [Whitepaper](https://skale.network/whitepaper)\n- [Developer Docs](https://skale.network/docs/developers/overview)\n\n**SKALE Network Community Links**\n- [Discord](http://skale.chat)\n- [Twitter](https://twitter.com/skalenetwork)\n- [Telegram](https://t.me/skaleofficial)\n\n## Support\n\nSupport for this box is available via the Truffle community [here](https://www.trufflesuite.com/community). In addition, SKALE Network support is available [here](http://skale.chat).\n'