Blazor library to work with Dfinity Internet Computer. Use this library to easily integrate login with Internet Identity in your Blazor WebAssembly app. This library can also be used to communicate with Internet Computer canisters.
Deployed to https://syisf-7qaaa-aaaah-aauda-cai.ic0.app/
Available on NuGet: https://www.nuget.org/packages/Dfinity.Blazor/
- Login with Internet Identity
- Get Current Internet Identity
- Store and Get key/value pairs
- Store and Get key/value pairs for a logged in user
- Install the Dfinity SDK from https://smartcontracts.org
- Install the .Net SDK from https://get.dot.net
- Clone this code to your local PC
- Publish the sample app:
dotnet publish src/Dfinity.Blazor.SampleApp -c Release
-
Start a local internet computer.
dfx start
-
Open a new terminal window.
-
Reserve an identifier for your canister.
dfx canister create --all
-
Install frontend dependencies
npm install
-
Build the canisters
dfx build
-
Deploy the canisters
dfx canister install --all
-
Take note of the URL at which the canister is accessible.
echo "http://localhost:8000/?canisterId=$(dfx canister id www)"
-
Open the URL in your web browser.
Example implementation can be found at https://github.com/michielpost/SkyDocs/tree/feature/dfinity
Steps:
- Install this library from NuGet Dfinity.Blazor
- Create a folder for your storage canister and add Main.mo
- Add your storage canister to dfx.json
"storage": {
"main": "src/storage/main.mo",
"type": "motoko"
},
- Add index.js and index.html to your www/asset canister
- Add package.json to the root of your project
- Follow the steps to run the demo to build your own project
- Make sure the compiled/minified index.js end up in the
wwwroot
of your Blazor app. - Include the js file in your html:
<script defer src="index.js"></script>