Git Product home page Git Product logo

ion's Introduction

ION is a public, permissionless, Decentralized Identifier (DID) network that implements the blockchain-agnostic Sidetree protocol on top of Bitcoin (as a 'Layer 2' overlay) to support DIDs/DPKI (Decentralized Public Key Infrastructure) at scale.

IMPORTANT NOTE: The majority of ION's code is developed under the blockchain-agnostic Sidetree protocol's repo: https://github.com/decentralized-identity/sidetree, which this project uses internally with the code required to run the protocol on Bitcoin, like the ION network.

Key Points:

  • ION is public and permissionless - the system is decentralized, no company, organization, or group owns/controls the identifiers and DPKI entries in the system, and no one dictates who can participate.
  • ION doesn't introduce new tokens/coins - Bitcoin is the only unit of value relevant in the operation of the on-chain aspects of the ION network.
  • ION is not a sidechain or consensus system - the network nodes do not require any additional consensus mechanism.
  • See design document for specific design details and decisions.

Operating Model

See the operating model document on processes and activities performed to maintain ION.

How does ION work?

By leveraging the blockchain-agnostic Sidetree protocol, ION makes it possible to anchor tens of thousands of DID/DPKI operations on a target chain (in ION's case, Bitcoin) using a single on-chain transaction. The transactions are encoded with a hash that ION nodes use to fetch, store, and replicate the hash-associated DID operation batches via IPFS. The nodes process these batches of operations in accordance with a specific set of deterministic rules that enables them to independently arrive at the correct DPKI state for IDs in the system, without requiring a separate consensus mechanism, blockchain, or sidechain. Nodes can fetch, process, and assemble DID states in parallel, allowing the aggregate capacity of nodes to run at tens of thousands of operations per second.

Frequently Asked Questions

See Q&A.

Building the project:

Please use the following guide to setup the various services that comprise an ION node: ION Installation Guide

Partner Organizations:

ION (an instantiation of Sidetree on Bitcoin) has been developed as a part of the Decentralized Identity Foundation

ion's People

Contributors

balajipachai avatar caleteeter avatar cent2sat avatar codeglobally avatar csuwildcat avatar dbolser avatar decentralgabe avatar dependabot[bot] avatar dergigi avatar didros avatar erebor avatar evil-maid avatar glencooper avatar grankko avatar hamishmacewan avatar hawkmauk avatar henkvancann avatar isaacjchen avatar jabdov avatar jlopp avatar lidel avatar mahoekst avatar mburns avatar michaelneale avatar mudiali avatar mynameismeerkat avatar nayuta-ueno avatar pedro-uwu avatar thehenrytsai avatar yorkerhodes3 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  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  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

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  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  avatar  avatar

ion's Issues

Can't create new DID

Open up a new ticket on it, had originally commented on it here: #40


Having a problem creating a DID using the API. I'm following the instructions and have this CURL request as follows:

curl --location --request POST 'http://localhost:3000/' \
--header 'Content-Type: application/json' \
--data-raw '{
  "type": "create",
  "suffixData": {
	  "operationDataHash": "4472d99bba1670457ee9a6746e481edf488a2c55",
	  "recoveryKey": {
	    "publicKeyHex": "02f49802fb3e09c6dd43f19aa41293d1e0dad044b68cf81cf7079499edfd0aa9f1"
	  },
	  "nextRecoveryOtpHash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"
	},
  "operationData": {
	    "nextUpdateOtpHash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
	    "document": {
		  "publicKey": [
		    {
		      "id": "#key1",
		      "type": "Secp256k1VerificationKey2018",
		      "publicKeyHex": "02f49802fb3e09c6dd43f19aa41293d1e0dad044b68cf81cf7079499edfd0aa9f1",
		      "usage": "signing"
		    }
		  ]
		}
	}
}'

Getting a Bad request: TypeError: Cannot read property 'toString' of undefined during const response = await sidetreeCore.handleOperationRequest(ctx.body);

Tried following the directions here: https://github.com/decentralized-identity/sidetree/blob/master/docs/protocol.md#did-creation

