Browse Source

drone config and doc generation

master
nitowa 2 years ago
parent
commit
898cad5f55
4 changed files with 96 additions and 4 deletions
  1. 10
    2
      README.md
  2. 83
    0
      drone.yml
  3. 2
    1
      package.json
  4. 1
    1
      test/primitives.ts

+ 10
- 2
README.md View File

5
 [![Weekly Downloads](https://img.shields.io/npm/dw/xrpio?color=important)](https://www.npmjs.com/package/xrpio)
5
 [![Weekly Downloads](https://img.shields.io/npm/dw/xrpio?color=important)](https://www.npmjs.com/package/xrpio)
6
 [![License Type](https://img.shields.io/npm/l/xrpio?color=blueviolet)](https://gitea.nitowa.xyz/docs/xrpio/src/branch/master/LICENSE.md)
6
 [![License Type](https://img.shields.io/npm/l/xrpio?color=blueviolet)](https://gitea.nitowa.xyz/docs/xrpio/src/branch/master/LICENSE.md)
7
 
7
 
8
-xrpio is a library that allows you to write and read arbitrary data to the ripple blockchain.
8
+xrpio is a library that allows you to write and read arbitrary data in the ripple blockchain.
9
 
9
 
10
 # How to install
10
 # How to install
11
 ```
11
 ```
19
 const api = new RippleAPI({ server: "..." }) 
19
 const api = new RippleAPI({ server: "..." }) 
20
 await api.connect()
20
 await api.connect()
21
 
21
 
22
-const dataRootHash = await treeWrite(api, "Arbitrary string data 123", {address: "Sender address", secret: "Sender private key"}, "Receiver address")
22
+const dataRootHash = await treeWrite(
23
+    api, 
24
+    "Arbitrary string data 123", 
25
+    { 
26
+        address: "Sender address", 
27
+        secret: "Sender private key"
28
+    }, 
29
+    "Receiver address"
30
+)
23
 
31
 
24
 const data = await treeRead(api, [dataRootHash])
32
 const data = await treeRead(api, [dataRootHash])
25
 console.log(data) //"Arbitrary string data 123"
33
 console.log(data) //"Arbitrary string data 123"

+ 83
- 0
drone.yml View File

1
+---
2
+kind: pipeline
3
+type: docker
4
+name: default
5
+
6
+steps:
7
+
8
+- name: restore cache
9
+  image: drillster/drone-volume-cache
10
+  settings:
11
+    restore: true
12
+    mount:
13
+      - ./node_modules
14
+  volumes:
15
+  - name: cache
16
+    path: /cache
17
+
18
+- name: npm install
19
+  image: node:12
20
+  commands:
21
+  - npm install
22
+
23
+- name: npm run build
24
+  image: node:12
25
+  commands:
26
+  - npm run build
27
+
28
+- name: rebuild cache
29
+  image: drillster/drone-volume-cache
30
+  settings:
31
+    rebuild: true
32
+    mount:
33
+      - ./node_modules
34
+  volumes:
35
+  - name: cache
36
+    path: /cache
37
+
38
+- name: npm run test
39
+  image: node:12
40
+  commands:
41
+  - npm run test
42
+
43
+- name: build docs
44
+  image: node:12
45
+  commands:
46
+  - npm run docs
47
+  when:
48
+    event:
49
+      - tag
50
+
51
+- name: deliver docs
52
+  image: node:12
53
+  commands:
54
+  - echo ${DRONE_BUILD_CREATED}
55
+  - git clone https://gitea.nitowa.xyz/docs/${DRONE_REPO_NAME}.git; cd ${DRONE_REPO_NAME} && rm -rf ./*; cp -r ../docs/* .; cp ../LICENSE.md .
56
+  - sed -i '1,3d; $d' README.md && echo "### Version\n\n${DRONE_TAG}\n" >> ./README.md
57
+  - sed -i -e 1,4d ./globals.md && cat ./globals.md >> ./README.md
58
+  - git add --all; git -c user.email="${DRONE_COMMIT_AUTHOR_EMAIL}" -c user.name="${DRONE_COMMIT_AUTHOR}" commit --all --allow-empty --message "generated from tag ${DRONE_TAG}"
59
+  - (git tag ${DRONE_TAG} && git push --force origin master ${DRONE_TAG}) || true
60
+  environment:
61
+    GIT_USER:
62
+      from_secret: git_user
63
+    GIT_PASSWORD:
64
+      from_secret: git_password
65
+  when:
66
+    event:
67
+      - tag
68
+
69
+- name: npm publish
70
+  image: plugins/npm
71
+  settings:
72
+    username: nitowa
73
+    password:
74
+      from_secret: npm_password
75
+    email: peter.millauer@gmail.com
76
+  when:
77
+    event:
78
+      - tag
79
+
80
+volumes:
81
+- name: cache 
82
+  host:
83
+    path: /tmp

+ 2
- 1
package.json View File

13
     "webpack-gui": "webpack --config webpack.gui.js --progress && cp build/gui/main.js gui",
13
     "webpack-gui": "webpack --config webpack.gui.js --progress && cp build/gui/main.js gui",
14
     "webpack-gateway": "webpack --config webpack.gateway.js --progress && cp build/gateway/main.js gateway",
14
     "webpack-gateway": "webpack --config webpack.gateway.js --progress && cp build/gateway/main.js gateway",
15
     "test": "npm run build && mocha --bail=true ./lib/test/*.js",
15
     "test": "npm run build && mocha --bail=true ./lib/test/*.js",
16
-    "deploy": "node ./lib/Deploy.js"
16
+    "deploy": "node ./lib/Deploy.js",
17
+    "docs": "typedoc --out docs ./src --readme ./README.md --plugin typedoc-plugin-markdown --mode file --hideBreadcrumbs --hideSources"
17
   },
18
   },
18
   "author": "nitowa",
19
   "author": "nitowa",
19
   "license": "MIT",
20
   "license": "MIT",

+ 1
- 1
test/primitives.ts View File

60
         let treeRoot
60
         let treeRoot
61
         it(`can tree write (${TEST_DATA.length} bytes)`, async function (){
61
         it(`can tree write (${TEST_DATA.length} bytes)`, async function (){
62
             this.timeout(10000)
62
             this.timeout(10000)
63
-            treeRoot = await treeWrite(api, TEST_DATA, sendWallet, receiveWallet.address)
63
+            treeRoot = await treeWrite(api, TEST_DATA, {address: "123", secret: "123"}, receiveWallet.address)
64
         })
64
         })
65
     
65
     
66
         it('can tree read', async function() {
66
         it('can tree read', async function() {

Loading…
Cancel
Save