npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-rn-mobile-dapp

v1.0.4

Published

A boilerplate code for quick developemnt of dApps on mobile using React Native

Downloads

151

Readme

create-rn-mobile-dapp

Get started with creating your decentralised application (dApp) with React Native using this boilerplate code.

This boilerplate code serves as a quick development playground for developing mobile dApps on local blockchain.

To get started, install the npm package

npm i create-rn-mobile-dapp

Then, start the boilerplate code:

npx create-rn-mobile-dapp my-dapp

Replace my-dapp with your project name

  • Run npm install to install the packages in package.json.

  • Create a .env file in the project's root directory. Make sure this file is in .gitignore

Setting up

Ensure the following are installed and setup.

1. Install Ganache-CLI by following the guide here.

To run, enter this into a new terminal
ganache-cli --server.host 0.0.0.0 --server.port 8545

This will create an instance of some test accounts with balance that are free to use for development.

2. Create a WalletConnect project ID by following this guide

Copy the project ID into .env file in the format:

REACT_APP_WALLETCONNECT_PROJECT_ID=PROJECTID

3. Setup the test device (iPhone) (require iOS>13.2):

Enable the developer mode on the test device. See guide here.

4. Install MetaMask on the test device

After Login, go to Settings>Networks>Add Network>Custom networks. Enter the details as follows to add the network:

  • Network Name: localhost (or any name)
  • RPC Url : http://<ip_address_of_local_machine>:8545
  • Chain ID : 1337
  • Symbol: ETH

On the home page, change the network to the custom network created. Make sure you are not on Ethereum Main Network.

Next, import the account created from Ganache CLI into MetaMask mobile by clicking on Import Account. Paste the private key from the Ganache CLI terminal for the account you wish to import here.

Upon successful import, you should be able to see the address, and the balance.

5. Compile and Deploy your smart contract on Remix IDE.

  • Compile your smart contract and copy the contract ABI into the src/data/contractInfo.js file in this repository.
  • Change the environment to Dev - Ganache Provider before deploying the smart contract.
  • Obtain the contract address after deploying the contract and place it in the same file as the contract ABI.

Building the app

1. In the project's root directory, install the pods by running in the terminal:

cd ios && pod install && cd ..

2. Connect your test device to the local machine and open the project in Xcode.

Open the .xcworkspace file instead of the .xcodeproj.

3. On the terminal, run:

npx react-native run-ios --device "Your device name"

This will start the metro server and launch the application on your device.

4. Connect to your MetaMask mobile account by pressing on the connect button in the app.

Test your smart contract by calling them in testContract.js using ethers.js or web3.js. connect wallet