Is there something I need to do with the JWS headers? There wasn't much documentation on that or how to work with it.

MacOS support

I just wonder, based on the installation guide.
Should not MacOS be supported?
Since all windows needs is node, and all linux needs is snapd.
Can MacOS run withtout snapd?

Bitcoin core runs on mac, mongoDB runs on mac.
And the latter parts are node dependent.

Is there something im missing that makes MacOS not able to run this?

Can you link to DIF, etc in the readme.md?

There are a few 'partner organisations' involved in the project like DIF. Can you add a section on 'Partner Organisations' (or similar) to the readme.md and link to DIF, etc.?

I can do this if you like.

Api Documentation for DID related operations

Hi Team,

Is there any documentation where i can find all the apis for testing did operations and service hubs.

Actually i remember that i had used it before .but now it got disappared .Could you please help me with that . I want to do some testing and want to study more about microsoft ION

Best Regards
Sethi Shivam

Update Instructions for Docker

While configuring ION using instructions for docker I notice that the service names for ion-ipfs and ion-bitcoin within the docker-compose files are not correct. Renaming them

Also, in config.sh, the path used to probe the bitcoin sync progress in line 48 is missing /data in the path

  • Issue: PROGRESS=`sudo tail -n 1 /datadrive/testnet3/debug.log | grep -Po 'progress=\K.*?(.{5})\s'`.
  • Fix: PROGRESS=`sudo tail -n 1 /datadrive/testnet3/debug.log | grep -Po 'progress=\K.*?(.{5})\s'`

docker-compose.yml

version: "3"
services:
  bitcoin-core:
    container_name: bitcoin-core
    image: ruimarinho/bitcoin-core:0.19.1-alpine
    command:
      -printtoconsole
      -testnet=1
      -txindex=1
      -server=1
    environment:
      - BITCOIN_DATA=/data
    volumes:
      - ${DATA_VOL}:/data
  bitcoin-ion:
    container_name: ion-bitcoin
    image: node:10.20.1-alpine3.11
    command: "npm run bitcoin"
    working_dir: /ion
    links:
      - "bitcoin-core"
      - "mongo"
    volumes:
      - ./ion:/ion
  ipfs:
    container_name: ion-ipfs
    image: node:10.20.1-alpine3.11
    command: "npm run ipfs"
    working_dir: /ion
    depends_on:
      - "ion-bitcoin"
    volumes:
      - ./ion:/ion
  core:
    container_name: ion-core
    image: node:10.20.1-alpine3.11
    command: "npm run core"
    working_dir: /ion
    links:
      - "ion-bitcoin"
      - "ion-ipfs"
      - "mongo"
    volumes:
      - ./ion:/ion
  mongo:
    container_name: mongo
    image: mongo:3.6.18-xenial
    volumes:
      - ${DB_VOL}:/data/db

Error: version_manager_version_string_not_found: Unable to find version string for blockchain time 1745995.

Try to install ION network on my machine. The nodes seem all the be running and operating. On the ion-core node I keep seeing this error message in the log:

Waiting for 60 seconds before fetching and processing transactions again.

Refreshing cached blockchain time...
Refreshed blockchain time: {"time":1774301,"hash":"0000000000000005e4d5ff139bf724c9e506273dec8ea7a31dfa76c640f82f6a"}
Fetching Sidetree transactions from blockchain service...
Fetching URI 'http://ion-bitcoin:3002/transactions'...
Fetch response: 200'.
Fetched 13 Sidetree transactions from blockchain service in 4991 ms.
Waiting for 60 seconds before fetching and processing transactions again.
Encountered unhandled and possibly fatal Observer error, must investigate and fix:
{ Error: version_manager_version_string_not_found: Unable to find version string for blockchain time 1745995.
at VersionManager.getVersionString (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/VersionManager.js:138:15)
at VersionManager.getTransactionSelector (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/VersionManager.js:121:30)
at ThroughputLimiter. (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:36:65)
at Generator.next ()
at /ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:7:71
at new Promise ()
at __awaiter (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:3:12)
at ThroughputLimiter.getQualifiedTransactions (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:23:16)
at Observer. (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/Observer.js:97:78)
at Generator.next () code: 'version_manager_version_string_not_found' }

