https://github.com/elastos/elastos.org.sidechain.service
https://github.com/elastos/elastos.org.sidechain.service
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/elastos/elastos.org.sidechain.service
- Owner: elastos
- Created: 2018-10-10T09:16:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-17T11:53:06.000Z (over 4 years ago)
- Last Synced: 2025-02-12T20:38:36.733Z (4 months ago)
- Language: Java
- Size: 106 KB
- Stars: 0
- Watchers: 27
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Elastos.ORG.DID.Service
==============[Elastos.ORG.DID.Service documentation](https://didservice.readthedocs.io)
This repo provide simple HTTP Restful API for developers to interact with elastos did sidechain . you may need to construct your own local node to use some of these API , never provide private key to any third party .
## Quick Start
Run with `Maven`:
```xml
org.elastos
did.api
0.0.6```
- Update `did.api/src/main/resources/application.properties` and ensure that `node.didPrefix` is set to the endpoint of the Elastos.DID you are using and optionally set `did.address`.
- Install Project: `mvn install -Dmaven.test.skip -Dgpg.skip`This will build the JAR file executable which can be found at `did.api/target`, for example v0.0.6 will be `did.api-0.0.6.jar`.
or `Gradle`:
```sh
compile 'org.elastos:did.api:0.0.6'
```Add A Entry Class
```java
@SpringBootApplication
public class MainEntry {public static void main(String[] args) {
SpringApplication.run(org.elastos.Application.class, args);
}
}
```Add application.properties in resources
```
## chain restful url
## change to your local DID sidechain node resutful port
node.didPrefix = http://localhost:20334
node.connectionCount = /api/v1/node/connectioncount
node.state = /api/v1/node/state
node.blockTxByHeight = /api/v1/block/transactions/height/
node.blockByHeight = /api/v1/block/details/height/
node.blockByhash = /api/v1/block/details/hash/
node.blockHeight = /api/v1/block/height
node.blockHash = /api/v1/block/hash/
node.transaction = /api/v1/transaction/
node.asset = /api/v1/asset/
node.balanceByAddr = /api/v1/asset/balances/
node.balanceByAsset = /api/v1/asset/balance/
node.utxoByAsset = /api/v1/asset/utxo/
node.utxoByAddr = /api/v1/asset/utxos/
node.sendRawTransaction = /api/v1/transaction
node.transactionPool = /api/v1/transactionpool
node.restart = /api/v1/restart## api return status code
retcode.SUCC = 200
retcode.BAD_REQUEST = 400
retcode.NOT_FOUND = 404
retcode.INTERNAL_ERROR = 500
retcode.PROCESS_ERROR = 10001## basic
basic.ONE_ELA = 100000000
basic.FEE = 0.000001
basic.CROSS_CHAIN_FEE = 0.0001## application
server.port = 8091## log
logging.level.root =INFO
logging.level.org.elastos=DEBUG## DID related api
## did setting field output receiving adddress , you can set you own receiving address
did.address =EbxU18T3M9ufnrkRY7NLt6sKyckDW4VAsA
did.fee =0.0001
did.burnAddress =0000000000000000000000000000000000
```