Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/preston176/dbank
https://github.com/preston176/dbank
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/preston176/dbank
- Owner: preston176
- Created: 2024-12-09T10:52:52.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-12-09T20:57:28.000Z (2 months ago)
- Last Synced: 2024-12-09T21:34:45.300Z (2 months ago)
- Language: Motoko
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `dbank`
Welcome to your new `dbank` 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 include your own code to speed up the development cycle.
To get started, 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 `dbank`, 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)
- [Motoko Programming Language Guide](https://internetcomputer.org/docs/current/motoko/main/motoko)
- [Motoko Language Quick Reference](https://internetcomputer.org/docs/current/motoko/main/language-manual)## Getting Started
To start working on your project right away, try the following commands:
```bash
cd dbank/
dfx help
dfx canister --help
```## Running the Project Locally
To test your project locally, use the following commands:
```bash
# Start the replica, running in the background
dfx start --background# Deploy your canisters to the replica and generate your candid interface
dfx deploy
```Once the job completes, your application will be available at `http://localhost:4943?canisterId={asset_canister_id}`.
If you have made changes to your backend canister, generate a new candid interface with:
```bash
npm run generate
```This is recommended before starting the frontend development server and will be run automatically any time you run `dfx deploy`.
For frontend changes, start a development server with:
```bash
npm start
```This will start a server at `http://localhost:4943`, proxying API requests to the replica at port 4943.
## DFX Commands
Here are some useful `dfx` commands:
```bash
# Create a new project
dfx new# Deploy your canisters / push updates
dfx deploy# Call a method on a canister
dfx canister call# Get Candid UI for a canister
dfx canister id __Candid_UI# Access Candid Interface for a canister
http://127.0.0.1:4943/?canisterId=&id=# Open the Candid UI for a canister
dfx canister --no-wallet call __get_candid_interface_tmp_hack# Generate the candid interface
dfx generate# Build your canisters
dfx build# Start the local replica
dfx start# Stop the local replica
dfx stop# List all canisters
dfx canister list# Create a new canister
dfx canister create# Install code to a canister
dfx canister install# Get the status of a canister
dfx canister status# Get the ID of a canister
dfx canister id# Delete a canister
dfx canister delete# Get help on dfx commands
dfx help
```## 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.