Skip to content

Commit

Permalink
License AGPL-3.0-only, sanitized
Browse files Browse the repository at this point in the history
  • Loading branch information
shookie committed Aug 9, 2018
0 parents commit 336aac1
Show file tree
Hide file tree
Showing 99 changed files with 24,564 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# fallback file for env-cmd
# do not edit this file. for your local environment
# create your own file called '.env.local' in the same dir and add entries like
# CONTRACTUS_TESTLOGS=true
# of course drop the '# ' comment prefix in your file ;)
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bundles/*
discify/*
dist/*
node_modules/*
.env.local
ipfs-contractus
package-lock.json.*
package-lock.json
docs/_build/*
9 changes: 9 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.env
bundles/bcc/bcc.js.map
bundles/bcc/dbcpPath.json
discify/
docu/
scripts/
src/
tsconfig.json
tslint.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
661 changes: 661 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

1,074 changes: 1,074 additions & 0 deletions README.md

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# blockchain-core

## Next Version
### Features
### Fixes
### Deprecations

## Version 1.0.2
### Features
- add support for adding sharing file hashes to cache to avoid duplicate contract calls
- add paging to `getCalls` and `getAnswers` in `ServiceContract` module
- add function to clear sharing caches to `Sharing` module
- add support for nested encryption to `ServiceContract` module
- rename to api-blockchain-core

### Fixes

### Deprecations
- change service call encryption schema to multi-sharings based encryption


## Version 1.0.1
### Features
- add docu for rights-and-roles.ts, ipld.ts
- use @evan.network for package name and dependencies scopes
- add .npmignore
- (deprecation) rights-and-roles.ts:hasUserRole second argument "accountId" will be dropped, as it isnt' required anymore
- rename *contractus* variables to *evan*
- rename bcc-core bundle to bcc
- rename BCCCore to CoreRuntime
- rename BCCProfile to ProfileRuntime
- rename BCCBC to BCRuntime
- allow overwriting runtimes nameResolver with runtimeConfig
- fix unbound entry retrieval in DataContract.getListEntries by adding paging to it
- add `removeAccountFromRole` and `transferOwnership` to `RightsAndRoles` for better permission management
- make `extendSharings` publicly accessible for adding properties to sharings withou saving them
- add `createSharing` to `DataContract` and accept a sharings hash in `createContract` , which allows to decouple sharing creation and contract creation
- accept ipld hashes in `storeForAccount` in `Profile` to decouple tree encryption and property storing
- add support for multi-sharings to `Sharings` module
- add multi-sharing support to `ServiceContract` module

## Version 1.0.0
- DBCP update
- Fix web3 reconnect
- Add iframe support for dapps

## Version 0.9.0
- initial version and release candidate for 1.0.0
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = blockchain-core
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
109 changes: 109 additions & 0 deletions docs/blockchain/account-store.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
================================================================================
Account Store
================================================================================

.. list-table::
:widths: auto
:stub-columns: 1

* - Class Name
- AccountStore
* - Implements
- `KeyStoreInterface <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`__
* - Extends
- `Logger </common/logger.html>`_
* - Source
- `account-store.ts <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`__

The `AccountStore <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`_ implements the `KeyStoreInterface <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`_ and is a wrapper for a storage, where evan.network account ids are stored. The default `AccountStore <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`_ takes an account --> private key mapping as a pojo as its arguments and uses this to perform lookups, when the :ref:`getPrivateKey <accountstore_getPrivateKey>` function is called. This lookup needs to be done, when transactions are signed by the `InternalSigner <https://github.com/evannetwork/dbcp/tree/master/src/contracts/signer-internal.ts>`_ (see `Signer </blockchain/signer.html>`_).

Note that the return value of the :ref:`getPrivateKey <accountstore_getPrivateKey>` function is a promise. This may not be required in the default `AccountStore <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`_, but this allows you to implement own implementations of the `KeyStoreInterface <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`_, which may enforce a more strict security behavior or are able to access other sources for private keys.



------------------------------------------------------------------------------

.. _accountstore_constructor:

constructor
================================================================================

.. code-block:: typescript
new AccountStore(options);
Creates a new AccountStore instance.

----------
Parameters
----------

#. ``options`` - ``AccountStoreOptions``: options for AccountStore constructor.
* ``accounts`` - ``any``: object with accountid/privatekey mapping
* ``log`` - ``Function`` (optional): function to use for logging: ``(message, level) => {...}``
* ``logLevel`` - |source logLevel|_ (optional): messages with this level will be logged with ``log``
* ``logLog`` - |source logLogInterface|_ (optional): container for collecting log messages
* ``logLogLevel`` - |source logLevel|_ (optional): messages with this level will be pushed to ``logLog``

-------
Returns
-------

``AccountStore`` instance

-------
Example
-------

.. code-block:: typescript
const accountStore = new AccountStore({
accounts: {
'0x1234': '12479abc3df'
}
});
--------------------------------------------------------------------------------

.. _accountstore_getPrivateKey:

getPrivateKey
===================

.. code-block:: javascript
accountStore.getPrivateKey(accountId);
get private key for given account



----------
Parameters
----------

#. ``accountId`` - ``string``: eth accountId

-------
Returns
-------

Promise resolves to ``string``: private key for this account

-------
Example
-------

.. code-block:: javascript
const privateKey = await runtime.accountStore.getPrivateKey('0x0000000000000000000000000000000000000002');
.. required for building markup
.. |source logLevel| replace:: ``LogLevel``
.. _source logLevel: /common/logger.html#loglevel

.. |source logLogInterface| replace:: ``LogLogInterface``
.. _source logLogInterface: /common/logger.html#logloginterface
Loading

0 comments on commit 336aac1

Please sign in to comment.