http://localhost:3000 returns this:
[
{
"name": "core",
"version": "0.9.1"
},
{
"name": "bitcoin",
"version": "0.9.1"
},
{
"name": "ipfs",
"version": "0.9.1"
}
]

ion-bitcoin should parse block files at a seperate thread

When starting the service for the first time the service is blocked until it's done parsing. ion-core cannot start and connect successfully before parsing is complete. Shouldn't be possible to start listening to requests while parsing happens on a separate thread? Resolving might be slower and depending more on peers perhaps or is that not how this would work?

Enable a clear read-only mode

It's not clear to me what configuration I need to make to create a read-only node. I don't have a bitcoin wallet.

BitcoinClient should check for if the 'bitcoinWalletOrImportString' parameter is undefined

https://github.com/decentralized-identity/sidetree/blob/a8ba6ec2a1fb809df55ce54e47339d8ac1e7df34/lib/bitcoin/BitcoinClient.ts#L47

If the admin forgets to add in either the import string or an actual IBitcoinWallet on this parameter then we should throw here. Currently, the this.bitcoinWallet member stays undefined and we throw when we try to use it.

Suggestion:

if (typeof bitcoinWalletOrImportString === 'undefined') { // throw }

// OR

// After all the initializations
if (this.bitcoinWallet === undefined) { // throw }

Add a mechanism for self-declaring a DID's entity type

Given we will have DIDs for humans, organizations, machines, and other things, it would be helpful to have an optional mechanism by which DID creators can self-declare what type of thing a DID represents. One way to do this could be to add a type field to the create operation Anchor File section with a couple bytes of space for a value that mapped to entity types. That's just one idea on how to do this, but this would really help in being able to have a general grouping of different DID types in the system.

Problems running the installation instructions

I've been running into some issues trying to load up an ION node on a VPS. I'll try and list these out and the workarounds I've been using as best I can. I'm running all of this on an instance of Ubuntu 18.04.2 LTS on GCP.

  • The first issue was with the zeromq installation. Running from the installation instructions I got the following error, which I was able to get around with the steps laid out here:
The repository 'http://ppa.launchpad.net/chris-lea/zeromq/ubuntu bionic Release' does not have a Release file.
Updating from such a repository can't be done securely, and is therefore disabled by default.
  • The instructions for creating the symlink are a little off and were causing some issues. Instead of ln -s sidetree/lib/bitcored-extension ion-bitcore I think it should be ln -s ~/sidetree/lib/bitcored-extension ion-bitcore or ln -s [ABSOLUTE_PATH_TO_SIDETREE_REPO]/sidetree/lib/bitcored-extension ion-bitcore

  • The first step for configuring ION, when you're supposed to edit json/bitcoin-config.json, instead of http://localhost:3001/ion-bitcore/ it should probably be http://localhost:3001/insight-api (no trailing slash) otherwise requests to the bitcore node will fail

  • Now after all the above steps and fixes, when the node is fully synced I try and run npm run build && npm run bitcoin but I get the following message:

Fetching Sidetree transactions after transation 'undefined' from bitcored service...
Response status 'ServerError' when fetching transactions from bitcore.
Waiting for 100 seconds before fetching and processing transactions again.
  • One thing I found when trying to debug the above is that with the initial bootstrapping requests that are called, the method handleBlockByHeightRequest is called and sets up a request to /blocks/[block height] but when trying this out with bitcore (and looking at the network requests that insights ui makes), this endpoint doesn't exist. instead /block-index/[+blockheight] will return the info that's being looked for (specifically blockHash).

That's about as far as I got. It almost seems like the versions of bitcore aren't lining up but as far as I can tell from the various package.json's in the repo and what I have in my installation, everything seems to be the same. For reference, according to the footer in insights I'm on Insights API v0.4.3

Install guide

Paragraph 7.

Verify ION is running properly by checking the following DID resolution link in your browser: http://localhost:3000/did:ion-test:EiBNsl-a8ZjvFsJCEousqy-9N4RFypLEU1Ha7pn9KPFpPg[http://localhost:3000/did:ion-test:EiBNsl-a8ZjvFsJCEousqy-9N4RFypLEU1Ha7pn9KPFpPg]

should be:
http://localhost:3000/did:ion-test:EiBNsl-a8ZjvFsJCEousqy-9N4RFypLEU1Ha7pn9KPFpPg

Furthermore and maybe out of scope here:
In the installation of the chrome app (https://didproject.azurewebsites.net/docs/install-extension.html) there's a little bug in the manifest.json:

"permissions": [
"activeTab",
"tabs",
"storage",
"webNavigation",
"Cookies",
""
],

should be:

"permissions": [
"activeTab",
"tabs",
"storage",
"webNavigation",
"cookies"
// , ""
],

DID Not Found(v0.10.0 install guide)

I try v0.10.0 install guide, but "DID Not Found".

commit: b2d836e

Ubuntu 18.04

$ curl http://localhost:3000/identifiers/did:ion:test:EiBFsUlzmZ3zJtSFeQKwJNtngjmB51ehMWWDuptf9b4Bag
{"code":"did_not_found","message":"DID Not Found"}

$ curl http://localhost:3000/did:ion:test:EiBFsUlzmZ3zJtSFeQKwJNtngjmB51ehMWWDuptf9b4Bag

#101

Show progress when running ion-bitcoin for the first time

When starting the service for the first time it tells me it's processing from 633700 to 649979 and starts with the highest block (blk02255.dat) and counts downwards, but it's not clear how far along it is and how many blocks to go. Perhaps add the blocknumbers to the output besides it how many valid blocks it found?

Investigate custom pruning of non-Sidetree txns

It's possible to set a Bitcoin node to allow custom pruning of select transactions. Investigate what it would take to prune all non-Sidetree transactions, which should reduce retained storage considerably.

Is it possible to get the DID of each operation in the batch file?

I'm trying to use the REST API endpoints to observe sidetree transactions on ION, but the operations don't seem to contain any reference to the DIDs they pertain to. Is there a way to dereference the DIDs of each operation?

(I'm using ION version 0.5.0)

This is what I'm doing so far:

GET http://ion-instance:3002/transactions

this gets a list of transactions, which all look like this:

[{
  "transactionNumber":6490271109873672,
  "transactionTime":1511134,
  "transactionTimeHash":"0000000000000ef8f824192e0f7b5d2ad525bab1f322fa5081e80e7481c8b96e",
  "anchorString":"EiAy4Y72hlK7laJfnkAsCKw6azkiICcOE2Df3QF4cxSlKw"
}]

For each of these transactions, I take the anchorString value, and use it to make a request like this:

GET http://ion-instance:3003/EiAmQ0AVj3ixs3jK-25yWEgcsaS3q47sPD_EEguzIn8S7Q?max-size=2000

Which gives me a JSON object that looks like this:

{"batchFileHash":"EiBtjyhK_Z2cszuSqUhmCSK1t17iTvtmydxaMZKdxsBo8A","merkleRoot":"UH2qCm60I9mniBHVcdeUkVd1OmPF8P2rnBM93dGU0AQ"}

I then take the batchFileHash value, and use it to make the same request again, e.g.

GET http://ion-instance:3003/EiBtjyhK_Z2cszuSqUhmCSK1t17iTvtmydxaMZKdxsBo8A?max-size=2000

Which gives me an object like this:

{
  "operations": [
    "eyJoZWFkZXIiOnsiYWxnIjoiRVMyNTZLIiwia2lkIjoiI2tleTEiLCJvcGVyY.....",
    "eyJoZWFkZXIiOnsiYWxnIjoiRVMyNTZLIiwia2lkIjoiI2tleTEiLCJvcGVyY....."
  ]
}

I take each operation and run it through a base64decode operation which gives me something like this:

{
  "header": {
    "alg": "ES256K",
    "kid": "#key1",
    "operation": "create",
    "proofOfWork": "{}"
  },
  "payload": "eyJjcmVhdGVkIjoiMjAxOS0wNC0yM1QxNzoyMzow....",
  "signature": "MEUCIHPTgpJ7K8SLsGxBM05Rti9MMJnxgbdwllGZ9XhxD1QV...."
}

I take the payload value and run it through another base64decode operation, which gives me something like this:

{
  "created": "2019-04-23T17:23:06.754Z",
  "@context": "https://w3id.org/did/v1",
  "publicKey": [
    {
      "id": "#key1",
      "type": "Secp256k1VerificationKey2018",
      "publicKeyJwk": {
	"kty": "EC",
	"crv": "P-256K",
	"key_ops": ["sign", "verify"],
	"x": "5XuyCgM-ZvnR7XxJtXhUMXrzIen4W6kuGFHiVPeEWSQ",
	"y": "-RaqLq1AX_aRbxJwrx-mhcPffNMD7qNlEfe5-y0xH-o",
	"d": "dX0aOwt1lBZ0NIxQ-EyHhYOOgwD6-MZMMeQw3RBKhh8",
	"kid": "#key1"
      }
    }
  ]
}

However, I can't seem to figure out how to ascertain the DID this operation relates to.

Not supported BCoin API call in the getUnspentCoins function of the BitcoinProcessor class

The API call in the function getUnspentCoins(address) of the BitcoinProcessor class, used by the writeTransaction(anchorFileHash) function in the same class, to write the hash of the anchor file in the blockchain is not supported by the BCoin API. This causes an error when the ION node tries to write the hash of the anchor file to the blockchain (provided the wallet has enough funds) making DID creation operations fail.

This function calls a BCoin API GET method /coin/address/${addressToSearch} which is not supported by the BCoin API. I tried to look for the intended method but couldn't find it in the current API specification. The unspent coins could be obtained by processing all transactions associated with a particular address using the GET method /tx/address/${addressToSearch} or perhaps using the BCoin wallet APIs (instead of the node APIs).

I was not successful with any of these (someone shout if find a solution) and opted for an external service provided by chain.so. Not ideal for production, but could solve the problem for testing. I am happy to share the code I am using to make it work for now.

ION transaction fetch failing

Running the current ION release 0.8.2 after sync, the following error occurs each time the ion node enquires about transactions.

Fetching URI 'http://ion-bitcoin:3002/transactions'...
ion-core        | No queued operations to batch.
ion-core        | End batch writing. Duration: 47 ms.
ion-core        | Waiting for 600 seconds before writing another batch.
ion-core        | Fetch response: 200'.
ion-core        | Fetched 13 Sidetree transactions from blockchain service in 4065 ms.
ion-core        | Encountered unhandled and possibly fatal Observer error, must investigate and fix:
ion-core        | Waiting for 60 seconds before fetching and processing transactions again.
ion-core        | { Error: version_manager_version_string_not_found: Unable to find version string for blockchain time 1745995.
ion-core        |     at VersionManager.getVersionString (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/VersionManager.js:138:15)
ion-core        |     at VersionManager.getTransactionSelector (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/VersionManager.js:121:30)
ion-core        |     at ThroughputLimiter.<anonymous> (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:36:65)
ion-core        |     at Generator.next (<anonymous>)
ion-core        |     at /ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:7:71
ion-core        |     at new Promise (<anonymous>)
ion-core        |     at __awaiter (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:3:12)
ion-core        |     at ThroughputLimiter.getQualifiedTransactions (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/ThroughputLimiter.js:23:16)
ion-core        |     at Observer.<anonymous> (/ion/node_modules/@decentralized-identity/sidetree/dist/lib/core/Observer.js:97:78)
ion-core        |     at Generator.next (<anonymous>) code: 'version_manager_version_string_not_found' }
ion-core        | Refreshing cached blockchain time...
ion-core        | Refreshed blockchain time: {"time":1773344,"hash":"00000000000001a2847271cf4fe00df29bce7a2b024f68801c6479ad4229cbec"}

Configuration being used is the standard config checked into the repo on the bitcoin test net

Create a DID Method governance doc

Create a document that captures the intent of the participating parties to govern the code commits to this repo as an open, inviting, Swiss-neutral place where vigorous debate is welcome and the evolution of the protocol is shared by all who seek to become material contributors.

How to register new DID using ion?

We are trying to setup identity hub where we are planing to register a new DID for performing read write operation. identity hub is using _https://beta.hub.microsoft.com/_ as hub end point but we want to use the ION setup as the hub-end-point which is running on _http://localhost:3000/_.
Now i have two challenges in ION:
a) how to register a new DID ?
b) how to get ION hub end point?

Error when launching ION bitcoin service - missing instructions or FAQ?

I have now Built ION successfully. Thanks @thehenrytsai for the update which fixes the build error. Now I am hitting a 'Transaction collection already exists.' error. I dug into the source but I didn't find this in the pre-built src, and then I searched in the dist\bitcoin.js and didn't find this string there either. Perhaps it's a bitcoind string.

My guess is that I need to configure a bitcoin wallet with bitcoin core first or generate my private key in a different way than I am doing.

There may be a section of the installation guide missing on this subject. Do you generate an address from bitcoin core or do you import an address that is generated in another way? I tried both.

Error message is below, help appreciated.


Transaction collection already exists.
Checking if bitcoin contains a wallet for [SNIP -for habits sake]
Checking if bitcoin wallet for [SNIP-for habits sake] exists
Sending jRPC request id: 62kefvvcqrp
Error: Fetch failed [401]:
at BitcoinProcessor. (/home/gitbit/ion/node_modules/@decentralized-identity/sidetree/dist/lib/bitcoin/BitcoinProcessor.js:543:31)
at Generator.next ()
at fulfilled (/home/gitbit/ion/node_modules/@decentralized-identity/sidetree/dist/lib/bitcoin/BitcoinProcessor.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
Sidetree-Bitcoin node initialization failed with error: Error: Fetch failed [401]:

npm run build failed

I got this error when run npm run build.

$ npm i  
up to date in 4.788s
$ npm run build

> [email protected] build /Users/maohongbin01/github.com/decentralized-identity/ion
> tsc && copyfiles "json/**/*.json" dist && copyfiles "tests/**/*.json" dist

src/bitcoin.ts:76:50 - error TS2339: Property 'getServiceVersion' does not exist on type 'BitcoinProcessor'.

76   const requestHandler = () => blockchainService.getServiceVersion();
                                                    ~~~~~~~~~~~~~~~~~

src/core.ts:37:39 - error TS2551: Property 'handleGetVersionRequest' does not exist on type 'Core'. Did you mean 'handleOperationRequest'?

37   const response = await sidetreeCore.handleGetVersionRequest();
                                         ~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@decentralized-identity/sidetree/dist/lib/core/Core.d.ts:31:5
    31     handleOperationRequest(request: Buffer): Promise<ResponseModel>;
           ~~~~~~~~~~~~~~~~~~~~~~
    'handleOperationRequest' is declared here.

src/ipfs.ts:30:41 - error TS2339: Property 'handleGetVersionRequest' does not exist on type 'RequestHandler'.

30   const response = await requestHandler.handleGetVersionRequest();
                                           ~~~~~~~~~~~~~~~~~~~~~~~


Found 3 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc && copyfiles "json/**/*.json" dist && copyfiles "tests/**/*.json" dist`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/maohongbin01/.npm/_logs/2019-09-29T06_35_33_987Z-debug.log

Additional Info:

$ node -v
v12.9.1
$ npm -v
6.10.2

DID resolution check fails after following installation guide

After following the ION Installation Guide, I am unable to successfully complete the last step in the guide:

Verify ION is running properly by checking the following DID resolution link in your browser: http://localhost:3000/did:ion:test:EiDk2RpPVuC4wNANUTn_4YXJczjzi10zLG1XE4AjkcGOLA

There is no result returned by the curl command:

$ curl http://localhost:3000/did:ion:test:EiDk2RpPVuC4wNANUTn_4YXJczjzi10zLG1XE4AjkcGOLA

The ion-core process (i.e., npm run core) log entries immediately after executing the curl are:

Refreshing cached blockchain time...
Refreshed blockchain time: {"time":1746649,"hash":"0000000063a4ab5a56c92a61e716d954b7440d51dcf61e5e21a51f630c5ca884"}
Handling resolution request for: did:ion:test:EiDk2RpPVuC4wNANUTn_4YXJczjzi10zLG1XE4AjkcGOLA...
Resolving DID unique suffix 'EiDk2RpPVuC4wNANUTn_4YXJczjzi10zLG1XE4AjkcGOLA'...
Fetching Sidetree transactions from blockchain service...
Fetching URI 'http://127.0.0.1:3002/transactions?since=7498991423979525&transaction-time-hash=0000000000000670b5aba7c546cb349380d22cf648385f885af8db876db72418'...
Fetch response: 200'.
Fetched 0 Sidetree transactions from blockchain service in 59 ms.
Successfully kicked off downloading/processing of all new Sidetree transactions.
Fetched 0 unresolvable transactions to retry in 1 ms.
Waiting for 60 seconds before fetching and processing transactions again.

Configuration Files

~/.bitcoin/bitcoin.conf
testnet=1
server=1
datadir=/home/<username>/.bitcoin
rpcuser=[RPC-USERNAME]
rpcpassword=[RPC-PASSWORD]
txindex=1
json/bitcoin-config.json
{
  "bitcoinFeeSpendingCutoffPeriodInBlocks": 1,
  "bitcoinFeeSpendingCutoff": 0.01,
  "bitcoinPeerUri": "http://localhost:18332",
  "bitcoinRpcUsername": "[RPC-USERNAME]",
  "bitcoinRpcPassword": "[RPC-PASSWORD]",
  "bitcoinWalletOrImportString": "[WALLET-PRIVATE-KEY]",
  "sidetreeTransactionFeeMarkupPercentage": 5,
  "sidetreeTransactionPrefix": "ion:test:",
  "genesisBlockNumber": 1723000,
  "databaseName": "sidetree-bitcoin",
  "transactionFetchPageSize": 100,
  "mongoDbConnectionString": "mongodb://localhost:27017/",
  "port": 3002,
  "valueTimeLockAmountInBitcoins": 0
}

Note: Where [WALLET-PRIVATE-KEY] is the output of bitcoin-cli dumpprivkey <wallet_public_key> and <wallet_public_key> was created by executing bitcoin-cli getnewaddress ""

json/core-config.json
{
  "batchingIntervalInSeconds": 600,
  "blockchainServiceUri": "http://127.0.0.1:3002",
  "contentAddressableStoreServiceUri": "http://127.0.0.1:3003",
  "didMethodName": "ion:test",
  "maxConcurrentDownloads": 20,
  "mongoDbConnectionString": "mongodb://localhost:27017/",
  "observingIntervalInSeconds": 60,
  "port": 3000
}

Since it appears both ways in ION guides/docs, I have tried with both of the following configurations for bitcoin-config.json and execute npm run build each time:

  "sidetreeTransactionPrefix": "ion:",

or

  "sidetreeTransactionPrefix": "ion:test:",

Version Information

Ubuntu 18.04 LTS
7.5 GB RAM
1TB SSD
Direct Internet connection with ports open: tcp/4002, tcp/4003, tcp/18333

$ node -v
v10.20.1
$ bitcoind --version
Bitcoin Core version v0.19.1
$ curl http://localhost:3002/version
{"name":"bitcoin","version":"0.7.0"}
$ curl http://localhost:3003/version
{"name":"ipfs","version":"0.7.0"}

Additional Information

The first time I execute npm run core the logging output repeatedly displays what appears to be several errors when fetching EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A, but this may be a misinterpretation given that I'm new to ION. The suspect lines are:

  • Fetched 0 Sidetree transactions from blockchain service in 67 ms.
  • Fetched 1 unresolvable transactions to retry in 2 ms.
  • Recording failed processing attempt for transaction '7498991423979525'...

and here's the full log:

$ npm run core
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2638/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] core /home/fh185036_ncr_com/ion
> node dist/src/core.js

(node:25315) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Transaction collection already exists.
Unresolvable transaction collection already exists.
Refreshing cached blockchain time...
Refreshed blockchain time: {"time":1746649,"hash":"0000000063a4ab5a56c92a61e716d954b7440d51dcf61e5e21a51f630c5ca884"}
Starting periodic transactions processing.
Sidetree node running on port: 3000
Start operation batch writing...
Fetching Sidetree transactions from blockchain service...
Fetching URI 'http://127.0.0.1:3002/transactions?since=7498991423979525&transaction-time-hash=0000000000000670b5aba7c546cb349380d22cf648385f885af8db876db72418'...
Batch size = 0
End batch writing. Duration: 16 ms.
Waiting for 600 seconds before writing another batch.
Fetch response: 200'.
Fetched 0 Sidetree transactions from blockchain service in 59 ms.
Successfully kicked off downloading/processing of all new Sidetree transactions.
Fetched 1 unresolvable transactions to retry in 2 ms.
Downloading anchor file 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A', max file size limit 1000000 bytes...
Downloading file 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A', max size limit 1000000...
Finished processing transaction '7498991423979525'.
Recording failed processing attempt for transaction '7498991423979525'...
Record transaction 7498991423979525 with anchor string AQAAAA.EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A to retry after 3840 seconds.
Waiting for 60 seconds before fetching and processing transactions again.
Refreshing cached blockchain time...
Refreshed blockchain time: {"time":1746649,"hash":"0000000063a4ab5a56c92a61e716d954b7440d51dcf61e5e21a51f630c5ca884"}
Fetching Sidetree transactions from blockchain service...
Fetching URI 'http://127.0.0.1:3002/transactions?since=7498991423979525&transaction-time-hash=0000000000000670b5aba7c546cb349380d22cf648385f885af8db876db72418'...
Fetch response: 200'.
Fetched 0 Sidetree transactions from blockchain service in 67 ms.
Successfully kicked off downloading/processing of all new Sidetree transactions.
Fetched 1 unresolvable transactions to retry in 2 ms.
Downloading anchor file 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A', max file size limit 1000000 bytes...
Downloading file 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A', max size limit 1000000...
Finished processing transaction '7498991423979525'.
Recording failed processing attempt for transaction '7498991423979525'...
Record transaction 7498991423979525 with anchor string AQAAAA.EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A to retry after 7680 seconds.
Waiting for 60 seconds before fetching and processing transactions again.

While this is occurring, the npm run ipfs log repeatedly prints out:

Handling fetch request for 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A'...
'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A' not found on IPFS.
Handling fetch request for 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A'...
'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A' not found on IPFS.
Handling fetch request for 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A'...
'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A' not found on IPFS.
Handling fetch request for 'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A'...
'EiAHFzYUV8yKtedkr1eXsY7tysqgNTKpTPrc-kxaVSfF3A' not found on IPFS.

Remove references to the bitcore-lib from the IBitcoinWallet

Two suggested changes as part of this bug:

  1. Remove the getPublicKeyAsHex function.
  2. Update the function signatures to remove references to the bicore-lib's Transaction, Address, and Script' objects. These can be replaced by strings as the bitcoin network uses them. For example, transactionAsHex, address(string),scriptAsHex`.

Accessing Sidetrees REST API endpoints on ION instance

I have installed an ION instance on a Linux server, and it seems to be running smoothly, and I am able to successfully resolve the test did from the installation guide.

However, any other API endpoint I try to access, as described in the Sidetrees implementation document, is interpreted as a DID resolution request (the log files just show: "Handling resolution request for: transactions..."

I've tried GET /time, GET /transactions and /POST transactions, but each time I simply getting an empty "400 Bad Request" response.

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.