Skip to content

Commit 336aac1

Browse files
committed
License AGPL-3.0-only, sanitized
0 parents  commit 336aac1

99 files changed

Lines changed: 24564 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# fallback file for env-cmd
2+
# do not edit this file. for your local environment
3+
# create your own file called '.env.local' in the same dir and add entries like
4+
# CONTRACTUS_TESTLOGS=true
5+
# of course drop the '# ' comment prefix in your file ;)

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
bundles/*
2+
discify/*
3+
dist/*
4+
node_modules/*
5+
.env.local
6+
ipfs-contractus
7+
package-lock.json.*
8+
package-lock.json
9+
docs/_build/*

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.env
2+
bundles/bcc/bcc.js.map
3+
bundles/bcc/dbcpPath.json
4+
discify/
5+
docu/
6+
scripts/
7+
src/
8+
tsconfig.json
9+
tslint.json

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

LICENSE.txt

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1074 additions & 0 deletions
Large diffs are not rendered by default.

VERSIONS.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# blockchain-core
2+
3+
## Next Version
4+
### Features
5+
### Fixes
6+
### Deprecations
7+
8+
## Version 1.0.2
9+
### Features
10+
- add support for adding sharing file hashes to cache to avoid duplicate contract calls
11+
- add paging to `getCalls` and `getAnswers` in `ServiceContract` module
12+
- add function to clear sharing caches to `Sharing` module
13+
- add support for nested encryption to `ServiceContract` module
14+
- rename to api-blockchain-core
15+
16+
### Fixes
17+
18+
### Deprecations
19+
- change service call encryption schema to multi-sharings based encryption
20+
21+
22+
## Version 1.0.1
23+
### Features
24+
- add docu for rights-and-roles.ts, ipld.ts
25+
- use @evan.network for package name and dependencies scopes
26+
- add .npmignore
27+
- (deprecation) rights-and-roles.ts:hasUserRole second argument "accountId" will be dropped, as it isnt' required anymore
28+
- rename *contractus* variables to *evan*
29+
- rename bcc-core bundle to bcc
30+
- rename BCCCore to CoreRuntime
31+
- rename BCCProfile to ProfileRuntime
32+
- rename BCCBC to BCRuntime
33+
- allow overwriting runtimes nameResolver with runtimeConfig
34+
- fix unbound entry retrieval in DataContract.getListEntries by adding paging to it
35+
- add `removeAccountFromRole` and `transferOwnership` to `RightsAndRoles` for better permission management
36+
- make `extendSharings` publicly accessible for adding properties to sharings withou saving them
37+
- add `createSharing` to `DataContract` and accept a sharings hash in `createContract` , which allows to decouple sharing creation and contract creation
38+
- accept ipld hashes in `storeForAccount` in `Profile` to decouple tree encryption and property storing
39+
- add support for multi-sharings to `Sharings` module
40+
- add multi-sharing support to `ServiceContract` module
41+
42+
## Version 1.0.0
43+
- DBCP update
44+
- Fix web3 reconnect
45+
- Add iframe support for dapps
46+
47+
## Version 0.9.0
48+
- initial version and release candidate for 1.0.0

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = blockchain-core
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/blockchain/account-store.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
================================================================================
2+
Account Store
3+
================================================================================
4+
5+
.. list-table::
6+
:widths: auto
7+
:stub-columns: 1
8+
9+
* - Class Name
10+
- AccountStore
11+
* - Implements
12+
- `KeyStoreInterface <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`__
13+
* - Extends
14+
- `Logger </common/logger.html>`_
15+
* - Source
16+
- `account-store.ts <https://github.com/evannetwork/dbcp/tree/master/src/account-store.ts>`__
17+
18+
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>`_).
19+
20+
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.
21+
22+
23+
24+
------------------------------------------------------------------------------
25+
26+
.. _accountstore_constructor:
27+
28+
constructor
29+
================================================================================
30+
31+
.. code-block:: typescript
32+
33+
new AccountStore(options);
34+
35+
Creates a new AccountStore instance.
36+
37+
----------
38+
Parameters
39+
----------
40+
41+
#. ``options`` - ``AccountStoreOptions``: options for AccountStore constructor.
42+
* ``accounts`` - ``any``: object with accountid/privatekey mapping
43+
* ``log`` - ``Function`` (optional): function to use for logging: ``(message, level) => {...}``
44+
* ``logLevel`` - |source logLevel|_ (optional): messages with this level will be logged with ``log``
45+
* ``logLog`` - |source logLogInterface|_ (optional): container for collecting log messages
46+
* ``logLogLevel`` - |source logLevel|_ (optional): messages with this level will be pushed to ``logLog``
47+
48+
-------
49+
Returns
50+
-------
51+
52+
``AccountStore`` instance
53+
54+
-------
55+
Example
56+
-------
57+
58+
.. code-block:: typescript
59+
60+
const accountStore = new AccountStore({
61+
accounts: {
62+
'0x1234': '12479abc3df'
63+
}
64+
});
65+
66+
67+
68+
--------------------------------------------------------------------------------
69+
70+
.. _accountstore_getPrivateKey:
71+
72+
getPrivateKey
73+
===================
74+
75+
.. code-block:: javascript
76+
77+
accountStore.getPrivateKey(accountId);
78+
79+
get private key for given account
80+
81+
82+
83+
----------
84+
Parameters
85+
----------
86+
87+
#. ``accountId`` - ``string``: eth accountId
88+
89+
-------
90+
Returns
91+
-------
92+
93+
Promise resolves to ``string``: private key for this account
94+
95+
-------
96+
Example
97+
-------
98+
99+
.. code-block:: javascript
100+
101+
const privateKey = await runtime.accountStore.getPrivateKey('0x0000000000000000000000000000000000000002');
102+
103+
.. required for building markup
104+
105+
.. |source logLevel| replace:: ``LogLevel``
106+
.. _source logLevel: /common/logger.html#loglevel
107+
108+
.. |source logLogInterface| replace:: ``LogLogInterface``
109+
.. _source logLogInterface: /common/logger.html#logloginterface

0 commit comments

Comments
 (0)