Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/BitcoinOS-Labs/BitcoinOS

Bitcoin Layer2 on Internet Computer with RGB
https://github.com/BitcoinOS-Labs/BitcoinOS

Last synced: about 1 month ago
JSON representation

Bitcoin Layer2 on Internet Computer with RGB

Awesome Lists containing this project

README

        

#

# bitcoinOS

Welcome to your new bitcoinOS 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 bitcoinOS, see the following documentation available online:

- [Quick Start](https://internetcomputer.org/docs/current/developer-docs/setup/deploy-locally)
- [SDK Developer Tools](https://internetcomputer.org/docs/current/developer-docs/setup/install)
- [Rust Canister Development Guide](https://internetcomputer.org/docs/current/developer-docs/backend/rust/)
- [ic-cdk](https://docs.rs/ic-cdk)
- [ic-cdk-macros](https://docs.rs/ic-cdk-macros)
- [Candid Introduction](https://internetcomputer.org/docs/current/developer-docs/backend/candid/)

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

```bash
cd bitcoinOS/
dfx help
dfx canister --help
```

## Running the project locally

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

```bash
# 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 .

## Install just
cargo install just

# 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/smartwallet.wasm smartwallet.wasm
# or
just translate_wasm

# Create canister if first time to install
dfx canister create os

# Install the new wasm file to IC canister & yes
dfx deploy os

# If you want to deploy smartwall by manually
just install_wallet
```

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:

- set`DFX_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