Giter Club home page Giter Club logo

bigmap-poc's Introduction

Proof of concept demo of BigMap

The idea of BigMap is to enable infinitely scalable key-value storage on the Internet Computer. This repository contains a proof of concept of this idea that the DFINITY foundation worked on in the past. It is currently broken and it is also not supported. The repository is open-sourced to serve as an inspiration for developers.

Prerequisites

Dependencies

  • Rust compiler 1.45+ (and cargo)
  • cmake (optional but recommended)
  • IC SDK (DFX) 0.6.9+

IC SDK

To integrate BigMap with the Internet Computer applications, it's necessary to have the DFX version 0.6.9 or higher

DFX_VERSION=0.6.9 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"

Rust CDK is included with Big Map through git subtree, so it does not have to be separately downloaded and installed.

Rust

Tested with Rust 1.45+. Please make sure you install the latest version.

Make sure you're running the latest version of Rust, with wasm32 target

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
rustup toolchain install stable
rustup override set stable
rustup target add wasm32-unknown-unknown

Build and install canisters

Simply run ./bootstrap.sh, or

git clone [email protected]:dfinity/big-map-rs.git
cd big-map-rs

npm install
dfx build
dfx canister create bigmap
dfx canister install bigmap
./bigmap-cli --set-data-bucket-wasm-binary target/wasm32-unknown-unknown/release/bigmap_data.wasm
./bigmap-cli --set-search-wasm-binary target/wasm32-unknown-unknown/release/bigmap_search.wasm

Test

You can either take a look at test.sh for a complete set of test steps, or you can selectively run the below commands:

dfx canister call bigmap get '(vec { 97; 98; 99; })'
# (null)
dfx canister call bigmap put '(vec { 97; 98; 99; }, vec { 100; 101; 102; })'
# ()
dfx canister call bigmap get '(vec { 97; 98; 99; })'
# (opt vec { 4; 5; 6; })

It is also possible to talk directly to the data bucket canisters, but this is likely only useful during development or debugging. In this case it's necessary to know the CanisterId, which is printed in the replica debug logs during creation.

For example:

dfx canister call tup4c-ks6aa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q get '(vec { 97; 98; 99; })'
# (null)
dfx canister call tup4c-ks6aa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q put '(vec { 97; 98; 99; }, vec { 100; 101; 102; })'
# ()
dfx canister call tup4c-ks6aa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q get '(vec { 97; 98; 99; })'
# (opt vec { 4; 5; 6; })

bigmap-poc's People

Contributors

dependabot[bot] avatar hansl avatar sasa-tomic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.