Code Monkey home page Code Monkey logo

bitloader-nedb-js's Introduction

bitloader-nedb-js

example for loading model and resources from the chain to a local nedb

Simple model:

{
	"type": "base.ECPublicKey",
	"properties": {
		"x": {
			"required": true
		},
		"y": {}
	}
}

Simple resource for the above model:

{
	"_type": "base.ECPublicKey",
	"_type_version": "...",
	"x": "a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd",
	"y": "5b8dec5235a0fa8722476c7709c02559e3aa73aa03918ba2d492eea75abea235"
}

Model should be loaded first or resource won't be created. Some more complex models can have properties that have a type that corresponds to another model

For example:

{
	"type": "base.Entity",
	"properties": {
		"public_key": {
			"range": "base.ECPublicKey",                // this model should be loaded first
			"version": "...ECPublicKey version hash..."
		}
	}
}

##Usage

node app

app will be listening on the port 3000.

Type in your browser URL that is

127.0.0.1:3000?json=model

Example for a model above it is going to be

127.0.0.1:3000?json={"type": "base.ECPublicKey","properties": {"x": {"required": true}, "y": {}}}

bitloader-nedb-js's People

Contributors

mvayngrib avatar pgmemk avatar

Stargazers

 avatar

Watchers

 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.