All Projects → brownie-mix → react-mix

brownie-mix / react-mix

Licence: other
Everything you need to use React with Brownie!

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
CSS
56736 projects
solidity
1140 projects

Projects that are alternatives of or similar to react-mix

ape
The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
Stars: ✭ 339 (+484.48%)
Mutual labels:  web3, brownie
frontend-v2
Frontend app for the Balancer protocol
Stars: ✭ 127 (+118.97%)
Mutual labels:  web3
dxvote
Governance Dapp of DXdao
Stars: ✭ 28 (-51.72%)
Mutual labels:  web3
erebos
JavaScript client and CLI for Swarm
Stars: ✭ 47 (-18.97%)
Mutual labels:  web3
trystero
🤝 Serverless WebRTC matchmaking for painless P2P — Make any site multiplayer in a few lines — Use BitTorrent, IPFS, or Firebase
Stars: ✭ 512 (+782.76%)
Mutual labels:  web3
airswap-web
AirSwap Web App
Stars: ✭ 94 (+62.07%)
Mutual labels:  web3
Web3swift
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions.
Stars: ✭ 237 (+308.62%)
Mutual labels:  web3
circles-myxogastria
Webapp and mobile client for Circles
Stars: ✭ 32 (-44.83%)
Mutual labels:  web3
crypto-high-score
Add your name to the global, immutable leaderboard by paying in ETH.
Stars: ✭ 18 (-68.97%)
Mutual labels:  web3
tool-db
A peer-to-peer decentralized database
Stars: ✭ 15 (-74.14%)
Mutual labels:  web3
play
playproject
Stars: ✭ 22 (-62.07%)
Mutual labels:  web3
resources
A living collection of resources for participants (and anyone who's interested) in Truffle University's courses 📚
Stars: ✭ 27 (-53.45%)
Mutual labels:  web3
useWeb3
useWeb3 provides a curated overview of the best and latest resources on Ethereum, blockchain and Web3 development.
Stars: ✭ 325 (+460.34%)
Mutual labels:  web3
polkadot-wiki-old
The Polkadot wiki.
Stars: ✭ 56 (-3.45%)
Mutual labels:  web3
geesome-node
🦈 Your self-hosted decentralized Messenger, Social network, Media file storage on top of IPFS! Freely communicate in encrypted chat groups, share images, video, text or any data without a risk of censorship or blocking.
Stars: ✭ 90 (+55.17%)
Mutual labels:  web3
Web3Pass
Your Web3 in one shot 🍻
Stars: ✭ 54 (-6.9%)
Mutual labels:  web3
walletconnect-test-wallet
Test Wallet (Web)
Stars: ✭ 163 (+181.03%)
Mutual labels:  web3
Before-Bitcoin
Book about the ideological context of cryptocurrency. 'Before Bitcoin' written by Pet3rpan.
Stars: ✭ 22 (-62.07%)
Mutual labels:  web3
oxo-chat-client
基于websocket、json、blockchain的公告、聊天(客户端到客户端加密)客户端。账号无需注册,本地生成!
Stars: ✭ 52 (-10.34%)
Mutual labels:  web3
mev-inspect-rs
Discover historic Miner Extractable Value (MEV) opportunities
Stars: ✭ 443 (+663.79%)
Mutual labels:  web3

Brownie React Mix

This mix comes with everything you need to start using React with a Brownie project.

Installation

  1. Install Brownie, if you haven't already. You must be using version 1.9.0 or newer.

  2. Download the mix.

    brownie bake react-mix
  3. Install the React client dependencies.

    cd ./client
    yarn install

    or

    cd ./client
    npm install 
  4. If you want to be able to deploy to testnets, do the following.

    Set your WEB3_INFURA_PROJECT_ID, and PRIVATE_KEY environment variables.

    You can get a WEB3_INFURA_PROJECT_ID by getting a free trial of Infura. At the moment, it does need to be infura with brownie. If you get lost, follow the instructions at https://ethereumico.io/knowledge-base/infura-api-key-guide/. You can find your PRIVATE_KEY from your ethereum wallet like metamask.

    You'll also need testnet ETH. You can get ETH into your wallet by using the faucet for the appropriate testnet. For Kovan, a faucet is available at https://linkfaucet.protofire.io/kovan.

    You can add your environment variables to a .env file. You can use the .env_example in this repo as a template, just fill in the values and rename it to '.env'.

    Here is what your .env should look like:

    export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
    export PRIVATE_KEY=<PRIVATE_KEY>
  5. Create brownie account(s) following instructions here: https://eth-brownie.readthedocs.io/en/stable/account-management.html

  6. Import the brownie account to MetaMask using their private key(s)

Usage

  1. Open the Brownie console. Starting the console launches a fresh Ganache instance in the background.

    $ brownie console
    Brownie v1.9.0 - Python development framework for Ethereum
    
    ReactMixProject is the active project.
    Launching 'ganache-cli'...
    Brownie environment is ready.

    Alternatively, to run on Kovan, set the network flag to kovan

    $ brownie console --network kovan
    Brownie v1.14.6 - Python development framework for Ethereum
    
    ReactMixProject is the active project.
    Brownie environment is ready.
  2. Run the deployment script to deploy the project's smart contracts.

    >>> run("deploy")
    Running 'scripts.deploy.main'...
    Transaction sent: 0xd1000d04fe99a07db864bcd1095ddf5cb279b43be8e159f94dbff9d4e4809c70
    Gas price: 0.0 gwei   Gas limit: 6721975
    SolidityStorage.constructor confirmed - Block: 1   Gas used: 110641 (1.65%)
    SolidityStorage deployed at: 0xF104A50668c3b1026E8f9B0d9D404faF8E42e642
    
    Transaction sent: 0xee112392522ed24ac6ab8cc8ba09bfe51c5d699d9d1b39294ba87e5d2a56212c
    Gas price: 0.0 gwei   Gas limit: 6721975
    VyperStorage.constructor confirmed - Block: 2   Gas used: 134750 (2.00%)
    VyperStorage deployed at: 0xB8485421abC325D172652123dBd71D58b8117070
  3. While Brownie is still running, start the React app in a different terminal.

    The first time this app is used, the node modules have to be installed in /src. To do this, navigate to ./client/src and run

    # make sure to use a different terminal, not the brownie console
    npm install
    npm audit fix
  4. Connect Metamask to the local Ganache network. In the upper right corner, click the network dropdown menu. Select Localhost 8545, or Kovan test network:

  5. Interact with the smart contracts using the web interface or via the Brownie console.

    # get the newest vyper storage contract
    >>> vyper_storage = VyperStorage[-1]
    
    # the default sender of the transaction is the contract creator
    >>> vyper_storage.set(1337)

    Any changes to the contracts from the console should show on the website after a refresh, and vice versa.

Ending a Session

When you close the Brownie console, the Ganache instance also terminates and the deployment artifacts are deleted.

To retain your deployment artifacts (and their functionality) you can launch Ganache yourself prior to launching Brownie. Brownie automatically attaches to the ganache instance where you can deploy the contracts. After closing Brownie, the chain and deployment artifacts will persist.

Further Possibilities

Testing

To run the test suite:

brownie test

Deploying to a Live Network

To deploy your contracts to the mainnet or one of the test nets, first modify scripts/deploy.py to use a funded account.

Then:

brownie run deploy --network kovan

Replace kovan with the name of the network you wish you use. You may also wish to adjust Brownie's network settings.

For contracts deployed on a live network, the deployment information is stored permanently unless you:

  • Delete or rename the contract file or
  • Manually remove the client/src/artifacts/ directory

Resources

This mix provides a bare-bones implementation of Create React App, configured to work with Brownie.

To get started with React and building a front-end for your dApps:

  • Rimble is an open-source library of React components and guides to help you make dApps. Along with components they provide guides and tutorials to help you get started.
  • For more in-depth information, read the Create React App documentation

To get started with Brownie:

Any questions? Join our Gitter channel to chat and share with others in the community.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].