Coder Social home page Coder Social logo

rgbonic's Introduction

rgbonic

Welcome to your new rgbonic project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle.

To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.

To learn more before you start working with rgbonic, see the following documentation available online:

If you want to start working on your project right away, you might want to try the following commands:

cd rgbonic/
dfx help
dfx canister --help

Running the project locally

If you want to test your project locally, you can use the following commands:

# Clone the `wasm-forge/wasi2ic` project:
git clone https://github.com/wasm-forge/wasi2ic

## Enter the wasi2ic directory and install it
cd wasi2ic
cargo install --path .

# Starts the replica, running in the background
dfx start --background

# Compile the project with `wasm-wasi` inside the project folder
cargo build --release --target wasm32-wasi
# or 
just build_wallet

# Translate `wasm32-wasi` target to wasm32-unknown-unknown` under the project directory
wasi2ic ./target/wasm32-wasi/release/wallet.wasm wallet.wasm
# or 
just translate_wasm

# Create canister for `wallet` if first time 
dfx canister create wallet

# Install the new wasm file to IC canister with `regtest` or `testnet` or `mainnet`
dfx canister install --mode reinstall --wasm wallet.wasm wallet --argument '("regtest")' 
# or
just install wallet

# Call the canister to verify 
dfx canister call wallet greet "人生只有一件事:修"

Once the job completes, your application will be available at http://localhost:4943?canisterId={asset_canister_id}.

Note on frontend environment variables

If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:

  • setDFX_NETWORK to ic if you are using Webpack
  • use your own preferred method to replace process.env.DFX_NETWORK in the autogenerated declarations
    • Setting canisters -> {asset_canister_id} -> declarations -> env_override to a string in dfx.json will replace process.env.DFX_NETWORK with the string in the autogenerated declarations
  • Write your own createActor constructor

rgbonic's People

Contributors

lshoo avatar

Stargazers

xiaodao avatar  avatar 22388o⚡️  avatar

Watchers

 avatar  avatar

Forkers

22388o

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.